diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 035387834bd..84deea18f00 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,7 +3,7 @@ *Please:* - *only keep the "Fix", "Close" or "New" section* - *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)* -- *replace the bracket enclosed textswith meaningful informations* +- *replace the bracket enclosed texts with meaningful information* # Fix #[*issue_number Short description*] diff --git a/.travis.yml b/.travis.yml index 22d4b2b0827..b48a3667bb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,9 @@ dist: xenial language: php +git: + depth: 1 + # Start on every boot services: - memcached @@ -41,16 +44,20 @@ jobs: #allow_failures: #- php: nightly include: - - if: type = push + - stage: PHP 5.6-7.4 + if: type = push php: '5.6' env: DB=postgresql - - if: type = pull_request OR type = push + - stage: PHP 5.6-7.4 + if: type = pull_request OR type = push php: '7.4' env: DB=mysql - - if: type = push AND branch = develop + - stage: PHP Dev + if: type = push AND branch = develop php: nightly env: DB=mysql - - if: type = push AND branch = 14.0 + - stage: PHP Dev + if: type = push AND branch = 14.0 php: nightly env: DB=mysql @@ -264,24 +271,27 @@ script: echo - | - echo "Checking PHP syntax errors" + echo "Checking PHP syntax errors (only 1 version to not overload travis and avoid duplicate tests)" # Ensure we catch errors set -e #parallel-lint --exclude htdocs/includes --blame . - parallel-lint --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \ - --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \ - --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \ - --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \ - --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame . + # Exclusions are defined in the ruleset.xml file + if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then + parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \ + --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \ + --exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \ + --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \ + --exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame . + fi set +e echo - | - echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)" + echo "Checking coding style (only for Pull Requests builds and 1 version to not overload travis and avoid duplicate tests)" # Ensure we catch errors set -e # Exclusions are defined in the ruleset.xml file - if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi set +e @@ -401,11 +411,16 @@ script: php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log + ls -alrt $TRAVIS_BUILD_DIR/ +- | + echo "Enabling new modules" # Enable modules not enabled into original dump - php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log + set -e + php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE,MAIN_MODULE_EXPENSEREPORT > $TRAVIS_BUILD_DIR/enablemodule.log php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log + php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $TRAVIS_BUILD_DIR/enablemodule.log echo $? cd - set +e diff --git a/COPYRIGHT b/COPYRIGHT index aedcb1be614..c43d77581a7 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,13 +1,24 @@ -License -------- +Copyright and license +---------------------- -Dolibarr is released under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 3 of the License, -or (at your option) any later version (GPL-3+). -More information: https://www.gnu.org/licenses/gpl-3.0.txt +The Dolibarr software as a whole is distributed under the GNU General Public License as published by the Free Software Foundation; +either version 3 of the License, or (at your option) any later version (GPL-3+). More information: https://www.gnu.org/licenses/gpl-3.0.txt. +A copy of this license is available in the COPYING file. +Dolibarr depends on third-party components and code snippets released under their own license (obviously, all compatible with the one of Dolibarr). +These dependencies are listed in the bottom of this file. -Dolibarr uses some external libraries released under different licenses. This is compatibility summary: + +The Dolibarr images resources (available in the doc directory) is distributed under the Creative Commons Attribution 4.0 International license (CC BY 4.0). + + +The name Dolibarr is a trademark initially registered by Laurent Destailleur and ceased to the Dolibarr foundation. You can use the name Dolibarr +for your own need as long as you follow the rules defined on the page https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22 +The use of the name DoliStore is also restricted to the same rules defined on https://wiki.dolibarr.org/index.php/Rules_to_use_the_brand_name_%22Dolibarr%22 + + + +Licence of dependencies of third-party components used by Dolibarr (all compatible with the Licence of Dolibarr): Component Version License GPL Compatible Usage ------------------------------------------------------------------------------------- @@ -28,7 +39,7 @@ php-iban 1.4.7 LGPL-3+ Yes PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests PSR/Logs 1.0 Library for logs (used by DebugBar) -PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet) +PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet) Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer) Sabre 3.2.2 BSD Yes DAV support Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP @@ -63,11 +74,10 @@ Font libraries: Fontawesome 5.13 Font Awesome Free Licence Yes -For licenses compatibility informations: -https://www.gnu.org/licenses/licenses.en.html +For more licenses compatibility informations: https://www.gnu.org/licenses/licenses.en.html -Copyright / Authors +Authors ------------------- See page https://github.com/Dolibarr/dolibarr/graphs/contributors diff --git a/ChangeLog b/ChangeLog index bb44e0fa0be..66bccd31c06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,170 +3,267 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 15.0.0 compared to 14.0.0 ***** + +For developers: +--------------- + +WARNING: + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook. + ***** ChangeLog for 14.0.0 compared to 13.0.0 ***** For users: ---------- -NEW: Module Recruitement to follow application to job positions is now stable. +NEW: Module Recruitment to follow application to job positions is now stable. NEW: Feature to make Stock Inventories NEW: Several security issues after a second private bug hunting campaign. -NEW: Add a security center page with all information and advices related to the security of your instance -NEW: Add a performance center page with all information and advices related to the performance of your instance NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better) NEW: All main menu entries are using the picto of the module NEW: Add a copy to clipboard button on some fields -NEW: Add an example of scheduled job to send email reminder for unpayed invoices -NEW: Accountancy - Add FEC import -NEW: Accountancy - Add a confirmation form with options on export -NEW: Accountancy - Add select date from/to in already bind customer and supplier list -NEW: Accountancy - Format FEC - Add new field DateLimitReglmt -NEW: Accountancy - In ledger & journals, show link on bank transaction -NEW: Accountancy - Possibility to filter on journals in balance -NEW: Accountancy - Add a page to list subledger accounts -NEW: add the Channel column into the list of orders -NEW: Add a check to avoid an invoice date in the future +NEW: Add an example of scheduled job to send email reminder for unpaid invoices NEW: Add some color and picto for the direction of movement +NEW: add the column "Channel" into the list of orders NEW: Add the column "alias" of company in the list of proposal, order, invoice NEW: Add the column "Office phone" and "User mobile" in user list -NEW: Add the column "Price level"in thirdparty list +NEW: Add the column "Price level" in thirdparty list NEW: Add some company information in the dropdown login menu -NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug" -NEW: Add contact tag and bulk email status on the thirparty+contact create form -NEW: Add db fields note_public and note_private for ECM module -NEW: Manage deposit on supplier invoice (& somes ajustments) NEW: Add edit/delete action icons on categories list pages NEW: Add hidden option to auto load input line extrafield into new lines NEW: Add import profile to import BOM -NEW: Add last date of modification for website pages in the list of pages NEW: Add link picto to the stock movement on the detail of production NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members NEW: Add bulk action Validate and Set to billed on order list. -NEW: add bulk action to set a commercial proposal to status "Refused" -NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD and SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared. -NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs -NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field -NEW: Add a new permission "Export website" NEW: Add possibility to exports userGroups fields on user exports -NEW: Add price min and price min including tax into product export NEW: Can search on lots or serials into the quick search bar NEW: Add support for Friday as a non working day -NEW: Add a total in page of margin by user -NEW: Add the total of margin in invoice list -NEW: Can set a Warehouse on a Thirparty NEW: auto notification with module Notification can use templated emails -NEW: Bank Entries : display user linked to a salary or a taxes -NEW: Can set a warehouse in a proposal -NEW: Can clone a cron job. +NEW: Can clone a cron job NEW: Can create a lot from the list view (Look and feel standardization). -NEW: Can filter files in GED on status Shared/Not shared NEW: Can filter on extrafields date on lists -NEW: Can filter on rowid in list of blocked logs. -NEW: Can hide columns "time consumed" on timesheet per week. +NEW: Can filter on rowid in list of blocked logs +NEW: Can hide columns "time consumed" on timesheet per week NEW: Can set an employee on each social contribution -NEW: Can set a percentage when creating an invoice from another object -NEW: Can set if a ticket group is visible on public interface or not. NEW: Can set order of execution of hooks -NEW: Can show the leave dates/holidays on the agenda view. -NEW: Can show the project ref into PDF documents NEW: Can toggle FCKeditor on public/private notes -NEW: Can use captcha on public page to create a ticket NEW: Check update availability for externals modules using a button on module page NEW: Choose lines to use while creating intervention card from origin -NEW: Column shippement method, payment mode, payment term in proposal and order list -NEW: Conf for default actiomm status -NEW: customer ref for product customer prices -NEW: date and user signature on proposal (Issue 16062) +NEW: Columns shipment method, payment mode, payment term in proposal and order list +NEW: Conf for default actioncomm status NEW: Dictionary for availability - Add a column position -NEW: TAKEPOS delayed payment in TakePOS -NEW: TAKEPOS display date range if exist in TakePOS -NEW: TAKEPOS display resiliate status in TakePOS for member -NEW: TAKEPOS Edit sales lines rights in TakePOS -NEW: TAKEPOS Option for Takepos to show the total price without tax -NEW: TAKEPOS More permission in TakePOS (Can edit added line, can modify once order sent to kitchen) NEW: Can set a user related to a social contribution NEW: ICS Direct debit can be set with a different value for each bank account NEW: LDAP: usergroup search can be filtered NEW: Make public bookmarks editable by admin users only NEW: If main logo not defined, can use the squarred logo on login page NEW: The manifest file can use the squared image if available -NEW: Add bulk actions for Bank Transfer NEW: Enhance the multicurrency rate editor -NEW: Multiselect ledger account code filter on book keeping list -NEW: Normalyse Type company field with ajax combobox -NEW: option to automatically close an open project when all its tasks are done (=progress 100%) -NEW: option to select membership type on the online payment page for membership subscription or renewal +NEW: Normalise Type company field with ajax combobox NEW: preload product description on selection for customer propal/order/invoice -NEW: Add a ref in product customer price -NEW: Save old page with .old extension on disk when editing a website page NEW: Search usergroups & resources -NEW: Set status of all variants when changing status of parent NEW: Setup Page for module creation with module builder enhancement #FoundationFunding NEW: Show picto of module into the list of dictionaries NEW: Show the total of payment on the payment confirmation page -NEW: Stock movement list - Add more complete date field -NEW: Support color for types of event NEW: The global setup for Mandatory fields can now be done on combo list too. NEW: translate in "en_US" to complete PR 16980 NEW: Update the list of taxes available by default for France -NEW: Add captcha on public page to create a ticket NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording NEW: VAT report - Optimisation & collapse by rate -NEW: When we add contacts/users to a project, ask to also affect them on tasks. NEW: When a doc file is shared, link is visible from the main page of doc. -NEW: Add option in Workflow module to set a shipment as closed. -NEW: Option to automatically create a login/user when a new subscription of a member is done online -NEW: #16378 More E-Mail Contact substitution Values for better salutation -NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page -NEW: #17113 Can upload a favicon in website module +NEW: #16378 more E-Mail Contact substitution Values for better salutation +NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page + + Accountancy +NEW: Add FEC import +NEW: Add a confirmation form with options on export (for notified export and validate operations) +NEW: Add select date from/to in already bind customer and supplier list +NEW: FEC / FEC2 export - Add new field DateLimitReglmt +NEW: In ledger & journals, show link on bank transaction +NEW: Possibility to filter on journals in balance +NEW: Add a page to list subledger accounts +NEW: Multiselect journal code filter on journal / balance / ledger +NEW: Add first step to close fiscal year + + Agenda +NEW: add support for Friday as a non working day +NEW: can show the leave dates/holidays on the agenda view +NEW: Support color for types of event + + Bank +NEW: Bank Entries : display user linked to a salary or a taxes +NEW: Add bulk actions for Bank Transfer + + ECM/GED +NEW: add DB fields note_public and note_private for ECM module +NEW: can filter files in ECM/GED on status Shared / Not shared + + Invoices +NEW: add a check to avoid an invoice date in the future +NEW: add the total of margin in invoice list +NEW: can set a percentage when creating an invoice from another object +NEW: Support down payment on supplier invoice (& some adjustments) + + Margin +NEW: add the total of margin in invoice list +NEW: add the total of margin in page by user + + Members NEW: #17292 default subscription amount by adherent type +NEW: option to automatically create a login/user when a new subscription of a member is done online +NEW: option to select membership type on the online payment page for membership subscription or renewal + + Products +NEW: Add price min and price min including tax into product export +NEW: Add a ref in product customer price +NEW: customer ref for product customer prices +NEW: Set status of all variants when changing status of parent + + Projects/Tasks +NEW: option to automatically close an open project when all its tasks are done (=progress 100%) +NEW: can show the project ref into PDF documents +NEW: when we add contacts/users to a project, ask to also affect them on tasks +NEW: Can hide columns "time consumed" on timesheet per week + + Proposals +NEW: add bulk action to set a commercial proposal to status "Refused" +NEW: can set a warehouse in a proposal +NEW: date and user signature on proposal (Issue 16062) #16980 + + Shipment +NEW: add option in Workflow module to set a shipment as closed + + TakePOS +NEW: delayed payment in TakePOS #14456? +NEW: display date range if exist in TakePOS +NEW: display resiliate status in TakePOS for member +NEW: edit sales lines rights in TakePOS +NEW: option for TakePOS to show the total price without tax +NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen) + + Third Party / Contacts +NEW: add contact tag and bulk email status on the thirdparty + contact create form +NEW: can set a warehouse on a thirdparty + + Tickets +NEW: can use captcha on public page to create a ticket #16347 +NEW: can set if a ticket group is visible on public interface or not + + Warehouse/Stock +NEW: Feature to make Stock Inventories +NEW: can make massive stock transfers from a CSV file +NEW: Stock movement list - add more complete date field +NEW: can set a warehouse in a proposal +NEW: can set a warehouse on a thirdparty + + Website Module +NEW: #17113 Can upload a favicon in website module +NEW: add a new permission "Export website" +NEW: add last date of modification for website pages in the list of pages +NEW: Save old page with .old extension on disk when editing a website page + + Workflows +NEW: add option in Workflow module to set a shipment as closed + + + for Admins +NEW: Add a security center page with all information and advices related to the security of your instance +NEW: Add a performance center page with all information and advices related to the performance of your instance + + Modules +NEW: Module Recruitment is now stable NEW: start new experimental module Event Organization Management NEW: start new experimental module Partnership Management NEW: start new experimental module Knowledge Management -NEW: start new experimental module Workstations management +NEW: start new experimental module Workstations Management +NEW: Check update availability for externals modules using a button on module page +Module SimplePOS is deprecated - TakePOS is recommended for the future + + new Options +NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared +NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs +NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field +NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug" +NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card +NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities +NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities For developers: --------------- NEW: Can edit an object property in module builder -NEW: hook printFieldListTitle for cabyprodserv.php -NEW: Hook to allow external modules to add their own shortlist of recent objects -NEW: SQL-altering hooks in the turnover by product report NEW: Add data-eec=1 for EEC countries on select for js interaction NEW: Add experimental repair script to switch to dynamic row format and utf8mb4 encoding -NEW: add form confirm hook on company card NEW: Add function showValueWithClipboardCPButton() to add a copy/paste -NEW: Add hook addSectionECMAuto method to add custom diretory into ECM auto files -NEW: Add native compression in rest apis -NEW: Product Variants API, add variant stock to response by parameter NEW: Upgrade Stripe PHP lib to 7.67.0 -NEW: Add link to OpenAPI specifications xml file in REST API module setup: swagger.json file can be included into external tools like redoc NEW: Support sepa_debit in stripe paymentmethods list NEW: Update doleditor.class.php for easily activate SCAYT NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked() NEW: Add triggers OBJECT_LINK_INSERT, OBJECT_LINK_UPDATE et OBJECT_LINK_DELETE in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked() -NEW: API Add option $includeifobjectisused to get a product -NEW: API Get the list of product ids only -NEW: Can set a target image in dolcropresize function. -NEW: Can set a label as placeholder for combo lists. +NEW: can set a target image in dolcropresize function +NEW: can set a label as placeholder for combo lists NEW: Add pagination on Get Products response API NEW: Add the DefaultValues CRUD class NEW: Extrafields of documents lines are inside the lines, not any more on separate TR NEW: unit selection on object edit line -NEW: #13739 #17390 Product API route added to get product stock and product with or without variants + + APIs +NEW: API add option $includeifobjectisused to get a product +NEW: API get the list of product ids only +NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc +NEW: add native compression in REST APIs +NEW: Product Variants API, add variant stock to response by parameter +NEW: Product API route added to get product stock and product with or without variants #13739 #17390 + + Hooks +NEW: hook printFieldListTitle for cabyprodserv.php +NEW: hook to allow external modules to add their own shortlist of recent objects +NEW: SQL-altering hooks in the turnover by product report +NEW: add form confirm hook on company card +NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup. +* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS. +* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup. * API /setup/shipment_methods has been replaced with API /setup/shipping_methods -* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency -* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency -* Field "total" renamed into "total_ttc" for table lx_propal, llx_supplier_proposal for better field name consistency -* If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) -* If your database is MySql or MariaDB, you need at least version 5.1 +* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency +* Field "tva" renamed into "total_tva" for llx_facture, table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency +* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency +* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT) +* If your database is MySQL or MariaDB, you need at least version 5.1 * Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules +* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__) +* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries. +* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8. + + +***** ChangeLog for 13.0.4 compared to 13.0.3 ***** + +FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules). +FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling 'ajax_autocompleter()' +FIX: #17919 pictures in docs +FIX: #18006 +FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding +FIX: Accountancy - Limit date payment not registered on purchases operations +FIX: Can't edit replacement invoice +FIX: deposit can create credit note in payment conf +FIX: division by zero on create +FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field +FIX: holiday: status filter parameter has been renamed but not in links it was used +FIX: List and Create Companies Left Menus +FIX: method exists +FIX: need to add payment sum to getlibstatus function in object linked block +FIX: permission to close a proposal when using advanced permissions +FIX: Problem of z-index with popup and top menu +FIX: same thing on supplier orders +FIX: Status of invoice when making a replacement invoice +FIX: update contact birthday alert ***** ChangeLog for 13.0.3 compared to 13.0.2 ***** @@ -178,6 +275,8 @@ FIX: #17060 FIX: #17192 - With tz < 0, event is show in bad day on calendar views FIX: #17363 FIX: #17476 releve.php: Fix SQL statement +FIX: #17967 +Fix: #17906 : fix access denied FIX: Accountancy - Import in general ledger FIX: Accountancy - Quadra export - wrong data on credit FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries @@ -191,7 +290,7 @@ FIX: create sociales : keep values error form FIX: dol_print_date for %a and %b with some timezone FIX: email is not case sensitive FIX: error for duplicate thirdparty found correctly returned by ws -FIX: Espadon PDF shippment model with long public note now wroking +FIX: Espadon PDF shippment model with long public note now working FIX: esupplier order: error 500 when using packaging with product where it is not defined FIX: Filter on debit/credit FIX: Filter on supplier payment list @@ -224,7 +323,6 @@ FIX: test must be === and not == FIX: test on link type FIX: type link extrafield case for advanced target emailing FIX: Write right on document ->>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git ***** ChangeLog for 13.0.2 compared to 13.0.1 ***** @@ -256,7 +354,7 @@ FIX: File attachment on lots/batches FIX: handling $heightforinfotot when he's superior to a page height on Supplier Invoice FIX: hourglass and hide button to pay FIX: massaction validate invoice do not regenerate PDF -FIX: missing mp4 video mime +FIX: #16627 fix missing mp4 video mime FIX: picto on shipment to reset qty to 0. Some quantities were not reset. FIX: Protection to avoid #16504 FIX: rounding amount on card updating diff --git a/README-FR.md b/README-FR.md index 77bb5a3e27a..81fdff13047 100644 --- a/README-FR.md +++ b/README-FR.md @@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) + ## LICENCE Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. + ## INSTALLER DOLIBARR ### Configuration simple @@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg - Suivez les instructions de l'installateur + ## METTRE A JOUR DOLIBARR Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: @@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: *Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* + ## CE QUI EST NOUVEAU -Voir fichier ChangeLog. +See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. + ## CE QUE DOLIBARR PEUT FAIRE @@ -82,15 +87,17 @@ Voir fichier ChangeLog. - Calendrier/Agenda partagé (avec export ical, vcal) - Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...) - Gestion de contrats de services -- Gestion de stock +- Gestion de stock et inventaires - Gestion des expéditions - Gestion des demandes de congès - Gestion des notes de frais +- Gestion de recrutement - GED (Gestion Electronique de Documents) - EMailings de masse - Réalisation de sondages +- Gestion d'adhérents - Point de vente/Caisse enregistreuse -- … +- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions) ### Autres modules @@ -135,31 +142,36 @@ Voir fichier ChangeLog. Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com). + ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE Voici un liste de fonctionnalités pas encore gérées par Dolibarr: -- Dolibarr ne contient pas de module de Gestion de la paie. +- Dolibarr ne contient pas de module de génération de feuille de paie. - Les tâches du module de gestion de projets n'ont pas de dépendances entre elle. - Dolibarr n'embarque pas de Webmail intégré nativement. - Dolibarr ne fait pas le café (pas encore). + ## DOCUMENTATION La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). + ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. + ## CREDITS Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs. Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) + ## ACTUALITES ET RESEAUX SOCIAUX Suivez le projet Dolibarr project sur les réseaux francophones diff --git a/README.md b/README.md index 0a3aeecb9f4..834cc09236e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence. You can use it as a standalone application or as a web application to access it from the Internet or a LAN. -Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) +Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) @@ -79,7 +79,7 @@ If you don't have time to install it yourself, you can try some commercial 'read ## UPGRADING -Dolibarr supports upgrading usually wihtout the need for any (commercial) support (depending on if you use any commercial extensions) and 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! +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! - At first make a backup of your Dolibarr files & than [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](./doc/phpmatrix.md). @@ -97,48 +97,80 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Main application/modules (all optional) -- Customers, Prospects (Leads) and/or Suppliers directory + Contacts -- Members/Membership management -- Products and/or Services catalog -- Commercial proposals management -- Customer & Supplier Orders management -- Invoices and payment management -- Shipping management -- Warehouse/Stock management -- Manufacturing Orders -- Bank accounts management -- Direct debit orders management (European SEPA) -- Accounting management -- Shared calendar/agenda (with ical and vcal export for third party tools integration) -- Opportunities or Leads management -- Projects & Tasks management -- Ticket System -- Contracts management -- Interventions management -- Employee's leave requests management -- Expense reports -- Timesheets -- Electronic Document Management (EDM) -- Foundations members management -- Point of Sale (POS) -- … +- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts +- Members/Membership/Foundation management + + Product Management +- Products and/or Services catalog +- Stock / Warehouse management + Inventory +- Barcodes +- Batches / Lots / Serials +- Product Variants +- Bill of Materials (BOM) +- Manufacturing Orders + + Customer/Sales Management +- Customers/Prospects + Contacts management +- Opportunities or Leads management +- Commercial proposals management +- Customer Orders management +- Contracts/Subscription management +- Interventions management +- Ticket System +- Shipping management +- Customer Invoices/Credit notes and payment management +- Point of Sale (POS) + + Supplier/Purchase Management +- Suppliers/Vendors + Contacts +- Supplier (price) requests +- Purchase Orders management +- Delivery/Receiption +- Supplier Invoices/credit notes and payment management +- INCOTERMS + + Finance / Accounting +- Invoices / Payments +- Bank accounts management +- Direct debit orders management (European SEPA) +- Accounting management +- Donations management +- Loan management +- Margins +- Reports + + Collaboration +- Shared calendar/agenda (with ical and vcal export for third party tools integration) +- Projects & Tasks management +- Ticket System +- Surveys + + HR +- Employee's leave requests management +- Expense reports +- Recruitment management +- Timesheets + ### Other application/modules +- Electronic Document Management (EDM) - Bookmarks management -- Donations management - Reporting -- Surveys - Data export/import -- Barcodes support +- Barcodes - Margin calculations - LDAP connectivity - ClickToDial integration - Mass emailing - RSS integration - Skype integration +- Social platforms linking - Payment platforms integration (PayPal, Stripe, Paybox...) -- … +- Email-Collector + +(around 100 modules available by default, 1000+ on the addon market place) + ### Other general features @@ -170,9 +202,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### System Environment / Requirements -- Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)) +- PHP +- MariaDB, MySQL or PostgreSQL - Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites. +See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite) + ### Extending diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 9ea62de9048..4f80f06d444 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -245,6 +245,14 @@ RESTLER: // @CHANGE LDR if (!is_string($haystack)) return false; +* Replace + + $loaders = array_unique(static::$rogueLoaders); + + with + + $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); + +With swagger 2 provided into /explorer: ---------------------------------------- diff --git a/dev/examples/zapier/creates/contact.js b/dev/examples/zapier/creates/contact.js new file mode 100644 index 00000000000..bcb849ad63d --- /dev/null +++ b/dev/examples/zapier/creates/contact.js @@ -0,0 +1,74 @@ +/*jshint esversion: 6 */ +// create a particular contact by name +const createContact = async (z, bundle) => { + const apiurl = bundle.authData.url + '/api/index.php/contacts'; + + const response = await z.request({ + method: 'POST', + url: apiurl, + body: { + name: bundle.inputData.name, + name_alias: bundle.inputData.name_alias, + ref_ext: bundle.inputData.ref_ext, + ref_int: bundle.inputData.ref_int, + address: bundle.inputData.address, + zip: bundle.inputData.zip, + town: bundle.inputData.town, + country_code: bundle.inputData.country_code, + country_id: bundle.inputData.country_id, + country: bundle.inputData.country, + phone: bundle.inputData.phone, + email: bundle.inputData.email, + sens: 'fromzapier' + } + }); + const result = z.JSON.parse(response.content); + // api returns an integer when ok, a json when ko + return result.response || {id: response}; +}; + +module.exports = { + key: 'contact', + noun: 'Contact', + + display: { + label: 'Create Contact', + description: 'Creates a contact.' + }, + + operation: { + inputFields: [ + {key: 'name', required: true}, + {key: 'name_alias', required: false}, + {key: 'address', required: false}, + {key: 'zip', required: false}, + {key: 'town', required: false}, + {key: 'email', required: false} + ], + perform: createContact, + + sample: { + id: 1, + name: 'DUPOND', + name_alias: 'DUPOND Ltd', + address: 'Rue des Canaries', + zip: '34090', + town: 'MONTPELLIER', + phone: '0123456789', + fax: '2345678901', + email: 'robot@domain.com' + }, + + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'address', label: 'Address'}, + {key: 'zip', label: 'Zip'}, + {key: 'town', label: 'Town'}, + {key: 'phone', label: 'Phone'}, + {key: 'fax', label: 'Fax'}, + {key: 'email', label: 'Email'} + ] + } +}; diff --git a/dev/examples/zapier/creates/member.js b/dev/examples/zapier/creates/member.js new file mode 100644 index 00000000000..152f1129e79 --- /dev/null +++ b/dev/examples/zapier/creates/member.js @@ -0,0 +1,74 @@ +/*jshint esversion: 6 */ +// create a particular member by name +const createMember = async (z, bundle) => { + const apiurl = bundle.authData.url + '/api/index.php/members'; + + const response = await z.request({ + method: 'POST', + url: apiurl, + body: { + name: bundle.inputData.name, + name_alias: bundle.inputData.name_alias, + ref_ext: bundle.inputData.ref_ext, + ref_int: bundle.inputData.ref_int, + address: bundle.inputData.address, + zip: bundle.inputData.zip, + town: bundle.inputData.town, + country_code: bundle.inputData.country_code, + country_id: bundle.inputData.country_id, + country: bundle.inputData.country, + phone: bundle.inputData.phone, + email: bundle.inputData.email, + sens: 'fromzapier' + } + }); + const result = z.JSON.parse(response.content); + // api returns an integer when ok, a json when ko + return result.response || {id: response}; +}; + +module.exports = { + key: 'member', + noun: 'Member', + + display: { + label: 'Create Member', + description: 'Creates a member.' + }, + + operation: { + inputFields: [ + {key: 'name', required: true}, + {key: 'name_alias', required: false}, + {key: 'address', required: false}, + {key: 'zip', required: false}, + {key: 'town', required: false}, + {key: 'email', required: false} + ], + perform: createMember, + + sample: { + id: 1, + name: 'DUPOND', + name_alias: 'DUPOND Ltd', + address: 'Rue des Canaries', + zip: '34090', + town: 'MONTPELLIER', + phone: '0123456789', + fax: '2345678901', + email: 'robot@domain.com' + }, + + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'name', label: 'Name'}, + {key: 'name_alias', label: 'Name alias'}, + {key: 'address', label: 'Address'}, + {key: 'zip', label: 'Zip'}, + {key: 'town', label: 'Town'}, + {key: 'phone', label: 'Phone'}, + {key: 'fax', label: 'Fax'}, + {key: 'email', label: 'Email'} + ] + } +}; diff --git a/dev/examples/zapier/creates/thirdparty.js b/dev/examples/zapier/creates/thirdparty.js index 3e20fd10e41..2abeef6ae4c 100644 --- a/dev/examples/zapier/creates/thirdparty.js +++ b/dev/examples/zapier/creates/thirdparty.js @@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => { const response = await z.request({ method: 'POST', url: apiurl, - body: JSON.stringify({ + body: { name: bundle.inputData.name, name_alias: bundle.inputData.name_alias, ref_ext: bundle.inputData.ref_ext, @@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => { code_client: bundle.inputData.code_client, code_fournisseur: bundle.inputData.code_fournisseur, sens: 'fromzapier' - }) + } }); const result = z.JSON.parse(response.content); // api returns an integer when ok, a json when ko diff --git a/dev/examples/zapier/index.js b/dev/examples/zapier/index.js index d1897673b39..fdd1ed29a53 100644 --- a/dev/examples/zapier/index.js +++ b/dev/examples/zapier/index.js @@ -2,12 +2,18 @@ const triggerAction = require('./triggers/action'); const triggerOrder = require('./triggers/order'); const triggerThirdparty = require('./triggers/thirdparty'); +const triggerContact = require('./triggers/contact'); const triggerTicket = require('./triggers/ticket'); const triggerUser = require('./triggers/user'); +const triggerMember = require('./triggers/member'); const searchThirdparty = require('./searches/thirdparty'); +const searchContact = require('./searches/contact'); +const searchMember = require('./searches/member'); const createThirdparty = require('./creates/thirdparty'); +const createContact = require('./creates/contact'); +const createMember = require('./creates/member'); const { config: authentication, @@ -62,18 +68,24 @@ const App = { [triggerAction.key]: triggerAction, [triggerOrder.key]: triggerOrder, [triggerThirdparty.key]: triggerThirdparty, + [triggerContact.key]: triggerContact, [triggerTicket.key]: triggerTicket, [triggerUser.key]: triggerUser, + [triggerMember.key]: triggerMember, }, // If you want your searches to show up, you better include it here! searches: { [searchThirdparty.key]: searchThirdparty, + [searchContact.key]: searchContact, + [searchMember.key]: searchMember, }, // If you want your creates to show up, you better include it here! creates: { [createThirdparty.key]: createThirdparty, + [createContact.key]: createContact, + [createMember.key]: createMember, } }; diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index cc0768a27ef..a9d519dec69 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -1,6 +1,6 @@ { "name": "dolibarr", - "version": "1.13.0", + "version": "1.14.0", "description": "An app for connecting Dolibarr to the Zapier platform.", "repository": "Dolibarr/dolibarr", "homepage": "https://www.dolibarr.org/", @@ -11,11 +11,11 @@ "test": "mocha --recursive" }, "engines": { - "node": "8.10.0", + "node": "14.0.0", "npm": ">=5.6.0" }, "dependencies": { - "zapier-platform-core": "11.0.0" + "zapier-platform-core": "11.0.1" }, "devDependencies": { "mocha": "^5.2.0", diff --git a/dev/examples/zapier/searches/contact.js b/dev/examples/zapier/searches/contact.js new file mode 100644 index 00000000000..b52b8d3e367 --- /dev/null +++ b/dev/examples/zapier/searches/contact.js @@ -0,0 +1,95 @@ +module.exports = { + key: 'contact', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Contact', + display: { + label: 'Find a Contact', + description: 'Search for contact.' + }, + + // `operation` is where we make the call to your API to do the search + operation: { + // This search only has one search field. Your searches might have just one, or many + // search fields. + inputFields: [ + { + key: 'lastname', + type: 'string', + label: 'Lastname', + helpText: 'Lastname to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' + } + ], + + perform: async (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/contacts/'; + + // Put the search value in a query param. The details of how to build + // a search URL will depend on how your API works. + let filter = ''; + if (bundle.inputData.lastname) { + filter = "t.lastname like \'%"+bundle.inputData.name+"%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.lastname) { + filter += " and "; + } + filter += "t.email like \'"+bundle.inputData.email+"\'"; + } + const response = await z.request({ + url: url, + // this parameter avoid throwing errors and let us manage them + skipThrowForStatus: true, + params: { + sqlfilters: filter + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; + }, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + firstname: 'John', + authorId: 1, + directions: '1. Boil Noodles\n2.Serve with sauce', + style: 'italian' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + { + key: 'id', + type: "integer", + label: 'ID' + }, + {key: 'createdAt', type: "integer", label: 'Created At'}, + {key: 'name', label: 'Name'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'directions', label: 'Directions'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + { + key: 'style', + label: 'Style' + } + ] + } +}; diff --git a/dev/examples/zapier/searches/member.js b/dev/examples/zapier/searches/member.js new file mode 100644 index 00000000000..f1a84061146 --- /dev/null +++ b/dev/examples/zapier/searches/member.js @@ -0,0 +1,88 @@ +module.exports = { + key: 'member', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Member', + display: { + label: 'Find a Member', + description: 'Search for member.' + }, + + // `operation` is where we make the call to your API to do the search + operation: { + // This search only has one search field. Your searches might have just one, or many + // search fields. + inputFields: [ + { + key: 'lastname', + type: 'string', + label: 'Lastname', + helpText: 'Lastname to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' + } + ], + + perform: async (z, bundle) => { + const url = bundle.authData.url + '/api/index.php/members/'; + + // Put the search value in a query param. The details of how to build + // a search URL will depend on how your API works. + let filter = ''; + if (bundle.inputData.lastname) { + filter = "t.lastname like \'%" + bundle.inputData.name + "%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.lastname) { + filter += " and "; + } + filter += "t.email like \'" + bundle.inputData.email + "\'"; + } + const response = await z.request({ + url: url, + // this parameter avoid throwing errors and let us manage them + skipThrowForStatus: true, + params: { + sqlfilters: filter + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; + }, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + name: 'DOE', + firstname: 'John', + authorId: 1, + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + { + key: 'id', + type: "integer", + label: 'ID' + }, + { key: 'createdAt', type: "integer", label: 'Created At' }, + { key: 'name', label: 'Name' }, + { key: 'firstname', label: 'Firstname' }, + { key: 'authorId', type: "integer", label: 'Author ID' }, + ] + } +}; diff --git a/dev/examples/zapier/searches/thirdparty.js b/dev/examples/zapier/searches/thirdparty.js index 8f72b9270e5..e1e6878f5b3 100644 --- a/dev/examples/zapier/searches/thirdparty.js +++ b/dev/examples/zapier/searches/thirdparty.js @@ -19,21 +19,43 @@ module.exports = { type: 'string', label: 'Name', helpText: 'Name to limit to the search to (i.e. The company or %company%).' + }, + { + key: 'email', + type: 'string', + label: 'Email', + helpText: 'Email to limit to the search to.' } ], - perform: (z, bundle) => { + perform: async (z, bundle) => { const url = bundle.authData.url + '/api/index.php/thirdparties/'; // Put the search value in a query param. The details of how to build // a search URL will depend on how your API works. - const options = { - params: { - sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'" + let filter = ''; + if (bundle.inputData.name) { + filter = "t.nom like \'%"+bundle.inputData.name+"%\'"; + } + if (bundle.inputData.email) { + if (bundle.inputData.name) { + filter += " and "; } - }; - - return z.request(url, options).then(response => JSON.parse(response.content)); + filter += "t.email like \'"+bundle.inputData.email+"\'"; + } + const response = await z.request({ + url: url, + // this parameter avoid throwing errors and let us manage them + skipThrowForStatus: true, + params: { + sqlfilters: filter + } + }); + //z.console.log(response); + if (response.status != 200) { + return []; + } + return response.json; }, // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example diff --git a/dev/examples/zapier/triggers/contact.js b/dev/examples/zapier/triggers/contact.js new file mode 100644 index 00000000000..2ba3bd226f8 --- /dev/null +++ b/dev/examples/zapier/triggers/contact.js @@ -0,0 +1,171 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'contact', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: data, + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getContact = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const contact = { + id: bundle.cleanedRequest.id, + name: bundle.cleanedRequest.name, + name_alias: bundle.cleanedRequest.name_alias, + firstname: bundle.cleanedRequest.firstname, + address: bundle.cleanedRequest.address, + zip: bundle.cleanedRequest.zip, + town: bundle.cleanedRequest.town, + email: bundle.cleanedRequest.email, + phone_pro: bundle.cleanedRequest.phone_pro, + phone_perso: bundle.cleanedRequest.phone_perso, + phone_mobile: bundle.cleanedRequest.phone_mobile, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + action: bundle.cleanedRequest.action + }; + + return [contact]; +}; + +const getFallbackRealContact = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/contacts/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getModulesChoices = (z/*, bundle*/) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; +// const getModulesChoices = () => { +// return { +// orders: "Order", +// invoices: "Invoice", +// contacts: "Contact", +// contacts: "Contacts" +// }; +// }; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your triggers separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'contact', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Contact', + display: { + label: 'New Contact', + description: 'Triggers when a new contact action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + required: true, + type: 'string', + helpText: 'Which action of contact this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getContact, + performList: getFallbackRealContact, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + lastname: 'DOE', + firstname: 'John', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'lastname', label: 'Lastname'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'phone', label: 'Phone pro'}, + {key: 'phone_perso', label: 'Phone perso'}, + {key: 'phone_mobile', label: 'Phone mobile'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + {key: 'action', label: 'Action'} + ] + } +}; diff --git a/dev/examples/zapier/triggers/member.js b/dev/examples/zapier/triggers/member.js new file mode 100644 index 00000000000..3385cdca625 --- /dev/null +++ b/dev/examples/zapier/triggers/member.js @@ -0,0 +1,171 @@ +const subscribeHook = (z, bundle) => { + // `z.console.log()` is similar to `console.log()`. + z.console.log('suscribing hook!'); + + // bundle.targetUrl has the Hook URL this app should call when an action is created. + const data = { + url: bundle.targetUrl, + event: bundle.event, + module: 'member', + action: bundle.inputData.action + }; + + const url = bundle.authData.url + '/api/index.php/zapierapi/hook'; + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: url, + method: 'POST', + body: data, + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const unsubscribeHook = (z, bundle) => { + // bundle.subscribeData contains the parsed response JSON from the subscribe + // request made initially. + z.console.log('unsuscribing hook!'); + + // You can build requests and our client will helpfully inject all the variables + // you need to complete. You can also register middleware to control this. + const options = { + url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id, + method: 'DELETE', + }; + + // You may return a promise or a normal data structure from any perform method. + return z.request(options).then((response) => JSON.parse(response.content)); +}; + +const getMember = (z, bundle) => { + // bundle.cleanedRequest will include the parsed JSON object (if it's not a + // test poll) and also a .querystring property with the URL's query string. + const member = { + id: bundle.cleanedRequest.id, + name: bundle.cleanedRequest.name, + name_alias: bundle.cleanedRequest.name_alias, + firstname: bundle.cleanedRequest.firstname, + address: bundle.cleanedRequest.address, + zip: bundle.cleanedRequest.zip, + town: bundle.cleanedRequest.town, + email: bundle.cleanedRequest.email, + phone_pro: bundle.cleanedRequest.phone_pro, + phone_perso: bundle.cleanedRequest.phone_perso, + phone_mobile: bundle.cleanedRequest.phone_mobile, + authorId: bundle.cleanedRequest.authorId, + createdAt: bundle.cleanedRequest.createdAt, + action: bundle.cleanedRequest.action + }; + + return [member]; +}; + +const getFallbackRealMember = (z, bundle) => { + // For the test poll, you should get some real data, to aid the setup process. + const module = bundle.inputData.module; + const options = { + url: bundle.authData.url + '/api/index.php/members/0', + }; + + return z.request(options).then((response) => [JSON.parse(response.content)]); +}; + +// const getModulesChoices = (z/*, bundle*/) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const options = { +// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices', +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; +// const getModulesChoices = () => { +// return { +// orders: "Order", +// invoices: "Invoice", +// members: "Member", +// members: "Members" +// }; +// }; + +// const getActionsChoices = (z, bundle) => { +// // For the test poll, you should get some real data, to aid the setup process. +// const module = bundle.inputData.module; +// const options = { +// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`, +// }; + +// return z.request(options).then((response) => JSON.parse(response.content)); +// }; + +// We recommend writing your triggers separate like this and rolling them +// into the App definition at the end. +module.exports = { + key: 'member', + + // You'll want to provide some helpful display labels and descriptions + // for users. Zapier will put them into the UX. + noun: 'Member', + display: { + label: 'New Member', + description: 'Triggers when a new member action is done in Dolibarr.' + }, + + // `operation` is where the business logic goes. + operation: { + + // `inputFields` can define the fields a user could provide, + // we'll pass them in as `bundle.inputData` later. + inputFields: [ + { + key: 'action', + required: true, + type: 'string', + helpText: 'Which action of member this should trigger on.', + choices: { + create: "Create", + modify: "Modify", + validate: "Validate", + } + } + ], + + type: 'hook', + + performSubscribe: subscribeHook, + performUnsubscribe: unsubscribeHook, + + perform: getMember, + performList: getFallbackRealMember, + + // In cases where Zapier needs to show an example record to the user, but we are unable to get a live example + // from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of + // returned records, and have obviously dummy values that we can show to any user. + sample: { + id: 1, + createdAt: 1472069465, + lastname: 'DOE', + firstname: 'John', + authorId: 1, + action: 'create' + }, + + // If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom + // field definitions. The result will be used to augment the sample. + // outputFields: () => { return []; } + // Alternatively, a static field definition should be provided, to specify labels for the fields + outputFields: [ + {key: 'id', type: "integer", label: 'ID'}, + {key: 'createdAt', label: 'Created At'}, + {key: 'lastname', label: 'Lastname'}, + {key: 'firstname', label: 'Firstname'}, + {key: 'phone', label: 'Phone pro'}, + {key: 'phone_perso', label: 'Phone perso'}, + {key: 'phone_mobile', label: 'Phone mobile'}, + {key: 'authorId', type: "integer", label: 'Author ID'}, + {key: 'action', label: 'Action'} + ] + } +}; diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 4656f836e74..76194acbc9a 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => { fournisseur: bundle.cleanedRequest.fournisseur, code_client: bundle.cleanedRequest.code_client, code_fournisseur: bundle.cleanedRequest.code_fournisseur, + idprof1: bundle.cleanedRequest.idprof1, + idprof2: bundle.cleanedRequest.idprof2, + idprof3: bundle.cleanedRequest.idprof3, + idprof4: bundle.cleanedRequest.idprof4, + idprof5: bundle.cleanedRequest.idprof5, + idprof6: bundle.cleanedRequest.idprof6, authorId: bundle.cleanedRequest.authorId, createdAt: bundle.cleanedRequest.createdAt, action: bundle.cleanedRequest.action @@ -112,7 +118,7 @@ module.exports = { noun: 'Thirdparty', display: { label: 'New Thirdparty', - description: 'Triggers when a new thirdpaty action is done in Dolibarr.' + description: 'Triggers when a new thirdparty action is done in Dolibarr.' }, // `operation` is where the business logic goes. @@ -170,7 +176,13 @@ module.exports = { {key: 'client', label: 'Customer/Prospect 0/1/2/3'}, {key: 'fournisseur', label: 'Supplier 0/1'}, {key: 'code_client', label: 'Customer code'}, - {key: 'code_fournisseur', label: 'Supplier code'} + {key: 'code_fournisseur', label: 'Supplier code'}, + {key: 'idprof1', label: 'Id Prof 1'}, + {key: 'idprof2', label: 'Id Prof 2'}, + {key: 'idprof3', label: 'Id Prof 3'}, + {key: 'idprof4', label: 'Id Prof 4'}, + {key: 'idprof5', label: 'Id Prof 5'}, + {key: 'idprof6', label: 'Id Prof 6'} ] } }; diff --git a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql index 60a951dc679..4061fb9f4cf 100644 --- a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.17 Distrib 10.3.25-MariaDB, for debian-linux-gnu (x86_64) +-- MySQL dump 10.19 Distrib 10.3.29-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: dolibarr_14 -- ------------------------------------------------------ --- Server version 10.3.25-MariaDB-0ubuntu0.20.04.1 +-- Server version 10.3.29-MariaDB-0ubuntu0.20.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -102,7 +102,12 @@ CREATE TABLE `llx_accounting_bookkeeping` ( `date_lim_reglement` datetime DEFAULT NULL, `fk_user` int(11) DEFAULT NULL, PRIMARY KEY (`rowid`), - KEY `idx_accounting_bookkeeping_fk_doc` (`fk_doc`) + KEY `idx_accounting_bookkeeping_fk_doc` (`fk_doc`), + KEY `idx_accounting_bookkeeping_fk_docdet` (`fk_docdet`), + KEY `idx_accounting_bookkeeping_doc_date` (`doc_date`), + KEY `idx_accounting_bookkeeping_numero_compte` (`numero_compte`,`entity`), + KEY `idx_accounting_bookkeeping_code_journal` (`code_journal`,`entity`), + KEY `idx_accounting_bookkeeping_piece_num` (`piece_num`,`entity`) ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -273,7 +278,7 @@ CREATE TABLE `llx_accounting_system` ( `fk_country` int(11) DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_accounting_system_pcg_version` (`pcg_version`) -) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -282,7 +287,7 @@ CREATE TABLE `llx_accounting_system` ( LOCK TABLES `llx_accounting_system` WRITE; /*!40000 ALTER TABLE `llx_accounting_system` DISABLE KEYS */; -INSERT INTO `llx_accounting_system` VALUES (1,'PCG99-ABREGE','The simple accountancy french plan',1,1),(2,'PCG99-BASE','The base accountancy french plan',1,1),(3,'PCMN-BASE','The base accountancy belgium plan',1,2),(4,'PCG08-PYME','The PYME accountancy spanish plan',1,4),(5,'PC-MIPYME','The PYME accountancy Chile plan',1,67),(6,'ENG-BASE','England plan',1,7),(7,'SYSCOHADA','Plan comptable Ouest-Africain',0,NULL),(39,'PCG14-DEV','The developed accountancy french plan 2014',1,1),(40,'PCG_SUISSE','Switzerland plan',1,6),(41,'PCN-LUXEMBURG','Plan comptable normalisé Luxembourgeois',1,140),(42,'DK-STD','Standardkontoplan fra SKAT',1,80),(43,'PCT','The Tunisia plan',1,10),(44,'PCG','The Moroccan chart of accounts',1,12),(47,'SYSCOHADA-BJ','Plan comptable Ouest-Africain',1,49),(48,'SYSCOHADA-BF','Plan comptable Ouest-Africain',1,60),(49,'SYSCOHADA-CM','Plan comptable Ouest-Africain',1,24),(50,'SYSCOHADA-CF','Plan comptable Ouest-Africain',1,65),(51,'SYSCOHADA-KM','Plan comptable Ouest-Africain',1,71),(52,'SYSCOHADA-CG','Plan comptable Ouest-Africain',1,72),(53,'SYSCOHADA-CI','Plan comptable Ouest-Africain',1,21),(54,'SYSCOHADA-GA','Plan comptable Ouest-Africain',1,16),(55,'SYSCOHADA-GQ','Plan comptable Ouest-Africain',1,87),(56,'SYSCOHADA-ML','Plan comptable Ouest-Africain',1,147),(57,'SYSCOHADA-NE','Plan comptable Ouest-Africain',1,168),(58,'SYSCOHADA-CD','Plan comptable Ouest-Africain',1,73),(59,'SYSCOHADA-SN','Plan comptable Ouest-Africain',1,22),(60,'SYSCOHADA-TD','Plan comptable Ouest-Africain',1,66),(61,'SYSCOHADA-TG','Plan comptable Ouest-Africain',1,15),(62,'RO-BASE','Plan de conturi romanesc',1,188),(63,'SKR03','Standardkontenrahmen SKR 03',1,5),(64,'SKR04','Standardkontenrahmen SKR 04',1,5),(65,'BAS-K1-MINI','The Swedish mini chart of accounts',1,20),(67,'PCG18-ASSOC','French foundation chart of accounts 2018',1,1),(68,'PCGAFR14-DEV','The developed farm accountancy french plan 2014',1,1),(69,'AT-BASE','Plan Austria',1,41); +INSERT INTO `llx_accounting_system` VALUES (1,'PCG99-ABREGE','The simple accountancy french plan',1,1),(2,'PCG99-BASE','The base accountancy french plan',1,1),(3,'PCMN-BASE','The base accountancy belgium plan',1,2),(4,'PCG08-PYME','The PYME accountancy spanish plan',1,4),(5,'PC-MIPYME','The PYME accountancy Chile plan',1,67),(6,'ENG-BASE','England plan',1,7),(7,'SYSCOHADA','Plan comptable Ouest-Africain',0,NULL),(39,'PCG14-DEV','The developed accountancy french plan 2014',1,1),(40,'PCG_SUISSE','Switzerland plan',1,6),(41,'PCN-LUXEMBURG','Plan comptable normalisé Luxembourgeois',1,140),(42,'DK-STD','Standardkontoplan fra SKAT',1,80),(43,'PCT','The Tunisia plan',1,10),(44,'PCG','The Moroccan chart of accounts',1,12),(47,'SYSCOHADA-BJ','Plan comptable Ouest-Africain',1,49),(48,'SYSCOHADA-BF','Plan comptable Ouest-Africain',1,60),(49,'SYSCOHADA-CM','Plan comptable Ouest-Africain',1,24),(50,'SYSCOHADA-CF','Plan comptable Ouest-Africain',1,65),(51,'SYSCOHADA-KM','Plan comptable Ouest-Africain',1,71),(52,'SYSCOHADA-CG','Plan comptable Ouest-Africain',1,72),(53,'SYSCOHADA-CI','Plan comptable Ouest-Africain',1,21),(54,'SYSCOHADA-GA','Plan comptable Ouest-Africain',1,16),(55,'SYSCOHADA-GQ','Plan comptable Ouest-Africain',1,87),(56,'SYSCOHADA-ML','Plan comptable Ouest-Africain',1,147),(57,'SYSCOHADA-NE','Plan comptable Ouest-Africain',1,168),(58,'SYSCOHADA-CD','Plan comptable Ouest-Africain',1,73),(59,'SYSCOHADA-SN','Plan comptable Ouest-Africain',1,22),(60,'SYSCOHADA-TD','Plan comptable Ouest-Africain',1,66),(61,'SYSCOHADA-TG','Plan comptable Ouest-Africain',1,15),(62,'RO-BASE','Plan de conturi romanesc',1,188),(63,'SKR03','Standardkontenrahmen SKR 03',1,5),(64,'SKR04','Standardkontenrahmen SKR 04',1,5),(65,'BAS-K1-MINI','The Swedish mini chart of accounts',1,20),(67,'PCG18-ASSOC','French foundation chart of accounts 2018',1,1),(68,'PCGAFR14-DEV','The developed farm accountancy french plan 2014',1,1),(69,'AT-BASE','Plan Austria',1,41),(70,'US-BASE','USA basic chart of accounts',1,11),(71,'CA-ENG-BASE','Canadian basic chart of accounts - English',1,14),(72,'SAT/24-2019','Catalogo y codigo agrupador fiscal del 2019',1,154); /*!40000 ALTER TABLE `llx_accounting_system` ENABLE KEYS */; UNLOCK TABLES; @@ -489,6 +494,7 @@ CREATE TABLE `llx_adherent` ( `state_id` int(11) DEFAULT NULL, `country` int(11) DEFAULT NULL, `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `socialnetworks` text COLLATE utf8_unicode_ci DEFAULT NULL, `skype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `phone` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, @@ -535,7 +541,7 @@ CREATE TABLE `llx_adherent` ( LOCK TABLES `llx_adherent` WRITE; /*!40000 ALTER TABLE `llx_adherent` DISABLE KEYS */; -INSERT INTO `llx_adherent` VALUES (1,'1',1,NULL,NULL,'Smith','Vick','vsmith','vsx1n8tf',NULL,2,'phy',NULL,10,NULL,NULL,NULL,NULL,102,'vsmith@email.com','[]',NULL,NULL,NULL,NULL,'1960-07-07','person5.jpeg',0,0,'2014-07-09 00:00:00',NULL,NULL,'2012-07-10 15:12:56','2012-07-08 23:50:00','2021-04-15 10:22:54',1,12,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'woman'),(2,'2',1,NULL,NULL,'Curie','Pierre','pcurie','pcuriedolibarr',NULL,2,'phy',NULL,12,NULL,NULL,NULL,NULL,NULL,'pcurie@example.com','[]',NULL,NULL,NULL,NULL,NULL,'pierrecurie.jpg',1,1,'2020-07-17 00:00:00',NULL,NULL,'2012-07-10 15:03:32','2012-07-10 15:03:09','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'3',1,NULL,NULL,'john','doe','john','8bs6gty5',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,1,'johndoe@email.com','[]',NULL,NULL,NULL,NULL,NULL,'person9.jpeg',1,0,'2014-07-17 00:00:00',NULL,NULL,'2013-07-18 21:28:00','2013-07-18 21:10:09','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'4',1,NULL,NULL,'smith','smith','Smith','s6hjp10f',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,11,'smith@email.com','[]',NULL,NULL,NULL,NULL,NULL,'person2.jpeg',1,0,'2018-07-17 00:00:00',NULL,NULL,'2013-07-18 21:27:52','2013-07-18 21:27:44','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO `llx_adherent` VALUES (1,'1',1,NULL,NULL,'Smith','Vick','vsmith','vsx1n8tf',NULL,2,'phy',NULL,10,NULL,NULL,NULL,NULL,102,'vsmith@email.com',NULL,'[]',NULL,NULL,NULL,NULL,'1960-07-07','person5.jpeg',0,0,'2014-07-09 00:00:00',NULL,NULL,'2012-07-10 15:12:56','2012-07-08 23:50:00','2021-04-15 10:22:54',1,12,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'woman'),(2,'2',1,NULL,NULL,'Curie','Pierre','pcurie','pcuriedolibarr',NULL,2,'phy',NULL,12,NULL,NULL,NULL,NULL,NULL,'pcurie@example.com',NULL,'[]',NULL,NULL,NULL,NULL,NULL,'pierrecurie.jpg',1,1,'2020-07-17 00:00:00',NULL,NULL,'2012-07-10 15:03:32','2012-07-10 15:03:09','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'3',1,NULL,NULL,'john','doe','john','8bs6gty5',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,1,'johndoe@email.com',NULL,'[]',NULL,NULL,NULL,NULL,NULL,'person9.jpeg',1,0,'2014-07-17 00:00:00',NULL,NULL,'2013-07-18 21:28:00','2013-07-18 21:10:09','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'4',1,NULL,NULL,'smith','smith','Smith','s6hjp10f',NULL,2,'phy',NULL,NULL,NULL,NULL,NULL,NULL,11,'smith@email.com',NULL,'[]',NULL,NULL,NULL,NULL,NULL,'person2.jpeg',1,0,'2018-07-17 00:00:00',NULL,NULL,'2013-07-18 21:27:52','2013-07-18 21:27:44','2021-04-15 10:22:54',1,12,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_adherent` ENABLE KEYS */; UNLOCK TABLES; @@ -584,6 +590,7 @@ CREATE TABLE `llx_adherent_type` ( `statut` smallint(6) NOT NULL DEFAULT 0, `libelle` varchar(50) COLLATE utf8_unicode_ci NOT NULL, `subscription` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `amount` double(24,8) DEFAULT NULL, `vote` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', `note` text COLLATE utf8_unicode_ci DEFAULT NULL, `mail_valid` text COLLATE utf8_unicode_ci DEFAULT NULL, @@ -600,7 +607,7 @@ CREATE TABLE `llx_adherent_type` ( LOCK TABLES `llx_adherent_type` WRITE; /*!40000 ALTER TABLE `llx_adherent_type` DISABLE KEYS */; -INSERT INTO `llx_adherent_type` VALUES (1,1,'2020-06-12 17:20:50',1,'Board members','1','1','','','','1y'),(2,1,'2020-06-12 17:21:21',1,'Standard members','1','1','','','','y'); +INSERT INTO `llx_adherent_type` VALUES (1,1,'2020-06-12 17:20:50',1,'Board members','1',NULL,'1','','','','1y'),(2,1,'2020-06-12 17:21:21',1,'Standard members','1',NULL,'1','','','','y'); /*!40000 ALTER TABLE `llx_adherent_type` ENABLE KEYS */; UNLOCK TABLES; @@ -865,7 +872,7 @@ CREATE TABLE `llx_bank` ( LOCK TABLES `llx_bank` WRITE; /*!40000 ALTER TABLE `llx_bank` DISABLE KEYS */; -INSERT INTO `llx_bank` VALUES (1,'2012-07-08 23:56:14','2020-12-10 12:24:23','2020-07-08','2020-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2012-07-09 00:00:24','2020-12-10 12:24:23','2020-07-09','2020-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2012-07-10 13:33:42','2020-12-10 12:24:23','2020-07-10','2020-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'2013-07-18 20:50:24','2020-12-10 12:24:23','2020-07-08','2020-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'2013-07-18 20:50:47','2020-12-10 12:24:23','2020-07-08','2020-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'2013-08-01 03:34:11','2020-12-10 12:24:23','2020-08-15','2020-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2013-08-05 23:11:37','2020-12-10 12:24:23','2020-08-12','2020-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'2013-08-06 20:33:54','2020-12-10 12:24:23','2020-08-06','2020-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,'2013-08-08 02:53:40','2020-12-10 12:24:23','2020-08-08','2020-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,'2013-08-08 02:55:58','2020-12-10 12:24:23','2020-08-08','2020-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'2014-12-09 15:28:44','2020-12-10 12:24:23','2020-12-09','2020-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'2014-12-09 15:28:53','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,'2014-12-09 17:35:55','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,'2014-12-09 17:37:02','2020-12-10 12:24:23','2020-12-09','2020-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,'2014-12-09 18:35:07','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,'2014-12-12 18:54:33','2021-04-15 10:22:31','2020-12-12','2020-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,'2015-03-06 16:48:16','2021-04-15 10:22:31','2021-03-06','2021-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'2015-03-20 14:30:11','2021-04-15 10:22:31','2021-03-20','2021-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,'2016-03-02 19:57:58','2020-12-10 12:24:23','2020-07-09','2020-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL,NULL,NULL,NULL,NULL),(26,'2016-03-02 20:01:39','2021-04-15 10:22:31','2021-03-19','2021-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'2016-03-02 20:02:06','2021-04-15 10:22:31','2021-03-21','2021-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL,NULL,NULL,NULL,NULL),(28,'2016-03-03 19:22:32','2020-12-10 12:24:23','2020-10-03','2020-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'2016-03-03 19:23:16','2021-04-15 10:22:31','2021-03-10','2021-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,'2018-01-22 18:56:34','2021-04-15 10:22:31','2021-01-22','2021-01-22',-900.00000000,'(SupplierInvoicePayment)',1,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,'2018-07-30 22:42:14','2020-12-10 12:24:23','2020-07-30','2020-07-30',0.00000000,'(Initial balance)',4,0,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(32,'2017-02-01 19:02:44','2021-04-15 10:22:31','2021-02-01','2021-02-01',-200.00000000,'(SupplierInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(33,'2017-02-06 08:10:24','2021-04-15 10:22:31','2021-03-22','2021-03-22',150.00000000,'(CustomerInvoicePayment)',1,12,NULL,'CHQ',NULL,NULL,0,NULL,2,NULL,'Magic Food Store',NULL,NULL,NULL,NULL,NULL),(34,'2017-02-06 08:10:50','2021-04-15 10:22:31','2021-03-25','2021-03-25',140.00000000,'(CustomerInvoicePayment)',1,12,NULL,'PRE',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(36,'2017-02-16 02:22:09','2021-04-15 10:22:31','2021-02-16','2021-02-16',-1.00000000,'(ExpenseReportPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(37,'2017-02-21 16:07:43','2021-04-15 10:22:31','2021-02-21','2021-02-21',50.00000000,'(WithdrawalPayment)',1,12,NULL,'PRE',NULL,'T170201',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,'2017-09-06 20:08:36','2020-12-10 12:24:23','2020-09-06','2020-09-06',10.00000000,'(DonationPayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(39,'2018-03-16 13:59:31','2021-04-15 10:22:31','2021-03-16','2021-03-16',10.00000000,'(CustomerInvoicePayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Indian SAS',NULL,'',NULL,NULL,NULL),(41,'2019-10-04 10:28:14','2021-04-15 10:22:31','2021-01-19','2021-01-19',5.63000000,'(CustomerInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(42,'2019-10-08 13:18:50','2020-12-10 12:24:23','2020-10-08','2020-10-08',-1000.00000000,'Salary payment',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(43,'2019-12-26 01:48:30','2021-04-15 10:22:31','2020-12-25','2020-12-25',-5.00000000,'(SocialContributionPayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(44,'2019-12-26 01:48:46','2021-04-15 10:22:31','2020-12-25','2020-12-25',-5.00000000,'(SocialContributionPayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(47,'2020-01-01 20:28:49','2021-04-15 10:22:31','2021-01-01','2021-01-01',304.69000000,'(SupplierInvoicePayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(48,'2020-01-06 20:52:28','2021-04-15 10:22:31','2021-01-06','2021-01-06',10.00000000,'Patient payment',1,12,NULL,'CB',NULL,NULL,0,NULL,0,NULL,'Patient',NULL,'',NULL,NULL,NULL),(49,'2020-01-10 04:42:47','2021-04-15 10:22:31','2021-01-10','2021-01-10',-10.00000000,'Miscellaneous payment',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(50,'2020-01-16 02:36:48','2021-04-15 10:22:31','2021-01-16','2021-01-16',20.50000000,'(CustomerInvoicePayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'Magic Food Store',NULL,'',NULL,NULL,NULL),(51,'2020-01-21 01:02:14','2020-12-10 12:24:23','2020-07-18','2020-07-18',50.00000000,'Subscription 2013',4,12,NULL,'CB',NULL,'12345',0,NULL,0,'Bank CBN',NULL,NULL,'',NULL,NULL,NULL),(52,'2020-01-21 10:22:37','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'Subscription 2017',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'smith smith',NULL,'',NULL,NULL,NULL),(53,'2020-01-21 10:23:17','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Pierre Curie',NULL,'',NULL,NULL,NULL),(54,'2020-01-21 10:23:28','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Pierre Curie',NULL,'',NULL,NULL,NULL),(55,'2020-01-21 10:23:49','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CB',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL); +INSERT INTO `llx_bank` VALUES (1,'2012-07-08 23:56:14','2021-07-11 17:49:28','2021-07-08','2021-07-08',2000.00000000,'(Initial balance)',1,NULL,1,'SOLD','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2012-07-09 00:00:24','2021-07-11 17:49:28','2021-07-09','2021-07-09',500.00000000,'(Initial balance)',2,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2012-07-10 13:33:42','2021-07-11 17:49:28','2021-07-10','2021-07-10',0.00000000,'(Solde initial)',3,NULL,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'2013-07-18 20:50:24','2021-07-11 17:49:28','2021-07-08','2021-07-08',20.00000000,'(CustomerInvoicePayment)',1,1,NULL,'CB','201107',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(6,'2013-07-18 20:50:47','2021-07-11 17:49:28','2021-07-08','2021-07-08',10.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(8,'2013-08-01 03:34:11','2020-12-10 12:24:23','2020-08-15','2020-08-01',5.63000000,'(CustomerInvoicePayment)',1,1,1,'CB','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2013-08-05 23:11:37','2020-12-10 12:24:23','2020-08-12','2020-08-05',-10.00000000,'(SocialContributionPayment)',1,1,1,'VIR','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'2013-08-06 20:33:54','2020-12-10 12:24:23','2020-08-06','2020-08-06',5.98000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(14,'2013-08-08 02:53:40','2020-12-10 12:24:23','2020-08-08','2020-08-08',26.10000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(15,'2013-08-08 02:55:58','2020-12-10 12:24:23','2020-08-08','2020-08-08',26.96000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201211',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(16,'2014-12-09 15:28:44','2020-12-10 12:24:23','2020-12-09','2020-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(17,'2014-12-09 15:28:53','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(18,'2014-12-09 17:35:55','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(19,'2014-12-09 17:37:02','2020-12-10 12:24:23','2020-12-09','2020-12-09',2.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(20,'2014-12-09 18:35:07','2020-12-10 12:24:23','2020-12-09','2020-12-09',-2.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(21,'2014-12-12 18:54:33','2021-04-15 10:22:31','2020-12-12','2020-12-12',1.00000000,'(CustomerInvoicePayment)',1,1,1,'TIP','201210',NULL,1,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(22,'2015-03-06 16:48:16','2021-04-15 10:22:31','2021-03-06','2021-03-06',20.00000000,'(SubscriptionPayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'2015-03-20 14:30:11','2021-04-15 10:22:31','2021-03-20','2021-03-20',10.00000000,'(SubscriptionPayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,'2016-03-02 19:57:58','2021-07-11 17:49:28','2021-07-09','2021-07-09',605.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'111',NULL,NULL,NULL,NULL,NULL),(26,'2016-03-02 20:01:39','2021-04-15 10:22:31','2021-03-19','2021-03-19',500.00000000,'(CustomerInvoicePayment)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'2016-03-02 20:02:06','2021-04-15 10:22:31','2021-03-21','2021-03-21',400.00000000,'(CustomerInvoicePayment)',1,1,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'ABC and Co',NULL,NULL,NULL,NULL,NULL),(28,'2016-03-03 19:22:32','2020-12-10 12:24:23','2020-10-03','2020-10-03',-400.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'2016-03-03 19:23:16','2021-04-15 10:22:31','2021-03-10','2021-03-10',-300.00000000,'(CustomerInvoicePaymentBack)',3,1,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,'2018-01-22 18:56:34','2021-04-15 10:22:31','2021-01-22','2021-01-22',-900.00000000,'(SupplierInvoicePayment)',1,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,'2018-07-30 22:42:14','2020-12-10 12:24:23','2020-07-30','2020-07-30',0.00000000,'(Initial balance)',4,0,NULL,'SOLD',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(32,'2017-02-01 19:02:44','2021-04-15 10:22:31','2021-02-01','2021-02-01',-200.00000000,'(SupplierInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(33,'2017-02-06 08:10:24','2021-04-15 10:22:31','2021-03-22','2021-03-22',150.00000000,'(CustomerInvoicePayment)',1,12,NULL,'CHQ',NULL,NULL,0,NULL,2,NULL,'Magic Food Store',NULL,NULL,NULL,NULL,NULL),(34,'2017-02-06 08:10:50','2021-04-15 10:22:31','2021-03-25','2021-03-25',140.00000000,'(CustomerInvoicePayment)',1,12,NULL,'PRE',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(36,'2017-02-16 02:22:09','2021-04-15 10:22:31','2021-02-16','2021-02-16',-1.00000000,'(ExpenseReportPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(37,'2017-02-21 16:07:43','2021-04-15 10:22:31','2021-02-21','2021-02-21',50.00000000,'(WithdrawalPayment)',1,12,NULL,'PRE',NULL,'T170201',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(38,'2017-09-06 20:08:36','2020-12-10 12:24:23','2020-09-06','2020-09-06',10.00000000,'(DonationPayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(39,'2018-03-16 13:59:31','2021-04-15 10:22:31','2021-03-16','2021-03-16',10.00000000,'(CustomerInvoicePayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Indian SAS',NULL,'',NULL,NULL,NULL),(41,'2019-10-04 10:28:14','2021-04-15 10:22:31','2021-01-19','2021-01-19',5.63000000,'(CustomerInvoicePayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(42,'2019-10-08 13:18:50','2020-12-10 12:24:23','2020-10-08','2020-10-08',-1000.00000000,'Salary payment',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(43,'2019-12-26 01:48:30','2021-04-15 10:22:31','2020-12-25','2020-12-25',-5.00000000,'(SocialContributionPayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(44,'2019-12-26 01:48:46','2021-04-15 10:22:31','2020-12-25','2020-12-25',-5.00000000,'(SocialContributionPayment)',3,12,NULL,'LIQ',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(47,'2020-01-01 20:28:49','2021-04-15 10:22:31','2021-01-01','2021-01-01',304.69000000,'(SupplierInvoicePayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(48,'2020-01-06 20:52:28','2021-04-15 10:22:31','2021-01-06','2021-01-06',10.00000000,'Patient payment',1,12,NULL,'CB',NULL,NULL,0,NULL,0,NULL,'Patient',NULL,'',NULL,NULL,NULL),(49,'2020-01-10 04:42:47','2021-04-15 10:22:31','2021-01-10','2021-01-10',-10.00000000,'Miscellaneous payment',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL),(50,'2020-01-16 02:36:48','2021-04-15 10:22:31','2021-01-16','2021-01-16',20.50000000,'(CustomerInvoicePayment)',4,12,NULL,'VIR',NULL,NULL,0,NULL,0,NULL,'Magic Food Store',NULL,'',NULL,NULL,NULL),(51,'2020-01-21 01:02:14','2020-12-10 12:24:23','2020-07-18','2020-07-18',50.00000000,'Subscription 2013',4,12,NULL,'CB',NULL,'12345',0,NULL,0,'Bank CBN',NULL,NULL,'',NULL,NULL,NULL),(52,'2020-01-21 10:22:37','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'Subscription 2017',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'smith smith',NULL,'',NULL,NULL,NULL),(53,'2020-01-21 10:23:17','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Pierre Curie',NULL,'',NULL,NULL,NULL),(54,'2020-01-21 10:23:28','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CHQ',NULL,NULL,0,NULL,0,NULL,'Pierre Curie',NULL,'',NULL,NULL,NULL),(55,'2020-01-21 10:23:49','2021-04-15 10:22:31','2021-01-21','2021-01-21',50.00000000,'(SubscriptionPayment)',4,12,NULL,'CB',NULL,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_bank` ENABLE KEYS */; UNLOCK TABLES; @@ -1335,7 +1342,7 @@ CREATE TABLE `llx_boxes` ( KEY `idx_boxes_boxid` (`box_id`), KEY `idx_boxes_fk_user` (`fk_user`), CONSTRAINT `fk_boxes_box_id` FOREIGN KEY (`box_id`) REFERENCES `llx_boxes_def` (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=1453 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=1456 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1344,7 +1351,7 @@ CREATE TABLE `llx_boxes` ( LOCK TABLES `llx_boxes` WRITE; /*!40000 ALTER TABLE `llx_boxes` DISABLE KEYS */; -INSERT INTO `llx_boxes` VALUES (253,2,323,0,'0',0,NULL,NULL),(304,2,324,0,'0',0,NULL,NULL),(305,2,325,0,'0',0,NULL,NULL),(306,2,326,0,'0',0,NULL,NULL),(307,2,327,0,'0',0,NULL,NULL),(308,2,328,0,'0',0,NULL,NULL),(309,2,329,0,'0',0,NULL,NULL),(310,2,330,0,'0',0,NULL,NULL),(311,2,331,0,'0',0,NULL,NULL),(312,2,332,0,'0',0,NULL,NULL),(313,2,333,0,'0',0,NULL,NULL),(314,1,347,0,'A27',0,NULL,NULL),(315,1,348,0,'B20',0,NULL,NULL),(316,1,349,0,'B10',0,NULL,NULL),(317,1,350,0,'B18',0,NULL,NULL),(344,1,374,0,'B08',0,NULL,NULL),(347,1,377,0,'B16',0,NULL,NULL),(348,1,378,0,'B06',0,NULL,NULL),(358,1,388,0,'B38',0,NULL,NULL),(359,1,389,0,'A13',0,NULL,NULL),(360,1,390,0,'B36',0,NULL,NULL),(362,1,392,0,'A35',0,NULL,NULL),(363,1,393,0,'A11',0,NULL,NULL),(366,1,396,0,'B12',0,NULL,NULL),(387,1,403,0,'B22',0,NULL,NULL),(392,1,409,0,'A15',0,NULL,NULL),(393,1,410,0,'A33',0,NULL,NULL),(394,1,411,0,'A25',0,NULL,NULL),(395,1,412,0,'B30',0,NULL,NULL),(396,1,413,0,'A23',0,NULL,NULL),(397,1,414,0,'B28',0,NULL,NULL),(398,1,415,0,'A21',0,NULL,NULL),(399,1,416,0,'B26',0,NULL,NULL),(400,1,417,0,'A19',0,NULL,NULL),(401,1,418,0,'B24',0,NULL,NULL),(501,1,419,0,'A17',0,NULL,NULL),(1019,1,392,0,'A01',2,NULL,NULL),(1021,1,412,0,'A03',2,NULL,NULL),(1022,1,347,0,'A04',2,NULL,NULL),(1023,1,393,0,'A05',2,NULL,NULL),(1025,1,389,0,'A07',2,NULL,NULL),(1026,1,416,0,'A08',2,NULL,NULL),(1027,1,396,0,'B01',2,NULL,NULL),(1028,1,377,0,'B02',2,NULL,NULL),(1031,1,419,0,'B05',2,NULL,NULL),(1036,1,424,0,'A29',0,NULL,NULL),(1037,1,425,0,'B32',0,NULL,NULL),(1038,1,426,0,'B34',0,NULL,NULL),(1150,1,430,0,'A37',0,NULL,NULL),(1151,1,431,0,'A05',0,NULL,NULL),(1152,1,429,0,'A01',1,NULL,NULL),(1153,1,429,0,'B01',2,NULL,NULL),(1154,1,429,0,'A01',11,NULL,NULL),(1156,1,429,0,'A07',0,NULL,NULL),(1183,1,433,0,'A09',0,NULL,NULL),(1184,1,434,0,'B14',0,NULL,NULL),(1235,1,404,0,'B01',1,NULL,NULL),(1236,1,404,0,'B01',2,NULL,NULL),(1237,1,404,0,'B01',11,NULL,NULL),(1239,1,404,0,'A31',0,NULL,NULL),(1407,1,412,0,'A01',12,NULL,NULL),(1408,1,378,0,'A02',12,NULL,NULL),(1409,1,404,0,'A03',12,NULL,NULL),(1410,1,377,0,'A04',12,NULL,NULL),(1411,1,392,0,'B01',12,NULL,NULL),(1412,1,429,0,'B02',12,NULL,NULL),(1414,1,414,0,'B04',12,NULL,NULL),(1415,1,413,0,'B05',12,NULL,NULL),(1416,1,426,0,'B06',12,NULL,NULL),(1418,1,445,0,'B02',0,NULL,NULL),(1419,1,458,0,'A03',0,NULL,NULL),(1420,1,459,0,'B04',0,NULL,NULL),(1421,1,460,0,'A01',0,NULL,NULL),(1426,1,450,2,'A01',0,NULL,NULL),(1427,1,451,2,'B01',0,NULL,NULL),(1428,1,452,2,'A01',0,NULL,NULL),(1429,1,453,2,'B01',0,NULL,NULL),(1430,1,454,11,'A01',0,NULL,NULL),(1431,1,455,11,'B01',0,NULL,NULL),(1432,1,456,11,'A01',0,NULL,NULL),(1433,1,457,11,'B01',0,NULL,NULL),(1434,1,461,11,'A01',0,NULL,NULL),(1435,1,462,11,'B01',0,NULL,NULL),(1436,1,448,0,'A01',1,NULL,NULL),(1437,1,448,0,'B01',2,NULL,NULL),(1438,1,448,0,'A01',11,NULL,NULL),(1439,1,448,0,'A01',12,NULL,NULL),(1440,1,448,0,'A01',0,NULL,NULL),(1441,1,449,0,'B01',1,NULL,NULL),(1442,1,449,0,'A01',2,NULL,NULL),(1443,1,449,0,'B01',11,NULL,NULL),(1444,1,449,0,'A01',12,NULL,NULL),(1445,1,449,0,'B01',0,NULL,NULL),(1449,1,452,2,'A01',12,NULL,NULL),(1450,1,451,2,'B01',12,NULL,NULL),(1451,1,450,2,'B02',12,NULL,NULL),(1452,1,453,2,'B03',12,NULL,NULL); +INSERT INTO `llx_boxes` VALUES (253,2,323,0,'0',0,NULL,NULL),(304,2,324,0,'0',0,NULL,NULL),(305,2,325,0,'0',0,NULL,NULL),(306,2,326,0,'0',0,NULL,NULL),(307,2,327,0,'0',0,NULL,NULL),(308,2,328,0,'0',0,NULL,NULL),(309,2,329,0,'0',0,NULL,NULL),(310,2,330,0,'0',0,NULL,NULL),(311,2,331,0,'0',0,NULL,NULL),(312,2,332,0,'0',0,NULL,NULL),(313,2,333,0,'0',0,NULL,NULL),(314,1,347,0,'A27',0,NULL,NULL),(315,1,348,0,'B20',0,NULL,NULL),(316,1,349,0,'B10',0,NULL,NULL),(317,1,350,0,'B18',0,NULL,NULL),(344,1,374,0,'B08',0,NULL,NULL),(347,1,377,0,'B16',0,NULL,NULL),(348,1,378,0,'B06',0,NULL,NULL),(358,1,388,0,'B38',0,NULL,NULL),(359,1,389,0,'A13',0,NULL,NULL),(360,1,390,0,'B36',0,NULL,NULL),(362,1,392,0,'A35',0,NULL,NULL),(363,1,393,0,'A11',0,NULL,NULL),(366,1,396,0,'B12',0,NULL,NULL),(387,1,403,0,'B22',0,NULL,NULL),(392,1,409,0,'A15',0,NULL,NULL),(393,1,410,0,'A33',0,NULL,NULL),(394,1,411,0,'A25',0,NULL,NULL),(395,1,412,0,'B30',0,NULL,NULL),(396,1,413,0,'A23',0,NULL,NULL),(397,1,414,0,'B28',0,NULL,NULL),(398,1,415,0,'A21',0,NULL,NULL),(399,1,416,0,'B26',0,NULL,NULL),(400,1,417,0,'A19',0,NULL,NULL),(401,1,418,0,'B24',0,NULL,NULL),(501,1,419,0,'A17',0,NULL,NULL),(1019,1,392,0,'A01',2,NULL,NULL),(1021,1,412,0,'A03',2,NULL,NULL),(1022,1,347,0,'A04',2,NULL,NULL),(1023,1,393,0,'A05',2,NULL,NULL),(1025,1,389,0,'A07',2,NULL,NULL),(1026,1,416,0,'A08',2,NULL,NULL),(1027,1,396,0,'B01',2,NULL,NULL),(1028,1,377,0,'B02',2,NULL,NULL),(1031,1,419,0,'B05',2,NULL,NULL),(1036,1,424,0,'A29',0,NULL,NULL),(1037,1,425,0,'B32',0,NULL,NULL),(1038,1,426,0,'B34',0,NULL,NULL),(1150,1,430,0,'A37',0,NULL,NULL),(1151,1,431,0,'A05',0,NULL,NULL),(1152,1,429,0,'A01',1,NULL,NULL),(1153,1,429,0,'B01',2,NULL,NULL),(1154,1,429,0,'A01',11,NULL,NULL),(1156,1,429,0,'A07',0,NULL,NULL),(1183,1,433,0,'A09',0,NULL,NULL),(1184,1,434,0,'B14',0,NULL,NULL),(1235,1,404,0,'B01',1,NULL,NULL),(1236,1,404,0,'B01',2,NULL,NULL),(1237,1,404,0,'B01',11,NULL,NULL),(1239,1,404,0,'A31',0,NULL,NULL),(1407,1,412,0,'A01',12,NULL,NULL),(1408,1,378,0,'A02',12,NULL,NULL),(1409,1,404,0,'A03',12,NULL,NULL),(1410,1,377,0,'A04',12,NULL,NULL),(1411,1,392,0,'B01',12,NULL,NULL),(1412,1,429,0,'B02',12,NULL,NULL),(1414,1,414,0,'B04',12,NULL,NULL),(1415,1,413,0,'B05',12,NULL,NULL),(1416,1,426,0,'B06',12,NULL,NULL),(1418,1,445,0,'B02',0,NULL,NULL),(1426,1,450,2,'A01',0,NULL,NULL),(1427,1,451,2,'B01',0,NULL,NULL),(1428,1,452,2,'A01',0,NULL,NULL),(1429,1,453,2,'B01',0,NULL,NULL),(1430,1,454,11,'A01',0,NULL,NULL),(1431,1,455,11,'B01',0,NULL,NULL),(1432,1,456,11,'A01',0,NULL,NULL),(1433,1,457,11,'B01',0,NULL,NULL),(1434,1,461,11,'A01',0,NULL,NULL),(1435,1,462,11,'B01',0,NULL,NULL),(1436,1,448,0,'A01',1,NULL,NULL),(1437,1,448,0,'B01',2,NULL,NULL),(1438,1,448,0,'A01',11,NULL,NULL),(1439,1,448,0,'A01',12,NULL,NULL),(1440,1,448,0,'A01',0,NULL,NULL),(1441,1,449,0,'B01',1,NULL,NULL),(1442,1,449,0,'A01',2,NULL,NULL),(1443,1,449,0,'B01',11,NULL,NULL),(1444,1,449,0,'A01',12,NULL,NULL),(1445,1,449,0,'B01',0,NULL,NULL),(1449,1,452,2,'A01',12,NULL,NULL),(1450,1,451,2,'B01',12,NULL,NULL),(1451,1,450,2,'B02',12,NULL,NULL),(1452,1,453,2,'B03',12,NULL,NULL),(1453,1,467,0,'0',0,NULL,NULL),(1454,1,468,0,'0',0,NULL,NULL),(1455,1,469,0,'0',0,NULL,NULL); /*!40000 ALTER TABLE `llx_boxes` ENABLE KEYS */; UNLOCK TABLES; @@ -1363,7 +1370,7 @@ CREATE TABLE `llx_boxes_def` ( `note` varchar(130) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_boxes_def` (`file`,`entity`,`note`) -) ENGINE=InnoDB AUTO_INCREMENT=467 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=474 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1372,7 +1379,7 @@ CREATE TABLE `llx_boxes_def` ( LOCK TABLES `llx_boxes_def` WRITE; /*!40000 ALTER TABLE `llx_boxes_def` DISABLE KEYS */; -INSERT INTO `llx_boxes_def` VALUES (323,'box_actions.php',2,'2015-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2015-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2015-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2015-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2015-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2015-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2015-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2015-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2015-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2015-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2015-03-13 20:33:09',NULL),(347,'box_clients.php',1,'2017-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2017-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2017-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2017-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2017-11-15 22:38:37',NULL),(377,'box_project.php',1,'2017-11-15 22:38:44',NULL),(378,'box_task.php',1,'2017-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2017-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2017-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2017-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2017-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2017-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2017-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2018-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2018-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2018-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2018-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2018-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2018-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2018-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2018-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2018-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2018-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2018-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL),(430,'box_bookmarks.php',1,'2018-01-19 11:27:34',NULL),(431,'box_members.php',1,'2018-01-19 11:27:56',NULL),(432,'box_birthdays.php',1,'2019-06-05 08:45:40',NULL),(433,'box_last_ticket',1,'2019-06-05 09:15:29',NULL),(434,'box_last_modified_ticket',1,'2019-06-05 09:15:29',NULL),(436,'box_accountancy_last_manual_entries.php',1,'2019-11-28 11:52:58',NULL),(437,'box_accountancy_suspense_account.php',1,'2019-11-28 11:52:58',NULL),(438,'box_supplier_orders_awaiting_reception.php',1,'2019-11-28 11:52:59',NULL),(445,'box_shipments.php',1,'2020-01-13 14:38:20',NULL),(446,'box_funnel_of_prospection.php',1,'2020-12-10 12:24:40',NULL),(447,'box_customers_outstanding_bill_reached.php',1,'2020-12-10 12:24:40',NULL),(448,'box_scheduled_jobs.php',1,'2021-04-15 10:22:49',NULL),(449,'box_dolibarr_state_board.php',1,'2021-04-15 10:22:54',NULL),(450,'box_members_last_modified.php',1,'2021-04-15 10:22:54',NULL),(451,'box_members_last_subscriptions.php',1,'2021-04-15 10:22:54',NULL),(452,'box_members_subscriptions_by_year.php',1,'2021-04-15 10:22:54',NULL),(453,'box_members_by_type.php',1,'2021-04-15 10:22:54',NULL),(454,'box_graph_ticket_by_severity.php',1,'2021-04-15 10:22:55',NULL),(455,'box_graph_nb_ticket_last_x_days.php',1,'2021-04-15 10:22:55',NULL),(456,'box_graph_nb_tickets_type.php',1,'2021-04-15 10:22:55',NULL),(457,'box_graph_new_vs_close_ticket.php',1,'2021-04-15 10:22:55',NULL),(458,'box_boms.php',1,'2021-04-15 10:22:58',NULL),(459,'box_comptes.php',1,'2021-04-15 10:22:58',NULL),(460,'box_mos.php',1,'2021-04-15 10:23:00',NULL),(461,'box_last_ticket.php',1,'2021-04-15 10:23:01',NULL),(462,'box_last_modified_ticket.php',1,'2021-04-15 10:23:01',NULL),(463,'box_ticket_by_severity.php',1,'2021-04-15 10:23:01',NULL),(464,'box_nb_ticket_last_x_days.php',1,'2021-04-15 10:23:01',NULL),(465,'box_nb_tickets_type.php',1,'2021-04-15 10:23:01',NULL),(466,'box_new_vs_close_ticket.php',1,'2021-04-15 10:23:01',NULL); +INSERT INTO `llx_boxes_def` VALUES (323,'box_actions.php',2,'2015-03-13 15:29:19',NULL),(324,'box_clients.php',2,'2015-03-13 20:21:35',NULL),(325,'box_prospect.php',2,'2015-03-13 20:21:35',NULL),(326,'box_contacts.php',2,'2015-03-13 20:21:35',NULL),(327,'box_activity.php',2,'2015-03-13 20:21:35','(WarningUsingThisBoxSlowDown)'),(328,'box_propales.php',2,'2015-03-13 20:32:38',NULL),(329,'box_comptes.php',2,'2015-03-13 20:33:09',NULL),(330,'box_factures_imp.php',2,'2015-03-13 20:33:09',NULL),(331,'box_factures.php',2,'2015-03-13 20:33:09',NULL),(332,'box_produits.php',2,'2015-03-13 20:33:09',NULL),(333,'box_produits_alerte_stock.php',2,'2015-03-13 20:33:09',NULL),(347,'box_clients.php',1,'2017-11-15 22:05:57',NULL),(348,'box_prospect.php',1,'2017-11-15 22:05:57',NULL),(349,'box_contacts.php',1,'2017-11-15 22:05:57',NULL),(350,'box_activity.php',1,'2017-11-15 22:05:57','(WarningUsingThisBoxSlowDown)'),(374,'box_services_contracts.php',1,'2017-11-15 22:38:37',NULL),(377,'box_project.php',1,'2017-11-15 22:38:44',NULL),(378,'box_task.php',1,'2017-11-15 22:38:44',NULL),(388,'box_contracts.php',1,'2017-11-15 22:39:52',NULL),(389,'box_services_expired.php',1,'2017-11-15 22:39:52',NULL),(390,'box_ficheinter.php',1,'2017-11-15 22:39:56',NULL),(392,'box_graph_propales_permonth.php',1,'2017-11-15 22:41:47',NULL),(393,'box_propales.php',1,'2017-11-15 22:41:47',NULL),(396,'box_graph_product_distribution.php',1,'2017-11-15 22:41:47',NULL),(403,'box_goodcustomers.php',1,'2018-07-30 11:13:20','(WarningUsingThisBoxSlowDown)'),(404,'box_external_rss.php',1,'2018-07-30 11:15:25','1 (Dolibarr.org News)'),(409,'box_produits.php',1,'2018-07-30 13:38:11',NULL),(410,'box_produits_alerte_stock.php',1,'2018-07-30 13:38:11',NULL),(411,'box_commandes.php',1,'2018-07-30 13:38:11',NULL),(412,'box_graph_orders_permonth.php',1,'2018-07-30 13:38:11',NULL),(413,'box_graph_invoices_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(414,'box_graph_orders_supplier_permonth.php',1,'2018-07-30 13:38:11',NULL),(415,'box_fournisseurs.php',1,'2018-07-30 13:38:11',NULL),(416,'box_factures_fourn_imp.php',1,'2018-07-30 13:38:11',NULL),(417,'box_factures_fourn.php',1,'2018-07-30 13:38:11',NULL),(418,'box_supplier_orders.php',1,'2018-07-30 13:38:11',NULL),(419,'box_actions.php',1,'2018-07-30 15:42:32',NULL),(424,'box_factures_imp.php',1,'2017-02-07 18:56:12',NULL),(425,'box_factures.php',1,'2017-02-07 18:56:12',NULL),(426,'box_graph_invoices_permonth.php',1,'2017-02-07 18:56:12',NULL),(429,'box_lastlogin.php',1,'2017-08-27 13:29:14',NULL),(430,'box_bookmarks.php',1,'2018-01-19 11:27:34',NULL),(431,'box_members.php',1,'2018-01-19 11:27:56',NULL),(432,'box_birthdays.php',1,'2019-06-05 08:45:40',NULL),(433,'box_last_ticket',1,'2019-06-05 09:15:29',NULL),(434,'box_last_modified_ticket',1,'2019-06-05 09:15:29',NULL),(436,'box_accountancy_last_manual_entries.php',1,'2019-11-28 11:52:58',NULL),(437,'box_accountancy_suspense_account.php',1,'2019-11-28 11:52:58',NULL),(438,'box_supplier_orders_awaiting_reception.php',1,'2019-11-28 11:52:59',NULL),(445,'box_shipments.php',1,'2020-01-13 14:38:20',NULL),(446,'box_funnel_of_prospection.php',1,'2020-12-10 12:24:40',NULL),(447,'box_customers_outstanding_bill_reached.php',1,'2020-12-10 12:24:40',NULL),(448,'box_scheduled_jobs.php',1,'2021-04-15 10:22:49',NULL),(449,'box_dolibarr_state_board.php',1,'2021-04-15 10:22:54',NULL),(450,'box_members_last_modified.php',1,'2021-04-15 10:22:54',NULL),(451,'box_members_last_subscriptions.php',1,'2021-04-15 10:22:54',NULL),(452,'box_members_subscriptions_by_year.php',1,'2021-04-15 10:22:54',NULL),(453,'box_members_by_type.php',1,'2021-04-15 10:22:54',NULL),(454,'box_graph_ticket_by_severity.php',1,'2021-04-15 10:22:55',NULL),(455,'box_graph_nb_ticket_last_x_days.php',1,'2021-04-15 10:22:55',NULL),(456,'box_graph_nb_tickets_type.php',1,'2021-04-15 10:22:55',NULL),(457,'box_graph_new_vs_close_ticket.php',1,'2021-04-15 10:22:55',NULL),(461,'box_last_ticket.php',1,'2021-04-15 10:23:01',NULL),(462,'box_last_modified_ticket.php',1,'2021-04-15 10:23:01',NULL),(467,'box_boms.php',1,'2021-07-11 17:49:46',NULL),(468,'box_comptes.php',1,'2021-07-11 17:49:46',NULL),(469,'box_mos.php',1,'2021-07-11 17:49:47',NULL),(470,'box_ticket_by_severity.php',1,'2021-07-11 17:49:47',NULL),(471,'box_nb_ticket_last_x_days.php',1,'2021-07-11 17:49:47',NULL),(472,'box_nb_tickets_type.php',1,'2021-07-11 17:49:47',NULL),(473,'box_new_vs_close_ticket.php',1,'2021-07-11 17:49:47',NULL); /*!40000 ALTER TABLE `llx_boxes_def` ENABLE KEYS */; UNLOCK TABLES; @@ -1492,7 +1499,7 @@ CREATE TABLE `llx_c_action_trigger` ( PRIMARY KEY (`rowid`), UNIQUE KEY `uk_action_trigger_code` (`code`), KEY `idx_action_trigger_rang` (`rang`) -) ENGINE=InnoDB AUTO_INCREMENT=392 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=394 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1501,7 +1508,7 @@ CREATE TABLE `llx_c_action_trigger` ( LOCK TABLES `llx_c_action_trigger` WRITE; /*!40000 ALTER TABLE `llx_c_action_trigger` DISABLE KEYS */; -INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203),(187,'EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223),(210,'MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23),(211,'CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18),(212,'PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10),(213,'PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10),(214,'PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10),(215,'PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10),(216,'MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24),(217,'MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24),(218,'MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24),(225,'COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1),(226,'PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2),(227,'ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5),(228,'BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9),(229,'PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10),(230,'ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14),(231,'BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17),(232,'CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18),(233,'FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35),(234,'EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204),(249,'TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161),(250,'TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163),(251,'TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is assigned to another user','ticket',164),(252,'TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165),(253,'TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166),(254,'TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167),(261,'USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300),(262,'BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650),(263,'BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651),(264,'BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652),(265,'BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653),(266,'BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654),(351,'MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660),(352,'MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661),(353,'MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662),(354,'MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663),(365,'CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50),(366,'CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51),(367,'CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52),(368,'RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500),(369,'RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502),(370,'RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504),(371,'RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506),(372,'RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510),(373,'RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512),(374,'RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514),(375,'RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516); +INSERT INTO `llx_c_action_trigger` VALUES (131,'COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1),(132,'COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1),(133,'PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2),(134,'PROPAL_SENTBYMAIL','Commercial proposal sent by mail','Executed when a commercial proposal is sent by mail','propal',3),(135,'ORDER_VALIDATE','Customer order validate','Executed when a customer order is validated','commande',4),(136,'ORDER_CLOSE','Customer order classify delivered','Executed when a customer order is set delivered','commande',5),(137,'ORDER_CLASSIFY_BILLED','Customer order classify billed','Executed when a customer order is set to billed','commande',5),(138,'ORDER_CANCEL','Customer order canceled','Executed when a customer order is canceled','commande',5),(139,'ORDER_SENTBYMAIL','Customer order sent by mail','Executed when a customer order is sent by mail ','commande',5),(140,'BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6),(141,'BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7),(142,'BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8),(143,'BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9),(144,'BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',10),(145,'ORDER_SUPPLIER_VALIDATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(146,'ORDER_SUPPLIER_APPROVE','Supplier order request approved','Executed when a supplier order is approved','order_supplier',12),(147,'ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13),(148,'ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14),(149,'BILL_SUPPLIER_VALIDATE','Supplier invoice validated','Executed when a supplier invoice is validated','invoice_supplier',15),(150,'BILL_SUPPLIER_PAYED','Supplier invoice payed','Executed when a supplier invoice is payed','invoice_supplier',16),(151,'BILL_SUPPLIER_SENTBYMAIL','Supplier invoice sent by mail','Executed when a supplier invoice is sent by mail','invoice_supplier',17),(152,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',17),(153,'CONTRACT_VALIDATE','Contract validated','Executed when a contract is validated','contrat',18),(154,'SHIPPING_VALIDATE','Shipping validated','Executed when a shipping is validated','shipping',20),(155,'SHIPPING_SENTBYMAIL','Shipping sent by mail','Executed when a shipping is sent by mail','shipping',21),(156,'MEMBER_VALIDATE','Member validated','Executed when a member is validated','member',22),(158,'MEMBER_RESILIATE','Member resiliated','Executed when a member is resiliated','member',24),(159,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',24),(160,'MEMBER_DELETE','Member deleted','Executed when a member is deleted','member',25),(161,'FICHINTER_VALIDATE','Intervention validated','Executed when a intervention is validated','ficheinter',19),(162,'FICHINTER_CLASSIFY_BILLED','Intervention set billed','Executed when a intervention is set to billed (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(163,'FICHINTER_CLASSIFY_UNBILLED','Intervention set unbilled','Executed when a intervention is set to unbilled (when option FICHINTER_CLASSIFY_BILLED is set)','ficheinter',19),(164,'FICHINTER_REOPEN','Intervention opened','Executed when a intervention is re-opened','ficheinter',19),(165,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',19),(166,'PROJECT_CREATE','Project creation','Executed when a project is created','project',140),(167,'PROPAL_CLOSE_SIGNED','Customer proposal closed signed','Executed when a customer proposal is closed signed','propal',2),(168,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',2),(169,'PROPAL_CLASSIFY_BILLED','Customer proposal set billed','Executed when a customer proposal is set to billed','propal',2),(170,'TASK_CREATE','Task created','Executed when a project task is created','project',35),(171,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36),(172,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37),(173,'BILL_SUPPLIER_UNVALIDATE','Supplier invoice unvalidated','Executed when a supplier invoice status is set back to draft','invoice_supplier',15),(174,'PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141),(175,'PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142),(176,'ORDER_SUPPLIER_CREATE','Supplier order validated','Executed when a supplier order is validated','order_supplier',11),(177,'ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',12),(178,'ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',12),(179,'ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14),(180,'PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30),(181,'PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30),(182,'PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30),(183,'EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201),(185,'EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202),(186,'EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203),(187,'EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204),(192,'HOLIDAY_CREATE','Leave request created','Executed when a leave request is created','holiday',221),(193,'HOLIDAY_VALIDATE','Leave request validated','Executed when a leave request is validated','holiday',222),(194,'HOLIDAY_APPROVE','Leave request approved','Executed when a leave request is approved','holiday',223),(210,'MEMBER_SENTBYMAIL','Mails sent from member card','Executed when you send email from member card','member',23),(211,'CONTRACT_SENTBYMAIL','Contract sent by mail','Executed when a contract is sent by mail','contrat',18),(212,'PROPOSAL_SUPPLIER_VALIDATE','Price request validated','Executed when a commercial proposal is validated','proposal_supplier',10),(213,'PROPOSAL_SUPPLIER_SENTBYMAIL','Price request sent by mail','Executed when a commercial proposal is sent by mail','proposal_supplier',10),(214,'PROPOSAL_SUPPLIER_CLOSE_SIGNED','Price request closed signed','Executed when a customer proposal is closed signed','proposal_supplier',10),(215,'PROPOSAL_SUPPLIER_CLOSE_REFUSED','Price request closed refused','Executed when a customer proposal is closed refused','proposal_supplier',10),(216,'MEMBER_SUBSCRIPTION_CREATE','Member subscribtion recorded','Executed when a member subscribtion is deleted','member',24),(217,'MEMBER_SUBSCRIPTION_MODIFY','Member subscribtion modified','Executed when a member subscribtion is modified','member',24),(218,'MEMBER_SUBSCRIPTION_DELETE','Member subscribtion deleted','Executed when a member subscribtion is deleted','member',24),(225,'COMPANY_DELETE','Third party deleted','Executed when you delete third party','societe',1),(226,'PROPAL_DELETE','Customer proposal deleted','Executed when a customer proposal is deleted','propal',2),(227,'ORDER_DELETE','Customer order deleted','Executed when a customer order is deleted','commande',5),(228,'BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9),(229,'PROPOSAL_SUPPLIER_DELETE','Price request deleted','Executed when a customer proposal delete','proposal_supplier',10),(230,'ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14),(231,'BILL_SUPPLIER_DELETE','Supplier invoice deleted','Executed when a supplier invoice is deleted','invoice_supplier',17),(232,'CONTRACT_DELETE','Contract deleted','Executed when a contract is deleted','contrat',18),(233,'FICHINTER_DELETE','Intervention is deleted','Executed when a intervention is deleted','ficheinter',35),(234,'EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204),(249,'TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161),(250,'TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163),(251,'TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is assigned to another user','ticket',164),(252,'TICKET_CLOSE','Ticket closed','Executed when a ticket is closed','ticket',165),(253,'TICKET_SENTBYMAIL','Ticket message sent by email','Executed when a message is sent from the ticket record','ticket',166),(254,'TICKET_DELETE','Ticket deleted','Executed when a ticket is deleted','ticket',167),(261,'USER_SENTBYMAIL','Email sent','Executed when an email is sent from user card','user',300),(262,'BOM_VALIDATE','BOM validated','Executed when a BOM is validated','bom',650),(263,'BOM_UNVALIDATE','BOM unvalidated','Executed when a BOM is unvalidated','bom',651),(264,'BOM_CLOSE','BOM disabled','Executed when a BOM is disabled','bom',652),(265,'BOM_REOPEN','BOM reopen','Executed when a BOM is re-open','bom',653),(266,'BOM_DELETE','BOM deleted','Executed when a BOM deleted','bom',654),(351,'MRP_MO_VALIDATE','MO validated','Executed when a MO is validated','bom',660),(352,'MRP_MO_PRODUCED','MO produced','Executed when a MO is produced','bom',661),(353,'MRP_MO_DELETE','MO deleted','Executed when a MO is deleted','bom',662),(354,'MRP_MO_CANCEL','MO canceled','Executed when a MO is canceled','bom',663),(365,'CONTACT_CREATE','Contact address created','Executed when a contact is created','contact',50),(366,'CONTACT_SENTBYMAIL','Mails sent from third party card','Executed when you send email from contact adress card','contact',51),(367,'CONTACT_DELETE','Contact address deleted','Executed when a contact is deleted','contact',52),(368,'RECRUITMENTJOBPOSITION_CREATE','Job created','Executed when a job is created','recruitment',7500),(369,'RECRUITMENTJOBPOSITION_MODIFY','Job modified','Executed when a job is modified','recruitment',7502),(370,'RECRUITMENTJOBPOSITION_SENTBYMAIL','Mails sent from job record','Executed when you send email from job record','recruitment',7504),(371,'RECRUITMENTJOBPOSITION_DELETE','Job deleted','Executed when a job is deleted','recruitment',7506),(372,'RECRUITMENTCANDIDATURE_CREATE','Candidature created','Executed when a candidature is created','recruitment',7510),(373,'RECRUITMENTCANDIDATURE_MODIFY','Candidature modified','Executed when a candidature is modified','recruitment',7512),(374,'RECRUITMENTCANDIDATURE_SENTBYMAIL','Mails sent from candidature record','Executed when you send email from candidature record','recruitment',7514),(375,'RECRUITMENTCANDIDATURE_DELETE','Candidature deleted','Executed when a candidature is deleted','recruitment',7516),(392,'COMPANY_MODIFY','Third party update','Executed when you update third party','societe',1),(393,'CONTACT_MODIFY','Contact address update','Executed when a contact is updated','contact',51); /*!40000 ALTER TABLE `llx_c_action_trigger` ENABLE KEYS */; UNLOCK TABLES; @@ -1582,7 +1589,7 @@ CREATE TABLE `llx_c_barcode_type` ( `example` varchar(16) COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_c_barcode_type` (`code`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1864,7 +1871,7 @@ CREATE TABLE `llx_c_email_templates` ( PRIMARY KEY (`rowid`), UNIQUE KEY `uk_c_email_templates` (`entity`,`label`,`lang`), KEY `idx_type` (`type_template`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -1873,7 +1880,7 @@ CREATE TABLE `llx_c_email_templates` ( LOCK TABLES `llx_c_email_templates` WRITE; /*!40000 ALTER TABLE `llx_c_email_templates` DISABLE KEYS */; -INSERT INTO `llx_c_email_templates` VALUES (1,1,NULL,'propal_send','',1,NULL,NULL,'2018-01-19 11:17:48','My Private email template for proposals',1,1,'Hello __FIRSTNAME__','We wish you a happy new year
__USER_SIGNATURE__',NULL,'1','1'),(2,0,'adherent','member','',0,NULL,NULL,'2018-01-19 11:17:48','(SendAnEMailToMember)',1,1,'__(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','1'),(3,0,'banque','thirdparty','',0,NULL,NULL,'2018-01-19 11:17:48','(YourSEPAMandate)',1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',NULL,'1','1'),(6,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnAutoSubscription)',10,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(7,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnMemberValidation)',20,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(8,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnNewSubscription)',30,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','1'),(9,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingReminderForExpiredSubscription)',40,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(10,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnCancelation)',50,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(11,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingAnEMailToMember)',60,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(12,0,'recruitment','recruitmentcandidature_send','',0,NULL,NULL,'2020-12-10 12:24:39','(AnswerCandidature)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__','__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswer)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'$conf->recruitment->enabled','0'),(14,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailAskConf',10,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(15,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailAskBooth',20,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(16,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailSubsBooth',30,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(17,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailSubsEvent',40,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(18,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationMassEmailAttendees',50,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(19,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationMassEmailSpeakers',60,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(20,0,'partnership','member',NULL,0,NULL,NULL,'2021-04-15 10:22:55','(AlertStatusPartnershipExpiration)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourMembershipWillSoonExpireTopic)__','\n

Dear __MEMBER_FULLNAME__,

\n__(YourMembershipWillSoonExpireContent)__

\n
\n\n __(Sincerely)__
\n __[PARTNERSHIP_SOCIETE_NOM]__
\n \n',NULL,'1','0'); +INSERT INTO `llx_c_email_templates` VALUES (1,1,NULL,'propal_send','',1,NULL,NULL,'2018-01-19 11:17:48','My Private email template for proposals',1,1,'Hello __FIRSTNAME__','We wish you a happy new year
__USER_SIGNATURE__',NULL,'1','1'),(2,0,'adherent','member','',0,NULL,NULL,'2018-01-19 11:17:48','(SendAnEMailToMember)',1,1,'__(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','1'),(3,0,'banque','thirdparty','',0,NULL,NULL,'2018-01-19 11:17:48','(YourSEPAMandate)',1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',NULL,'1','1'),(6,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnAutoSubscription)',10,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(7,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnMemberValidation)',20,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(8,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnNewSubscription)',30,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','1'),(9,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingReminderForExpiredSubscription)',40,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(10,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingEmailOnCancelation)',50,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(11,0,'adherent','member','',0,NULL,NULL,'2018-11-23 11:56:08','(SendingAnEMailToMember)',60,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'1','0'),(12,0,'recruitment','recruitmentcandidature_send','',0,NULL,NULL,'2020-12-10 12:24:39','(AnswerCandidature)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__','__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswer)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',NULL,'$conf->recruitment->enabled','0'),(14,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailAskConf',10,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(15,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailAskBooth',20,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(16,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailSubsBooth',30,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(17,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationEmailSubsEvent',40,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__ONLINE_PAYMENT_TEXT_AND_URL__


__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(18,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationMassEmailAttendees',50,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__

__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(19,0,'','eventorganization_send','',0,NULL,NULL,'2021-02-14 13:42:41','EventOrganizationMassEmailSpeakers',60,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__','__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__',NULL,'1',NULL),(20,0,'partnership','member',NULL,0,NULL,NULL,'2021-04-15 10:22:55','(AlertStatusPartnershipExpiration)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourMembershipWillSoonExpireTopic)__','\n

Dear __MEMBER_FULLNAME__,

\n__(YourMembershipWillSoonExpireContent)__

\n
\n\n __(Sincerely)__
\n __[PARTNERSHIP_SOCIETE_NOM]__
\n \n',NULL,'1','0'),(27,0,'partnership','partnership_send','',0,NULL,NULL,'2021-07-11 17:49:44','(SendingEmailOnPartnershipWillSoonBeCanceled)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipWillSoonBeCanceledTopic)__','\n

Hello,

\n__(YourPartnershipWillSoonBeCanceledContent)__

\n
\n\n
\n\n __(Sincerely)__
\n __[MAIN_INFO_SOCIETE_NOM]__
\n \n',NULL,'1','0'),(28,0,'partnership','partnership_send','',0,NULL,NULL,'2021-07-11 17:49:44','(SendingEmailOnPartnershipCanceled)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipCanceledTopic)__','\n

Hello,

\n__(YourPartnershipCanceledContent)__

\n
\n\n
\n\n __(Sincerely)__
\n __[MAIN_INFO_SOCIETE_NOM]__
\n \n',NULL,'1','0'),(29,0,'partnership','partnership_send','',0,NULL,NULL,'2021-07-11 17:49:44','(SendingEmailOnPartnershipRefused)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipRefusedTopic)__','\n

Hello,

\n__(YourPartnershipRefusedContent)__

\n
\n\n
\n\n __(Sincerely)__
\n __[MAIN_INFO_SOCIETE_NOM]__
\n \n',NULL,'1','0'),(30,0,'partnership','partnership_send','',0,NULL,NULL,'2021-07-11 17:49:44','(SendingEmailOnPartnershipAccepted)',100,1,'[__[MAIN_INFO_SOCIETE_NOM]__] - __(YourPartnershipAcceptedTopic)__','\n

Hello,

\n__(YourPartnershipAcceptedContent)__

\n
\n\n
\n\n __(Sincerely)__
\n __[MAIN_INFO_SOCIETE_NOM]__
\n \n',NULL,'1','0'); /*!40000 ALTER TABLE `llx_c_email_templates` ENABLE KEYS */; UNLOCK TABLES; @@ -2228,7 +2235,7 @@ CREATE TABLE `llx_c_input_reason` ( `module` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_c_input_reason` (`code`) -) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2241,34 +2248,6 @@ INSERT INTO `llx_c_input_reason` VALUES (1,'SRC_INTE','Web site',1,NULL),(2,'SRC /*!40000 ALTER TABLE `llx_c_input_reason` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_c_justificative_type` --- - -DROP TABLE IF EXISTS `llx_c_justificative_type`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_justificative_type` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(24) COLLATE utf8_unicode_ci NOT NULL, - `label` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - `module` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_c_justificative_type` (`code`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_justificative_type` --- - -LOCK TABLES `llx_c_justificative_type` WRITE; -/*!40000 ALTER TABLE `llx_c_justificative_type` DISABLE KEYS */; -INSERT INTO `llx_c_justificative_type` VALUES (1,'TRAINSUBSCRIPTION','Train subscrption-',1,NULL),(2,'HIGHWAYSUBSCRIPTION','Highway subscription',1,NULL); -/*!40000 ALTER TABLE `llx_c_justificative_type` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_c_lead_status` -- @@ -2298,60 +2277,6 @@ INSERT INTO `llx_c_lead_status` VALUES (1,'PROSP','Prospection',10,0.00,1),(2,'Q /*!40000 ALTER TABLE `llx_c_lead_status` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_c_lead_type` --- - -DROP TABLE IF EXISTS `llx_c_lead_type`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_lead_type` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(10) COLLATE utf8_unicode_ci NOT NULL, - `label` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - PRIMARY KEY (`rowid`), - UNIQUE KEY `code` (`code`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_lead_type` --- - -LOCK TABLES `llx_c_lead_type` WRITE; -/*!40000 ALTER TABLE `llx_c_lead_type` DISABLE KEYS */; -INSERT INTO `llx_c_lead_type` VALUES (1,'SUPP','Support',1),(2,'TRAIN','Formation',1),(3,'ADVI','Conseil',1); -/*!40000 ALTER TABLE `llx_c_lead_type` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_c_methode_commande_fournisseur` --- - -DROP TABLE IF EXISTS `llx_c_methode_commande_fournisseur`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_methode_commande_fournisseur` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `code` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `libelle` varchar(60) COLLATE utf8_unicode_ci DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_c_methode_commande_fournisseur` (`code`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_methode_commande_fournisseur` --- - -LOCK TABLES `llx_c_methode_commande_fournisseur` WRITE; -/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` DISABLE KEYS */; -INSERT INTO `llx_c_methode_commande_fournisseur` VALUES (1,'OrderByMail','Courrier',1),(2,'OrderByFax','Fax',1),(3,'OrderByEMail','EMail',1),(4,'OrderByPhone','Téléphone',1),(5,'OrderByWWW','En ligne',1); -/*!40000 ALTER TABLE `llx_c_methode_commande_fournisseur` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_c_paiement` -- @@ -2384,36 +2309,6 @@ INSERT INTO `llx_c_paiement` VALUES (1,1,'TIP','TIP',2,0,NULL,NULL,0),(2,1,'VIR' /*!40000 ALTER TABLE `llx_c_paiement` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_c_paiement_temp` --- - -DROP TABLE IF EXISTS `llx_c_paiement_temp`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_paiement_temp` ( - `id` int(11) NOT NULL, - `entity` int(11) NOT NULL DEFAULT 1, - `code` varchar(6) COLLATE utf8_unicode_ci NOT NULL, - `libelle` varchar(62) COLLATE utf8_unicode_ci DEFAULT NULL, - `type` smallint(6) DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - `accountancy_code` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, - `module` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, - `position` int(11) NOT NULL DEFAULT 0 -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_paiement_temp` --- - -LOCK TABLES `llx_c_paiement_temp` WRITE; -/*!40000 ALTER TABLE `llx_c_paiement_temp` DISABLE KEYS */; -INSERT INTO `llx_c_paiement_temp` VALUES (1,1,'TIP','TIP',2,0,NULL,NULL,0),(2,1,'VIR','Virement',2,1,NULL,NULL,0),(3,1,'PRE','Prélèvement',2,1,NULL,NULL,0),(4,1,'LIQ','Espèces',2,1,NULL,NULL,0),(6,1,'CB','Carte Bancaire',2,1,NULL,NULL,0),(7,1,'CHQ','Chèque',2,1,NULL,NULL,0),(50,1,'VAD','Paiement en ligne',2,0,NULL,NULL,0),(51,1,'TRA','Traite',2,0,NULL,NULL,0),(52,1,'LCR','LCR',2,0,NULL,NULL,0),(53,1,'FAC','Factor',2,0,NULL,NULL,0); -/*!40000 ALTER TABLE `llx_c_paiement_temp` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_c_paper_format` -- @@ -2444,6 +2339,32 @@ INSERT INTO `llx_c_paper_format` VALUES (1,'EU4A0','Format 4A0',1682.00,2378.00, /*!40000 ALTER TABLE `llx_c_paper_format` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `llx_c_partnership_type` +-- + +DROP TABLE IF EXISTS `llx_c_partnership_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_partnership_type` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT 1, + `code` varchar(32) COLLATE utf8_unicode_ci NOT NULL, + `label` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT 1, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_partnership_type` +-- + +LOCK TABLES `llx_c_partnership_type` WRITE; +/*!40000 ALTER TABLE `llx_c_partnership_type` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_c_partnership_type` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `llx_c_payment_term` -- @@ -2567,11 +2488,11 @@ DROP TABLE IF EXISTS `llx_c_product_nature`; CREATE TABLE `llx_c_product_nature` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `code` tinyint(4) NOT NULL, - `label` varchar(100) DEFAULT NULL, + `label` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL, `active` tinyint(4) NOT NULL DEFAULT 1, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_c_product_nature` (`code`) -) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2584,6 +2505,34 @@ INSERT INTO `llx_c_product_nature` VALUES (1,0,'RowMaterial',1),(2,1,'Finished', /*!40000 ALTER TABLE `llx_c_product_nature` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `llx_c_productbatch_qcstatus` +-- + +DROP TABLE IF EXISTS `llx_c_productbatch_qcstatus`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_c_productbatch_qcstatus` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `entity` int(11) NOT NULL DEFAULT 1, + `code` varchar(16) COLLATE utf8_unicode_ci NOT NULL, + `label` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `active` int(11) NOT NULL DEFAULT 1, + PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_c_productbatch_qcstatus` (`code`,`entity`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_c_productbatch_qcstatus` +-- + +LOCK TABLES `llx_c_productbatch_qcstatus` WRITE; +/*!40000 ALTER TABLE `llx_c_productbatch_qcstatus` DISABLE KEYS */; +INSERT INTO `llx_c_productbatch_qcstatus` VALUES (1,1,'OK','InWorkingOrder',1),(2,1,'KO','OutOfOrder',1); +/*!40000 ALTER TABLE `llx_c_productbatch_qcstatus` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `llx_c_propalst` -- @@ -2896,32 +2845,6 @@ INSERT INTO `llx_c_stcommcontact` VALUES (-1,'ST_NO','Do not contact',NULL,1),(0 /*!40000 ALTER TABLE `llx_c_stcommcontact` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_c_subtotal_free_text` --- - -DROP TABLE IF EXISTS `llx_c_subtotal_free_text`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_subtotal_free_text` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `content` text COLLATE utf8_unicode_ci DEFAULT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - `entity` int(11) NOT NULL DEFAULT 1, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_subtotal_free_text` --- - -LOCK TABLES `llx_c_subtotal_free_text` WRITE; -/*!40000 ALTER TABLE `llx_c_subtotal_free_text` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_c_subtotal_free_text` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_c_ticket_category` -- @@ -3037,7 +2960,7 @@ CREATE TABLE `llx_c_ticket_type` ( `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_code` (`code`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3046,7 +2969,7 @@ CREATE TABLE `llx_c_ticket_type` ( LOCK TABLES `llx_c_ticket_type` WRITE; /*!40000 ALTER TABLE `llx_c_ticket_type` DISABLE KEYS */; -INSERT INTO `llx_c_ticket_type` VALUES (1,1,'COM','10','Commercial question',1,1,NULL),(2,1,'ISSUE','20','Issue or problem',1,0,NULL),(3,1,'REQUEST','25','Change or enhancement request',1,0,NULL),(4,1,'PROJECT','30','Project',0,0,NULL),(5,1,'OTHER','40','Other',1,0,NULL),(11,1,'HELP','15','Request for functionnal help',1,0,NULL); +INSERT INTO `llx_c_ticket_type` VALUES (1,1,'COM','10','Commercial question',1,1,NULL),(2,1,'ISSUE','20','Issue or bug',1,0,NULL),(3,1,'REQUEST','25','Change or enhancement request',1,0,NULL),(4,1,'PROJECT','30','Project',0,0,NULL),(5,1,'OTHER','40','Other',1,0,NULL),(11,1,'HELP','15','Request for functionnal help',1,0,NULL),(13,1,'PROBLEM','22','Problem',0,0,NULL); /*!40000 ALTER TABLE `llx_c_ticket_type` ENABLE KEYS */; UNLOCK TABLES; @@ -3060,11 +2983,11 @@ DROP TABLE IF EXISTS `llx_c_transport_mode`; CREATE TABLE `llx_c_transport_mode` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `entity` int(11) NOT NULL DEFAULT 1, - `code` varchar(3) NOT NULL, - `label` varchar(255) NOT NULL, + `code` varchar(3) CHARACTER SET utf8mb4 NOT NULL, + `label` varchar(255) CHARACTER SET utf8mb4 NOT NULL, `active` tinyint(4) NOT NULL DEFAULT 1, PRIMARY KEY (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -3261,64 +3184,6 @@ INSERT INTO `llx_c_typent` VALUES (1,'TE_STARTUP','Start-up',NULL,1,NULL,0),(2,' /*!40000 ALTER TABLE `llx_c_typent` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_c_ultimatepdf_line` --- - -DROP TABLE IF EXISTS `llx_c_ultimatepdf_line`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_ultimatepdf_line` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `code` varchar(30) NOT NULL, - `label` varchar(255) NOT NULL, - `description` varchar(128) NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_c_ultimatepdf_line` (`code`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_ultimatepdf_line` --- - -LOCK TABLES `llx_c_ultimatepdf_line` WRITE; -/*!40000 ALTER TABLE `llx_c_ultimatepdf_line` DISABLE KEYS */; -INSERT INTO `llx_c_ultimatepdf_line` VALUES (1,1,'TEXTE1','Garantie 2 ans pièces et main d\'œuvre, retour en atelier (Hors filtre et pièce d\'usure)','texte de garantie',1); -/*!40000 ALTER TABLE `llx_c_ultimatepdf_line` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_c_ultimatepdf_title` --- - -DROP TABLE IF EXISTS `llx_c_ultimatepdf_title`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_c_ultimatepdf_title` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `code` varchar(30) NOT NULL, - `label` varchar(128) NOT NULL, - `description` varchar(255) NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT 1, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_c_ultimatepdf_title` (`code`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_c_ultimatepdf_title` --- - -LOCK TABLES `llx_c_ultimatepdf_title` WRITE; -/*!40000 ALTER TABLE `llx_c_ultimatepdf_title` DISABLE KEYS */; -INSERT INTO `llx_c_ultimatepdf_title` VALUES (1,1,'TITLE1','Facture Proforma','Facture proforma',1); -/*!40000 ALTER TABLE `llx_c_ultimatepdf_title` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_c_units` -- @@ -3799,45 +3664,6 @@ LOCK TABLES `llx_cabinetmed_societe` WRITE; /*!40000 ALTER TABLE `llx_cabinetmed_societe` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_captureserver_captureserver` --- - -DROP TABLE IF EXISTS `llx_captureserver_captureserver`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_captureserver_captureserver` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `ref` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, - `content` text COLLATE utf8_unicode_ci DEFAULT NULL, - `qty` int(11) DEFAULT NULL, - `ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `status` int(11) DEFAULT NULL, - `date_creation` datetime NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `comment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_captureserver_captureserver_uk` (`entity`,`ref`), - KEY `idx_captureserver_captureserver_rowid` (`rowid`), - KEY `idx_captureserver_captureserver_ref` (`ref`), - KEY `idx_captureserver_captureserver_type` (`type`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_captureserver_captureserver` --- - -LOCK TABLES `llx_captureserver_captureserver` WRITE; -/*!40000 ALTER TABLE `llx_captureserver_captureserver` DISABLE KEYS */; -INSERT INTO `llx_captureserver_captureserver` VALUES (1,1,'dolibarrping_1','dolibarrping 1 ','dolibarrping','[]',1,'127.0.0.1',1,'2020-01-01 16:01:31','2020-01-01 12:01:31','Ping received at 20200101165522, version ',NULL); -/*!40000 ALTER TABLE `llx_captureserver_captureserver` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_categorie` -- @@ -3935,31 +3761,6 @@ LOCK TABLES `llx_categorie_actioncomm` WRITE; /*!40000 ALTER TABLE `llx_categorie_actioncomm` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_categorie_association` --- - -DROP TABLE IF EXISTS `llx_categorie_association`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_categorie_association` ( - `fk_categorie_mere` int(11) NOT NULL, - `fk_categorie_fille` int(11) NOT NULL, - UNIQUE KEY `uk_categorie_association` (`fk_categorie_mere`,`fk_categorie_fille`), - UNIQUE KEY `uk_categorie_association_fk_categorie_fille` (`fk_categorie_fille`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_categorie_association` --- - -LOCK TABLES `llx_categorie_association` WRITE; -/*!40000 ALTER TABLE `llx_categorie_association` DISABLE KEYS */; -INSERT INTO `llx_categorie_association` VALUES (3,5),(9,11); -/*!40000 ALTER TABLE `llx_categorie_association` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_categorie_contact` -- @@ -4403,7 +4204,7 @@ CREATE TABLE `llx_commande` ( LOCK TABLES `llx_commande` WRITE; /*!40000 ALTER TABLE `llx_commande` DISABLE KEYS */; -INSERT INTO `llx_commande` VALUES (1,'2020-12-10 12:24:22',1,NULL,'CO1107-0002',1,NULL,NULL,'','2013-07-20 15:23:12','2020-08-08 13:59:09',NULL,'2020-07-20',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,1,1,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(2,'2020-12-10 12:24:22',1,NULL,'CO1107-0003',1,NULL,NULL,'','2013-07-20 23:20:12','2020-02-12 17:06:51',NULL,'2020-07-21',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,0,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(3,'2020-12-10 12:24:22',1,NULL,'CO1107-0004',1,NULL,NULL,'','2013-07-20 23:22:53','2020-02-17 18:27:56',NULL,'2020-07-21',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,30.00000000,30.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(5,'2020-12-10 12:24:22',1,NULL,'CO1108-0001',1,NULL,NULL,'','2013-08-08 03:04:11','2020-08-08 03:04:21',NULL,'2020-08-08',1,NULL,1,NULL,NULL,2,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(6,'2021-04-15 10:22:31',19,NULL,'(PROV6)',1,NULL,NULL,'','2015-02-17 16:22:14',NULL,NULL,'2021-02-17',1,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','einstein',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,'commande/(PROV6)/(PROV6).pdf',NULL,NULL),(17,'2020-06-12 17:12:08',4,NULL,'CO7001-0005',1,NULL,NULL,NULL,'2017-02-15 23:50:34','2019-02-15 23:50:34',NULL,'2020-05-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,509.00000000,509.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,509.00000000,0.00000000,509.00000000,NULL,NULL,NULL),(18,'2021-04-15 10:22:31',7,4,'CO7001-0006',1,NULL,NULL,NULL,'2017-02-15 23:51:23','2021-02-15 23:51:23',NULL,'2021-02-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,900.00000000,900.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000,NULL,NULL,NULL),(20,'2021-04-15 10:22:31',4,NULL,'CO7001-0007',1,NULL,NULL,NULL,'2017-02-15 23:55:52','2020-02-15 23:55:52',NULL,'2021-04-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,330.00000000,330.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,330.00000000,0.00000000,330.00000000,NULL,NULL,NULL),(29,'2021-04-15 10:22:31',4,NULL,'CO7001-0008',1,NULL,NULL,NULL,'2017-02-16 00:03:44','2021-02-16 00:03:44',NULL,'2021-02-12',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,457.00000000,457.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,457.00000000,0.00000000,457.00000000,NULL,NULL,NULL),(34,'2021-04-15 10:22:31',11,NULL,'CO7001-0009',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2021-02-16 00:05:01',NULL,'2021-01-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,124.00000000,124.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,124.00000000,0.00000000,124.00000000,NULL,NULL,NULL),(38,'2021-04-15 10:22:31',3,NULL,'CO7001-0010',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2021-02-16 00:05:01',NULL,'2021-02-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000,NULL,NULL,NULL),(40,'2021-04-15 10:22:31',11,NULL,'CO7001-0011',1,NULL,NULL,NULL,'2017-02-16 00:05:10','2021-02-16 00:05:11',NULL,'2021-01-23',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1210.00000000,1210.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1210.00000000,0.00000000,1210.00000000,NULL,NULL,NULL),(43,'2021-04-15 10:22:31',10,NULL,'CO7001-0012',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2021-02-16 00:05:11',NULL,'2021-02-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,478.00000000,478.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,478.00000000,0.00000000,478.00000000,NULL,NULL,NULL),(47,'2020-12-10 12:24:22',1,NULL,'CO7001-0013',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2020-02-16 00:05:11',NULL,'2020-11-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,55.00000000,55.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,55.00000000,0.00000000,55.00000000,NULL,NULL,NULL),(48,'2020-12-10 12:24:22',4,NULL,'CO7001-0014',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2020-02-16 00:05:11',NULL,'2020-07-30',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,540.00000000,540.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,540.00000000,0.00000000,540.00000000,NULL,NULL,NULL),(50,'2021-04-15 10:22:31',1,NULL,'CO7001-0015',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2021-02-16 00:05:26',NULL,'2020-12-12',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,118.00000000,118.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,118.00000000,0.00000000,118.00000000,NULL,NULL,NULL),(54,'2020-06-12 17:12:08',12,NULL,'CO7001-0016',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2019-02-16 00:05:26','2019-02-16 03:05:56','2020-06-03',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,220.00000000,220.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,220.00000000,0.00000000,220.00000000,NULL,NULL,NULL),(58,'2020-12-10 12:24:22',1,NULL,'CO7001-0017',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2020-02-16 00:05:26',NULL,'2020-07-23',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,436.00000000,436.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,436.00000000,0.00000000,436.00000000,NULL,NULL,NULL),(62,'2021-04-15 10:22:31',19,NULL,'CO7001-0018',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2020-02-16 00:05:35','2020-12-20 20:48:55','2021-02-23',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,410.00000000,0.00000000,410.00000000,NULL,NULL,NULL),(68,'2020-06-12 17:12:08',3,NULL,'CO7001-0019',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2019-02-16 00:05:35',NULL,'2020-05-19',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,45.00000000,45.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,45.00000000,0.00000000,45.00000000,NULL,NULL,NULL),(72,'2020-12-10 12:24:22',6,NULL,'CO7001-0020',1,NULL,NULL,NULL,'2017-02-16 00:05:36','2020-02-16 00:05:36','2021-01-16 02:42:56','2020-11-13',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,610.00000000,610.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,610.00000000,0.00000000,610.00000000,NULL,NULL,NULL),(75,'2021-04-15 10:22:31',4,NULL,'CO7001-0021',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2020-02-16 04:14:20',NULL,'2021-02-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,25.00000000,49.88000000,0.00000000,1200.00000000,1274.88000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,25.00000000,1274.88000000,NULL,NULL,NULL),(78,'2020-12-10 12:24:22',12,NULL,'CO7001-0022',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2020-02-16 00:05:37',NULL,'2020-10-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,928.00000000,928.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,928.00000000,0.00000000,928.00000000,NULL,NULL,NULL),(81,'2020-12-10 12:24:22',11,NULL,'CO7001-0023',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2020-07-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,725.00000000,725.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,725.00000000,0.00000000,725.00000000,NULL,NULL,NULL),(83,'2021-04-15 10:22:31',26,NULL,'CO7001-0024',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2021-04-03',12,NULL,12,NULL,1,-1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,105.00000000,105.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,105.00000000,0.00000000,105.00000000,NULL,NULL,NULL),(84,'2020-12-10 12:24:22',2,NULL,'CO7001-0025',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2020-06-19',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,510.00000000,510.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,510.00000000,0.00000000,510.00000000,NULL,NULL,NULL),(85,'2021-04-15 10:22:31',1,NULL,'CO7001-0026',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2021-01-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,47.00000000,47.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,47.00000000,0.00000000,47.00000000,NULL,NULL,NULL),(88,'2021-04-15 10:22:31',10,NULL,'CO7001-0027',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-12-20 20:42:42',NULL,'2020-12-23',12,12,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,'This is a private note','This is a public note','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,'commande/CO7001-0027/CO7001-0027.pdf',NULL,NULL),(90,'2021-04-15 10:22:31',19,NULL,'(PROV90)',1,NULL,NULL,NULL,'2017-02-16 04:46:31',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,440.00000000,440.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000,NULL,NULL,NULL),(91,'2021-04-15 10:22:31',1,NULL,'(PROV91)',1,NULL,NULL,NULL,'2017-02-16 04:46:37',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(92,'2021-04-15 10:22:31',3,NULL,'(PROV92)',1,NULL,NULL,NULL,'2017-02-16 04:47:25',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1018.00000000,1018.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000,NULL,NULL,NULL),(93,'2020-12-10 12:24:22',10,NULL,'(PROV93)',1,NULL,NULL,NULL,'2019-09-27 19:32:53',NULL,NULL,'2020-09-27',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'commande/(PROV93)/(PROV93).pdf',NULL,NULL),(94,'2021-04-15 10:22:31',1,NULL,'(PROV94)',1,NULL,NULL,NULL,'2019-12-20 20:49:54',NULL,NULL,'2020-12-20',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(95,'2021-04-15 10:22:31',1,NULL,'(PROV95)',1,NULL,NULL,NULL,'2019-12-20 20:50:23',NULL,NULL,'2020-12-20',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(96,'2021-04-15 10:22:31',10,6,'(PROV96)',1,NULL,NULL,NULL,'2020-01-07 23:39:09',NULL,NULL,'2021-01-07',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'aaa','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,NULL,NULL,NULL),(97,'2021-04-15 10:22:31',10,6,'(PROV97)',1,NULL,NULL,NULL,'2020-01-07 23:43:06',NULL,NULL,'2021-01-07',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'aaa','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,NULL,NULL,NULL),(98,'2021-04-15 10:22:31',1,NULL,'(PROV98)',1,NULL,NULL,NULL,'2020-01-19 14:22:34',NULL,NULL,'2021-01-19',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.45000000,0.45000000,3.00000000,3.90000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,3.00000000,0.00000000,3.90000000,NULL,NULL,NULL),(99,'2021-04-15 10:22:31',1,NULL,'(PROV99)',1,NULL,NULL,NULL,'2020-01-19 14:24:27',NULL,NULL,'2021-01-19',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.24000000,0.00000000,0.00000000,4.00000000,4.24000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,4.00000000,0.24000000,4.24000000,NULL,NULL,NULL); +INSERT INTO `llx_commande` VALUES (1,'2020-12-10 12:24:22',1,NULL,'CO1107-0002',1,NULL,NULL,'','2013-07-20 15:23:12','2020-08-08 13:59:09',NULL,'2020-07-20',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,1,1,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(2,'2020-12-10 12:24:22',1,NULL,'CO1107-0003',1,NULL,NULL,'','2013-07-20 23:20:12','2020-02-12 17:06:51',NULL,'2020-07-21',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,0,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(3,'2020-12-10 12:24:22',1,NULL,'CO1107-0004',1,NULL,NULL,'','2013-07-20 23:22:53','2020-02-17 18:27:56',NULL,'2020-07-21',1,NULL,1,NULL,NULL,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,30.00000000,30.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(5,'2020-12-10 12:24:22',1,NULL,'CO1108-0001',1,NULL,NULL,'','2013-08-08 03:04:11','2020-08-08 03:04:21',NULL,'2020-08-08',1,NULL,1,NULL,NULL,2,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(6,'2021-04-15 10:22:31',19,NULL,'(PROV6)',1,NULL,NULL,'','2015-02-17 16:22:14',NULL,NULL,'2021-02-17',1,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','einstein',0,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,'commande/(PROV6)/(PROV6).pdf',NULL,NULL),(17,'2021-07-11 17:49:28',4,NULL,'CO7001-0005',1,NULL,NULL,NULL,'2017-02-15 23:50:34','2020-02-15 23:50:34',NULL,'2021-05-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,509.00000000,509.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,509.00000000,0.00000000,509.00000000,NULL,NULL,NULL),(18,'2021-04-15 10:22:31',7,4,'CO7001-0006',1,NULL,NULL,NULL,'2017-02-15 23:51:23','2021-02-15 23:51:23',NULL,'2021-02-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,900.00000000,900.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000,NULL,NULL,NULL),(20,'2021-04-15 10:22:31',4,NULL,'CO7001-0007',1,NULL,NULL,NULL,'2017-02-15 23:55:52','2020-02-15 23:55:52',NULL,'2021-04-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,330.00000000,330.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,330.00000000,0.00000000,330.00000000,NULL,NULL,NULL),(29,'2021-04-15 10:22:31',4,NULL,'CO7001-0008',1,NULL,NULL,NULL,'2017-02-16 00:03:44','2021-02-16 00:03:44',NULL,'2021-02-12',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,457.00000000,457.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,457.00000000,0.00000000,457.00000000,NULL,NULL,NULL),(34,'2021-04-15 10:22:31',11,NULL,'CO7001-0009',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2021-02-16 00:05:01',NULL,'2021-01-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,124.00000000,124.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,124.00000000,0.00000000,124.00000000,NULL,NULL,NULL),(38,'2021-04-15 10:22:31',3,NULL,'CO7001-0010',1,NULL,NULL,NULL,'2017-02-16 00:05:01','2021-02-16 00:05:01',NULL,'2021-02-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000,NULL,NULL,NULL),(40,'2021-04-15 10:22:31',11,NULL,'CO7001-0011',1,NULL,NULL,NULL,'2017-02-16 00:05:10','2021-02-16 00:05:11',NULL,'2021-01-23',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1210.00000000,1210.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1210.00000000,0.00000000,1210.00000000,NULL,NULL,NULL),(43,'2021-04-15 10:22:31',10,NULL,'CO7001-0012',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2021-02-16 00:05:11',NULL,'2021-02-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,478.00000000,478.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,478.00000000,0.00000000,478.00000000,NULL,NULL,NULL),(47,'2020-12-10 12:24:22',1,NULL,'CO7001-0013',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2020-02-16 00:05:11',NULL,'2020-11-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,55.00000000,55.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,55.00000000,0.00000000,55.00000000,NULL,NULL,NULL),(48,'2020-12-10 12:24:22',4,NULL,'CO7001-0014',1,NULL,NULL,NULL,'2017-02-16 00:05:11','2020-02-16 00:05:11',NULL,'2020-07-30',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,540.00000000,540.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,540.00000000,0.00000000,540.00000000,NULL,NULL,NULL),(50,'2021-04-15 10:22:31',1,NULL,'CO7001-0015',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2021-02-16 00:05:26',NULL,'2020-12-12',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,118.00000000,118.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,118.00000000,0.00000000,118.00000000,NULL,NULL,NULL),(54,'2021-07-11 17:49:28',12,NULL,'CO7001-0016',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2020-02-16 00:05:26','2020-02-16 03:05:56','2021-06-03',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,220.00000000,220.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,220.00000000,0.00000000,220.00000000,NULL,NULL,NULL),(58,'2020-12-10 12:24:22',1,NULL,'CO7001-0017',1,NULL,NULL,NULL,'2017-02-16 00:05:26','2020-02-16 00:05:26',NULL,'2020-07-23',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,436.00000000,436.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,436.00000000,0.00000000,436.00000000,NULL,NULL,NULL),(62,'2021-04-15 10:22:31',19,NULL,'CO7001-0018',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2020-02-16 00:05:35','2020-12-20 20:48:55','2021-02-23',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,410.00000000,0.00000000,410.00000000,NULL,NULL,NULL),(68,'2021-07-11 17:49:28',3,NULL,'CO7001-0019',1,NULL,NULL,NULL,'2017-02-16 00:05:35','2020-02-16 00:05:35',NULL,'2021-05-19',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,45.00000000,45.00000000,'','','',0,NULL,NULL,NULL,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,45.00000000,0.00000000,45.00000000,NULL,NULL,NULL),(72,'2020-12-10 12:24:22',6,NULL,'CO7001-0020',1,NULL,NULL,NULL,'2017-02-16 00:05:36','2020-02-16 00:05:36','2021-01-16 02:42:56','2020-11-13',12,NULL,12,12,1,3,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,610.00000000,610.00000000,'','','',1,NULL,NULL,NULL,NULL,NULL,2,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,610.00000000,0.00000000,610.00000000,NULL,NULL,NULL),(75,'2021-04-15 10:22:31',4,NULL,'CO7001-0021',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2020-02-16 04:14:20',NULL,'2021-02-13',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,25.00000000,49.88000000,0.00000000,1200.00000000,1274.88000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,25.00000000,1274.88000000,NULL,NULL,NULL),(78,'2020-12-10 12:24:22',12,NULL,'CO7001-0022',1,NULL,NULL,NULL,'2017-02-16 00:05:37','2020-02-16 00:05:37',NULL,'2020-10-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,928.00000000,928.00000000,'','','',0,NULL,NULL,2,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,928.00000000,0.00000000,928.00000000,NULL,NULL,NULL),(81,'2021-07-11 17:49:28',11,NULL,'CO7001-0023',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2021-02-16 00:05:38',NULL,'2021-07-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,725.00000000,725.00000000,'','','',0,NULL,NULL,2,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,725.00000000,0.00000000,725.00000000,NULL,NULL,NULL),(83,'2021-04-15 10:22:31',26,NULL,'CO7001-0024',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2021-04-03',12,NULL,12,NULL,1,-1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,105.00000000,105.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,1,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,105.00000000,0.00000000,105.00000000,NULL,NULL,NULL),(84,'2021-07-11 17:49:28',2,NULL,'CO7001-0025',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2021-02-16 00:05:38',NULL,'2021-06-19',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,510.00000000,510.00000000,'','','',0,NULL,NULL,1,NULL,NULL,2,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,510.00000000,0.00000000,510.00000000,NULL,NULL,NULL),(85,'2021-04-15 10:22:31',1,NULL,'CO7001-0026',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-02-16 00:05:38',NULL,'2021-01-03',12,NULL,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,47.00000000,47.00000000,'','','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,47.00000000,0.00000000,47.00000000,NULL,NULL,NULL),(88,'2021-04-15 10:22:31',10,NULL,'CO7001-0027',1,NULL,NULL,NULL,'2017-02-16 00:05:38','2020-12-20 20:42:42',NULL,'2020-12-23',12,12,12,NULL,1,1,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,'This is a private note','This is a public note','',0,NULL,NULL,1,NULL,NULL,1,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,'commande/CO7001-0027/CO7001-0027.pdf',NULL,NULL),(90,'2021-04-15 10:22:31',19,NULL,'(PROV90)',1,NULL,NULL,NULL,'2017-02-16 04:46:31',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,440.00000000,440.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000,NULL,NULL,NULL),(91,'2021-04-15 10:22:31',1,NULL,'(PROV91)',1,NULL,NULL,NULL,'2017-02-16 04:46:37',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(92,'2021-04-15 10:22:31',3,NULL,'(PROV92)',1,NULL,NULL,NULL,'2017-02-16 04:47:25',NULL,NULL,'2021-02-16',12,NULL,NULL,NULL,NULL,0,0.00000000,0,NULL,0,0.00000000,0.00000000,0.00000000,1018.00000000,1018.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000,NULL,NULL,NULL),(93,'2020-12-10 12:24:22',10,NULL,'(PROV93)',1,NULL,NULL,NULL,'2019-09-27 19:32:53',NULL,NULL,'2020-09-27',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','einstein',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'commande/(PROV93)/(PROV93).pdf',NULL,NULL),(94,'2021-04-15 10:22:31',1,NULL,'(PROV94)',1,NULL,NULL,NULL,'2019-12-20 20:49:54',NULL,NULL,'2020-12-20',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(95,'2021-04-15 10:22:31',1,NULL,'(PROV95)',1,NULL,NULL,NULL,'2019-12-20 20:50:23',NULL,NULL,'2020-12-20',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,1000.00000000,1000.00000000,'','','',0,NULL,NULL,3,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,NULL,NULL,NULL),(96,'2021-04-15 10:22:31',10,6,'(PROV96)',1,NULL,NULL,NULL,'2020-01-07 23:39:09',NULL,NULL,'2021-01-07',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'aaa','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,NULL,NULL,NULL),(97,'2021-04-15 10:22:31',10,6,'(PROV97)',1,NULL,NULL,NULL,'2020-01-07 23:43:06',NULL,NULL,'2021-01-07',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,'aaa','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,NULL,NULL,NULL),(98,'2021-04-15 10:22:31',1,NULL,'(PROV98)',1,NULL,NULL,NULL,'2020-01-19 14:22:34',NULL,NULL,'2021-01-19',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.00000000,0.45000000,0.45000000,3.00000000,3.90000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,3.00000000,0.00000000,3.90000000,NULL,NULL,NULL),(99,'2021-04-15 10:22:31',1,NULL,'(PROV99)',1,NULL,NULL,NULL,'2020-01-19 14:24:27',NULL,NULL,'2021-01-19',12,NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,0.24000000,0.00000000,0.00000000,4.00000000,4.24000000,'','','',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,'',0,'EUR',1.00000000,4.00000000,0.24000000,4.24000000,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_commande` ENABLE KEYS */; UNLOCK TABLES; @@ -4504,7 +4305,7 @@ CREATE TABLE `llx_commande_fournisseur` ( LOCK TABLES `llx_commande_fournisseur` WRITE; /*!40000 ALTER TABLE `llx_commande_fournisseur` DISABLE KEYS */; -INSERT INTO `llx_commande_fournisseur` VALUES (1,'2021-04-15 10:22:31',13,'CF1007-0001',1,NULL,NULL,NULL,'2020-07-11 17:13:40','2021-02-01 18:51:42','2021-02-01 18:52:04',NULL,'2021-02-01',1,NULL,12,12,NULL,0,5,0,0.00000000,0,0,39.20000000,0.00000000,0.00000000,200.00000000,239.20000000,NULL,NULL,'muscadet',2,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(2,'2021-04-15 11:40:18',1,'CF1007-0002',1,NULL,NULL,NULL,'2020-07-11 18:46:28','2020-07-11 18:47:33',NULL,NULL,'2020-07-11',1,NULL,1,NULL,NULL,0,4,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,NULL,NULL,'muscadet',4,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,'2020-01-20 11:22:53',17,'(PROV3)',1,NULL,NULL,NULL,'2013-08-04 23:00:52',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,1079.17000000,1079.17000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'USD',1.20000000,1295.00000000,0.00000000,1295.00000000,NULL),(4,'2020-01-20 11:19:49',17,'(PROV4)',1,NULL,NULL,NULL,'2013-08-04 23:19:32',NULL,NULL,NULL,NULL,1,12,NULL,NULL,NULL,0,0,0,0.00000000,0,0,11.88000000,0.00000000,0.00000000,174.17000000,186.05000000,'Private note','Public note','muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'EUR',1.00000000,174.17000000,11.88000000,186.05000000,NULL),(13,'2021-04-15 10:22:31',1,'CF1303-0004',1,NULL,NULL,NULL,'2021-03-09 19:39:18','2021-03-09 19:39:27','2021-03-09 19:39:32',NULL,'2021-03-09',1,NULL,1,1,NULL,0,2,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,NULL,NULL,'muscadet',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(14,'2020-01-20 11:20:11',1,'(PROV14)',1,NULL,'',NULL,'2020-01-20 12:20:11',NULL,NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','muscadet',0,1,NULL,NULL,NULL,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL); +INSERT INTO `llx_commande_fournisseur` VALUES (1,'2021-04-15 10:22:31',13,'CF1007-0001',1,NULL,NULL,NULL,'2020-07-11 17:13:40','2021-02-01 18:51:42','2021-02-01 18:52:04',NULL,'2021-02-01',1,NULL,12,12,NULL,0,5,0,0.00000000,0,0,39.20000000,0.00000000,0.00000000,200.00000000,239.20000000,NULL,NULL,'muscadet',2,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(2,'2021-07-11 17:49:28',1,'CF1007-0002',1,NULL,NULL,NULL,'2021-07-11 18:46:28','2021-07-11 18:47:33',NULL,NULL,'2021-07-11',1,NULL,1,NULL,NULL,0,4,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,200.00000000,200.00000000,NULL,NULL,'muscadet',4,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,'2020-01-20 11:22:53',17,'(PROV3)',1,NULL,NULL,NULL,'2013-08-04 23:00:52',NULL,NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,1079.17000000,1079.17000000,NULL,NULL,'muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'USD',1.20000000,1295.00000000,0.00000000,1295.00000000,NULL),(4,'2020-01-20 11:19:49',17,'(PROV4)',1,NULL,NULL,NULL,'2013-08-04 23:19:32',NULL,NULL,NULL,NULL,1,12,NULL,NULL,NULL,0,0,0,0.00000000,0,0,11.88000000,0.00000000,0.00000000,174.17000000,186.05000000,'Private note','Public note','muscadet',0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'EUR',1.00000000,174.17000000,11.88000000,186.05000000,NULL),(13,'2021-04-15 10:22:31',1,'CF1303-0004',1,NULL,NULL,NULL,'2021-03-09 19:39:18','2021-03-09 19:39:27','2021-03-09 19:39:32',NULL,'2021-03-09',1,NULL,1,1,NULL,0,2,0,0.00000000,0,0,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,NULL,NULL,'muscadet',1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(14,'2020-01-20 11:20:11',1,'(PROV14)',1,NULL,'',NULL,'2020-01-20 12:20:11',NULL,NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,0,NULL,0,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'','','muscadet',0,1,NULL,NULL,NULL,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL); /*!40000 ALTER TABLE `llx_commande_fournisseur` ENABLE KEYS */; UNLOCK TABLES; @@ -4690,52 +4491,6 @@ INSERT INTO `llx_commande_fournisseurdet` VALUES (1,1,NULL,NULL,'','','Chips',19 /*!40000 ALTER TABLE `llx_commande_fournisseurdet` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_commande_fournisseurdet_asset` --- - -DROP TABLE IF EXISTS `llx_commande_fournisseurdet_asset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_commande_fournisseurdet_asset` ( - `rowid` int(11) NOT NULL DEFAULT 0, - `date_cre` datetime DEFAULT NULL, - `date_maj` datetime DEFAULT NULL, - `fk_commandedet` int(11) NOT NULL DEFAULT 0, - `fk_product` int(11) NOT NULL DEFAULT 0, - `fk_warehouse` int(11) NOT NULL DEFAULT 0, - `rang` int(11) NOT NULL DEFAULT 0, - `lot_number` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `carton` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `numerosuivi` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `imei` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `firmware` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `serial_number` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `weight` double NOT NULL DEFAULT 0, - `weight_reel` double NOT NULL DEFAULT 0, - `tare` double NOT NULL DEFAULT 0, - `dluo` datetime DEFAULT NULL, - `weight_unit` int(11) NOT NULL DEFAULT 0, - `weight_reel_unit` int(11) NOT NULL DEFAULT 0, - `tare_unit` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rowid`), - KEY `date_cre` (`date_cre`), - KEY `date_maj` (`date_maj`), - KEY `fk_commandedet` (`fk_commandedet`), - KEY `fk_product` (`fk_product`), - KEY `fk_warehouse` (`fk_warehouse`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_commande_fournisseurdet_asset` --- - -LOCK TABLES `llx_commande_fournisseurdet_asset` WRITE; -/*!40000 ALTER TABLE `llx_commande_fournisseurdet_asset` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_commande_fournisseurdet_asset` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_commande_fournisseurdet_extrafields` -- @@ -4889,37 +4644,6 @@ LOCK TABLES `llx_comment` WRITE; /*!40000 ALTER TABLE `llx_comment` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_cond_reglement` --- - -DROP TABLE IF EXISTS `llx_cond_reglement`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_cond_reglement` ( - `rowid` int(11) NOT NULL, - `code` varchar(16) COLLATE utf8_unicode_ci DEFAULT NULL, - `sortorder` smallint(6) DEFAULT NULL, - `active` tinyint(4) DEFAULT 1, - `libelle` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `libelle_facture` text COLLATE utf8_unicode_ci DEFAULT NULL, - `fdm` tinyint(4) DEFAULT NULL, - `nbjour` smallint(6) DEFAULT NULL, - `decalage` smallint(6) DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_cond_reglement` --- - -LOCK TABLES `llx_cond_reglement` WRITE; -/*!40000 ALTER TABLE `llx_cond_reglement` DISABLE KEYS */; -INSERT INTO `llx_cond_reglement` VALUES (1,'RECEP',1,1,'A réception','Réception de facture',0,0,NULL),(2,'30D',2,1,'30 jours','Réglement à 30 jours',0,30,NULL),(3,'30DENDMONTH',3,1,'30 jours fin de mois','Réglement à 30 jours fin de mois',1,30,NULL),(4,'60D',4,1,'60 jours','Réglement à 60 jours',0,60,NULL),(5,'60DENDMONTH',5,1,'60 jours fin de mois','Réglement à 60 jours fin de mois',1,60,NULL); -/*!40000 ALTER TABLE `llx_cond_reglement` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_const` -- @@ -4938,7 +4662,7 @@ CREATE TABLE `llx_const` ( `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`rowid`), UNIQUE KEY `uk_const` (`name`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=8878 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=8943 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -4947,7 +4671,7 @@ CREATE TABLE `llx_const` ( LOCK TABLES `llx_const` WRITE; /*!40000 ALTER TABLE `llx_const` DISABLE KEYS */; -INSERT INTO `llx_const` VALUES (8,'MAIN_UPLOAD_DOC',0,'2048','chaine',0,'Max size for file upload (0 means no upload allowed)','2012-07-08 11:17:57'),(9,'MAIN_SEARCHFORM_SOCIETE',0,'1','yesno',0,'Show form for quick company search','2012-07-08 11:17:57'),(10,'MAIN_SEARCHFORM_CONTACT',0,'1','yesno',0,'Show form for quick contact search','2012-07-08 11:17:57'),(11,'MAIN_SEARCHFORM_PRODUITSERVICE',0,'1','yesno',0,'Show form for quick product search','2012-07-08 11:17:58'),(12,'MAIN_SEARCHFORM_ADHERENT',0,'1','yesno',0,'Show form for quick member search','2012-07-08 11:17:58'),(16,'MAIN_SIZE_LISTE_LIMIT',0,'25','chaine',0,'Longueur maximum des listes','2012-07-08 11:17:58'),(29,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',1,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-07-08 11:17:58'),(33,'SOCIETE_NOLIST_COURRIER',0,'1','yesno',0,'Liste les fichiers du repertoire courrier','2012-07-08 11:17:58'),(36,'ADHERENT_MAIL_REQUIRED',1,'1','yesno',0,'EMail required to create a new member','2012-07-08 11:17:58'),(37,'ADHERENT_MAIL_FROM',1,'adherents@domain.com','chaine',0,'Sender EMail for automatic emails','2012-07-08 11:17:58'),(38,'ADHERENT_MAIL_RESIL',1,'Your subscription has been resiliated.\r\nWe hope to see you soon again','html',0,'Mail resiliation','2018-11-23 11:56:07'),(39,'ADHERENT_MAIL_VALID',1,'Your subscription has been validated.\r\nThis is a remind of your personal information :\r\n\r\n%INFOS%\r\n\r\n','html',0,'Mail de validation','2018-11-23 11:56:07'),(40,'ADHERENT_MAIL_COTIS',1,'Hello %PRENOM%,\r\nThanks for your subscription.\r\nThis email confirms that your subscription has been received and processed.\r\n\r\n','html',0,'Mail de validation de cotisation','2018-11-23 11:56:07'),(41,'ADHERENT_MAIL_VALID_SUBJECT',1,'Your subscription has been validated','chaine',0,'Sujet du mail de validation','2012-07-08 11:17:59'),(42,'ADHERENT_MAIL_RESIL_SUBJECT',1,'Resiliating your subscription','chaine',0,'Sujet du mail de resiliation','2012-07-08 11:17:59'),(43,'ADHERENT_MAIL_COTIS_SUBJECT',1,'Receipt of your subscription','chaine',0,'Sujet du mail de validation de cotisation','2012-07-08 11:17:59'),(44,'MAILING_EMAIL_FROM',1,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-07-08 11:17:59'),(45,'ADHERENT_USE_MAILMAN',1,'0','yesno',0,'Utilisation de Mailman','2012-07-08 11:17:59'),(46,'ADHERENT_MAILMAN_UNSUB_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%','chaine',0,'Url de desinscription aux listes mailman','2012-07-08 11:17:59'),(47,'ADHERENT_MAILMAN_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine',0,'Url pour les inscriptions mailman','2012-07-08 11:17:59'),(48,'ADHERENT_MAILMAN_LISTS',1,'test-test,test-test2','chaine',0,'Listes auxquelles inscrire les nouveaux adherents','2012-07-08 11:17:59'),(49,'ADHERENT_MAILMAN_ADMINPW',1,'','chaine',0,'Mot de passe Admin des liste mailman','2012-07-08 11:17:59'),(50,'ADHERENT_MAILMAN_SERVER',1,'lists.domain.com','chaine',0,'Serveur hebergeant les interfaces d Admin des listes mailman','2012-07-08 11:17:59'),(51,'ADHERENT_MAILMAN_LISTS_COTISANT',1,'','chaine',0,'Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement','2012-07-08 11:17:59'),(52,'ADHERENT_USE_SPIP',1,'0','yesno',0,'Utilisation de SPIP ?','2012-07-08 11:17:59'),(53,'ADHERENT_USE_SPIP_AUTO',1,'0','yesno',0,'Utilisation de SPIP automatiquement','2012-07-08 11:17:59'),(54,'ADHERENT_SPIP_USER',1,'user','chaine',0,'user spip','2012-07-08 11:17:59'),(55,'ADHERENT_SPIP_PASS',1,'pass','chaine',0,'Pass de connection','2012-07-08 11:17:59'),(56,'ADHERENT_SPIP_SERVEUR',1,'localhost','chaine',0,'serveur spip','2012-07-08 11:17:59'),(57,'ADHERENT_SPIP_DB',1,'spip','chaine',0,'db spip','2012-07-08 11:17:59'),(58,'ADHERENT_CARD_HEADER_TEXT',1,'%ANNEE%','chaine',0,'Texte imprime sur le haut de la carte adherent','2012-07-08 11:17:59'),(59,'ADHERENT_CARD_FOOTER_TEXT',1,'Association AZERTY','chaine',0,'Texte imprime sur le bas de la carte adherent','2012-07-08 11:17:59'),(61,'FCKEDITOR_ENABLE_USER',1,'1','yesno',0,'Activation fckeditor sur notes utilisateurs','2012-07-08 11:17:59'),(62,'FCKEDITOR_ENABLE_SOCIETE',1,'1','yesno',0,'Activation fckeditor sur notes societe','2012-07-08 11:17:59'),(63,'FCKEDITOR_ENABLE_PRODUCTDESC',1,'1','yesno',0,'Activation fckeditor sur notes produits','2012-07-08 11:17:59'),(64,'FCKEDITOR_ENABLE_MEMBER',1,'1','yesno',0,'Activation fckeditor sur notes adherent','2012-07-08 11:17:59'),(65,'FCKEDITOR_ENABLE_MAILING',1,'1','yesno',0,'Activation fckeditor sur emailing','2012-07-08 11:17:59'),(67,'DON_ADDON_MODEL',1,'html_cerfafr','chaine',0,'','2012-07-08 11:18:00'),(68,'PROPALE_ADDON',1,'mod_propale_marbre','chaine',0,'','2012-07-08 11:18:00'),(69,'PROPALE_ADDON_PDF',1,'azur','chaine',0,'','2012-07-08 11:18:00'),(70,'COMMANDE_ADDON',1,'mod_commande_marbre','chaine',0,'','2012-07-08 11:18:00'),(71,'COMMANDE_ADDON_PDF',1,'einstein','chaine',0,'','2012-07-08 11:18:00'),(72,'COMMANDE_SUPPLIER_ADDON',1,'mod_commande_fournisseur_muguet','chaine',0,'','2012-07-08 11:18:00'),(73,'COMMANDE_SUPPLIER_ADDON_PDF',1,'muscadet','chaine',0,'','2012-07-08 11:18:00'),(74,'EXPEDITION_ADDON',1,'enlevement','chaine',0,'','2012-07-08 11:18:00'),(76,'FICHEINTER_ADDON',1,'pacific','chaine',0,'','2012-07-08 11:18:00'),(77,'FICHEINTER_ADDON_PDF',1,'soleil','chaine',0,'','2012-07-08 11:18:00'),(79,'FACTURE_ADDON_PDF',1,'crabe','chaine',0,'','2012-07-08 11:18:00'),(80,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'Durée de validitée des propales','2012-07-08 11:18:00'),(230,'COMPANY_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2012-07-08 11:26:20'),(238,'LIVRAISON_ADDON_PDF',1,'typhon','chaine',0,'Nom du gestionnaire de generation des commandes en PDF','2012-07-08 11:26:27'),(239,'DELIVERY_ADDON_NUMBER',1,'mod_delivery_jade','chaine',0,'Nom du gestionnaire de numerotation des bons de livraison','2020-12-10 12:24:40'),(245,'FACTURE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2012-07-08 11:28:53'),(249,'DON_FORM',1,'html_cerfafr','chaine',0,'Nom du gestionnaire de formulaire de dons','2017-09-06 16:12:22'),(254,'ADHERENT_BANK_ACCOUNT',1,'','chaine',0,'ID du Compte banquaire utilise','2012-07-08 11:29:05'),(255,'ADHERENT_BANK_CATEGORIE',1,'','chaine',0,'ID de la categorie banquaire des cotisations','2012-07-08 11:29:05'),(256,'ADHERENT_ETIQUETTE_TYPE',1,'L7163','chaine',0,'Type d etiquette (pour impression de planche d etiquette)','2012-07-08 11:29:05'),(269,'PROJECT_ADDON_PDF',1,'baleine','chaine',0,'Nom du gestionnaire de generation des projets en PDF','2012-07-08 11:29:33'),(270,'PROJECT_ADDON',1,'mod_project_simple','chaine',0,'Nom du gestionnaire de numerotation des projets','2012-07-08 11:29:33'),(369,'EXPEDITION_ADDON_PDF',1,'merou','chaine',0,'','2012-07-08 22:58:07'),(377,'FACTURE_ADDON',1,'mod_facture_terre','chaine',0,'','2012-07-08 23:08:12'),(380,'ADHERENT_CARD_TEXT',1,'%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','',0,'Texte imprime sur la carte adherent','2012-07-08 23:14:46'),(381,'ADHERENT_CARD_TEXT_RIGHT',1,'aaa','',0,'','2012-07-08 23:14:55'),(386,'STOCK_CALCULATE_ON_SHIPMENT',1,'1','chaine',0,'','2012-07-08 23:23:21'),(387,'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',1,'1','chaine',0,'','2012-07-08 23:23:26'),(392,'MAIN_AGENDA_XCAL_EXPORTKEY',1,'dolibarr','chaine',0,'','2012-07-08 23:27:50'),(393,'MAIN_AGENDA_EXPORT_PAST_DELAY',1,'100','chaine',0,'','2012-07-08 23:27:50'),(610,'CASHDESK_ID_THIRDPARTY',1,'7','chaine',0,'','2012-07-11 17:08:18'),(611,'CASHDESK_ID_BANKACCOUNT_CASH',1,'3','chaine',0,'','2012-07-11 17:08:18'),(612,'CASHDESK_ID_BANKACCOUNT_CHEQUE',1,'1','chaine',0,'','2012-07-11 17:08:18'),(613,'CASHDESK_ID_BANKACCOUNT_CB',1,'1','chaine',0,'','2012-07-11 17:08:18'),(614,'CASHDESK_ID_WAREHOUSE',1,'2','chaine',0,'','2012-07-11 17:08:18'),(660,'LDAP_USER_DN',1,'ou=users,dc=my-domain,dc=com','chaine',0,NULL,'2012-07-18 10:25:27'),(661,'LDAP_GROUP_DN',1,'ou=groups,dc=my-domain,dc=com','chaine',0,NULL,'2012-07-18 10:25:27'),(662,'LDAP_FILTER_CONNECTION',1,'&(objectClass=user)(objectCategory=person)','chaine',0,NULL,'2012-07-18 10:25:27'),(663,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2012-07-18 10:25:27'),(664,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2012-07-18 10:25:27'),(665,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2012-07-18 10:25:27'),(666,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2012-07-18 10:25:27'),(667,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2012-07-18 10:25:27'),(668,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2012-07-18 10:25:27'),(669,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2012-07-18 10:25:27'),(670,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2012-07-18 10:25:27'),(671,'LDAP_SERVER_TYPE',1,'openldap','chaine',0,'','2012-07-18 10:25:46'),(672,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',0,'','2012-07-18 10:25:47'),(673,'LDAP_SERVER_HOST',1,'localhost','chaine',0,'','2012-07-18 10:25:47'),(674,'LDAP_SERVER_PORT',1,'389','chaine',0,'','2012-07-18 10:25:47'),(675,'LDAP_SERVER_USE_TLS',1,'0','chaine',0,'','2012-07-18 10:25:47'),(676,'LDAP_SYNCHRO_ACTIVE',1,'dolibarr2ldap','chaine',0,'','2012-07-18 10:25:47'),(677,'LDAP_CONTACT_ACTIVE',1,'1','chaine',0,'','2012-07-18 10:25:47'),(678,'LDAP_MEMBER_ACTIVE',1,'1','chaine',0,'','2012-07-18 10:25:47'),(974,'MAIN_MODULE_WORKFLOW_TRIGGERS',1,'1','chaine',0,NULL,'2013-07-18 18:02:20'),(975,'WORKFLOW_PROPAL_AUTOCREATE_ORDER',1,'1','chaine',0,'','2013-07-18 18:02:24'),(980,'PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR',1,'1234567','chaine',0,'','2013-07-18 18:05:50'),(983,'FACTURE_RIB_NUMBER',1,'1','chaine',0,'','2013-07-18 18:35:14'),(984,'FACTURE_CHQ_NUMBER',1,'1','chaine',0,'','2013-07-18 18:35:14'),(1016,'GOOGLE_DUPLICATE_INTO_GCAL',1,'1','chaine',0,'','2013-07-18 21:40:20'),(1152,'SOCIETE_CODECLIENT_ADDON',1,'mod_codeclient_monkey','chaine',0,'','2013-07-29 20:50:02'),(1240,'MAIN_LOGEVENTS_USER_LOGIN',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1241,'MAIN_LOGEVENTS_USER_LOGIN_FAILED',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1242,'MAIN_LOGEVENTS_USER_LOGOUT',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1243,'MAIN_LOGEVENTS_USER_CREATE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1244,'MAIN_LOGEVENTS_USER_MODIFY',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1245,'MAIN_LOGEVENTS_USER_NEW_PASSWORD',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1246,'MAIN_LOGEVENTS_USER_ENABLEDISABLE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1247,'MAIN_LOGEVENTS_USER_DELETE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1248,'MAIN_LOGEVENTS_GROUP_CREATE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1249,'MAIN_LOGEVENTS_GROUP_MODIFY',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1250,'MAIN_LOGEVENTS_GROUP_DELETE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1251,'MAIN_BOXES_MAXLINES',1,'5','',0,'','2013-07-29 21:05:42'),(1482,'EXPEDITION_ADDON_NUMBER',1,'mod_expedition_safor','chaine',0,'Nom du gestionnaire de numerotation des expeditions','2013-08-05 17:53:11'),(1490,'CONTRACT_ADDON',1,'mod_contract_serpis','chaine',0,'Nom du gestionnaire de numerotation des contrats','2013-08-05 18:11:58'),(1677,'COMMANDE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/orders','chaine',0,NULL,'2014-12-08 13:11:02'),(1724,'PROPALE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2014-12-08 13:17:14'),(1730,'OPENSTREETMAP_ENABLE_MAPS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1731,'OPENSTREETMAP_ENABLE_MAPS_CONTACTS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1732,'OPENSTREETMAP_ENABLE_MAPS_MEMBERS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1733,'OPENSTREETMAP_MAPS_ZOOM_LEVEL',1,'15','chaine',0,'','2014-12-08 13:22:47'),(1742,'MAIN_MAIL_EMAIL_FROM',2,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2014-12-08 14:08:14'),(1743,'MAIN_MENU_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2015-02-11 19:43:54'),(1744,'MAIN_MENUFRONT_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2015-02-11 19:43:54'),(1745,'MAIN_MENU_SMARTPHONE',2,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2014-12-08 14:08:14'),(1746,'MAIN_MENUFRONT_SMARTPHONE',2,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2014-12-08 14:08:14'),(1747,'MAIN_THEME',2,'eldy','chaine',0,'Default theme','2014-12-08 14:08:14'),(1748,'MAIN_DELAY_ACTIONS_TODO',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2014-12-08 14:08:14'),(1749,'MAIN_DELAY_ORDERS_TO_PROCESS',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2014-12-08 14:08:14'),(1750,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2014-12-08 14:08:14'),(1751,'MAIN_DELAY_PROPALS_TO_CLOSE',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2014-12-08 14:08:14'),(1752,'MAIN_DELAY_PROPALS_TO_BILL',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2014-12-08 14:08:14'),(1753,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2014-12-08 14:08:14'),(1754,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2014-12-08 14:08:14'),(1755,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2014-12-08 14:08:14'),(1756,'MAIN_DELAY_RUNNING_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2014-12-08 14:08:14'),(1757,'MAIN_DELAY_MEMBERS',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2014-12-08 14:08:14'),(1758,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',2,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2014-12-08 14:08:14'),(1759,'MAILING_EMAIL_FROM',2,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2014-12-08 14:08:14'),(1760,'MAIN_INFO_SOCIETE_COUNTRY',3,'1:FR:France','chaine',0,'','2015-02-26 21:56:28'),(1761,'MAIN_INFO_SOCIETE_NOM',3,'bbb','chaine',0,'','2014-12-08 14:08:20'),(1762,'MAIN_INFO_SOCIETE_STATE',3,'0','chaine',0,'','2015-02-27 14:20:27'),(1763,'MAIN_MONNAIE',3,'EUR','chaine',0,'','2014-12-08 14:08:20'),(1764,'MAIN_LANG_DEFAULT',3,'auto','chaine',0,'','2014-12-08 14:08:20'),(1765,'MAIN_MAIL_EMAIL_FROM',3,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2014-12-08 14:08:20'),(1766,'MAIN_MENU_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2015-02-11 19:43:54'),(1767,'MAIN_MENUFRONT_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2015-02-11 19:43:54'),(1768,'MAIN_MENU_SMARTPHONE',3,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2014-12-08 14:08:20'),(1769,'MAIN_MENUFRONT_SMARTPHONE',3,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2014-12-08 14:08:20'),(1770,'MAIN_THEME',3,'eldy','chaine',0,'Default theme','2014-12-08 14:08:20'),(1771,'MAIN_DELAY_ACTIONS_TODO',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2014-12-08 14:08:20'),(1772,'MAIN_DELAY_ORDERS_TO_PROCESS',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2014-12-08 14:08:20'),(1773,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2014-12-08 14:08:20'),(1774,'MAIN_DELAY_PROPALS_TO_CLOSE',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2014-12-08 14:08:20'),(1775,'MAIN_DELAY_PROPALS_TO_BILL',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2014-12-08 14:08:20'),(1776,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2014-12-08 14:08:20'),(1777,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2014-12-08 14:08:20'),(1778,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2014-12-08 14:08:20'),(1779,'MAIN_DELAY_RUNNING_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2014-12-08 14:08:20'),(1780,'MAIN_DELAY_MEMBERS',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2014-12-08 14:08:20'),(1781,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',3,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2014-12-08 14:08:20'),(1782,'MAILING_EMAIL_FROM',3,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2014-12-08 14:08:20'),(1803,'SYSLOG_FILE',1,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2014-12-08 14:15:08'),(1804,'SYSLOG_HANDLERS',1,'[\"mod_syslog_file\"]','chaine',0,'','2014-12-08 14:15:08'),(1805,'MAIN_MODULE_SKINCOLOREDITOR',3,'1',NULL,0,NULL,'2014-12-08 14:35:40'),(1922,'PAYPAL_API_SANDBOX',1,'1','chaine',0,'','2014-12-12 12:11:05'),(1923,'PAYPAL_API_USER',1,'seller_1355312017_biz_api1.mydomain.com','chaine',0,'','2014-12-12 12:11:05'),(1924,'PAYPAL_API_PASSWORD',1,'1355312040','chaine',0,'','2014-12-12 12:11:05'),(1925,'PAYPAL_API_SIGNATURE',1,'ABCDEFWBzvfn0q5iNmbuiDv1y.3EAXIMWyl4C5KvDReR9HDwwAd6dQ4Q','chaine',0,'','2014-12-12 12:11:05'),(1926,'PAYPAL_API_INTEGRAL_OR_PAYPALONLY',1,'integral','chaine',0,'','2014-12-12 12:11:05'),(1927,'PAYPAL_SECURITY_TOKEN',1,'50c82fab36bb3b6aa83e2a50691803b2','chaine',0,'','2014-12-12 12:11:05'),(1928,'PAYPAL_SECURITY_TOKEN_UNIQUE',1,'0','chaine',0,'','2014-12-12 12:11:05'),(1929,'PAYPAL_ADD_PAYMENT_URL',1,'1','chaine',0,'','2014-12-12 12:11:05'),(1980,'MAIN_PDF_FORMAT',1,'EUA4','chaine',0,'','2014-12-12 19:58:05'),(1981,'MAIN_PROFID1_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1982,'MAIN_PROFID2_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1983,'MAIN_PROFID3_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1984,'MAIN_PROFID4_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1985,'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',1,'0','chaine',0,'','2014-12-12 19:58:05'),(2835,'MAIN_USE_CONNECT_TIMEOUT',1,'10','chaine',0,'','2015-01-16 19:28:50'),(2836,'MAIN_USE_RESPONSE_TIMEOUT',1,'30','chaine',0,'','2015-01-16 19:28:50'),(2837,'MAIN_PROXY_USE',1,'0','chaine',0,'','2015-01-16 19:28:50'),(2838,'MAIN_PROXY_HOST',1,'localhost','chaine',0,'','2015-01-16 19:28:50'),(2839,'MAIN_PROXY_PORT',1,'8080','chaine',0,'','2015-01-16 19:28:50'),(2840,'MAIN_PROXY_USER',1,'aaa','chaine',0,'','2015-01-16 19:28:50'),(2841,'MAIN_PROXY_PASS',1,'bbb','chaine',0,'','2015-01-16 19:28:50'),(2848,'OVHSMS_NICK',1,'BN196-OVH','chaine',0,'','2015-01-16 19:32:36'),(2849,'OVHSMS_PASS',1,'bigone-10','chaine',0,'','2015-01-16 19:32:36'),(2850,'OVHSMS_SOAPURL',1,'https://www.ovh.com/soapi/soapi-re-1.55.wsdl','chaine',0,'','2015-01-16 19:32:36'),(2854,'THEME_ELDY_RGB',1,'bfbf00','chaine',0,'','2015-01-18 10:02:53'),(2855,'THEME_ELDY_ENABLE_PERSONALIZED',1,'0','chaine',0,'','2015-01-18 10:02:55'),(2858,'MAIN_SESSION_TIMEOUT',1,'2000','chaine',0,'','2015-01-19 17:01:53'),(2867,'FACSIM_ADDON',1,'mod_facsim_alcoy','chaine',0,'','2015-01-19 17:16:25'),(2868,'POS_SERVICES',1,'0','chaine',0,'','2015-01-19 17:16:51'),(2869,'POS_USE_TICKETS',1,'1','chaine',0,'','2015-01-19 17:16:51'),(2870,'POS_MAX_TTC',1,'100','chaine',0,'','2015-01-19 17:16:51'),(3190,'MAIN_MODULE_HOLIDAY',2,'1',NULL,0,NULL,'2015-02-01 08:52:34'),(3195,'INVOICE_SUPPLIER_ADDON_PDF',1,'canelle','chaine',0,'','2015-02-10 19:50:27'),(3199,'MAIN_FORCE_RELOAD_PAGE',1,'1','chaine',0,NULL,'2015-02-12 16:22:55'),(3223,'OVH_THIRDPARTY_IMPORT',1,'2','chaine',0,'','2015-02-13 16:20:18'),(3409,'AGENDA_USE_EVENT_TYPE',1,'1','chaine',0,'','2015-02-27 18:12:24'),(3886,'MAIN_REMOVE_INSTALL_WARNING',1,'1','chaine',1,'','2015-03-02 18:32:50'),(4013,'MAIN_DELAY_ACTIONS_TODO',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4014,'MAIN_DELAY_PROPALS_TO_CLOSE',1,'31','chaine',0,'','2015-03-06 08:59:12'),(4015,'MAIN_DELAY_PROPALS_TO_BILL',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4016,'MAIN_DELAY_ORDERS_TO_PROCESS',1,'2','chaine',0,'','2015-03-06 08:59:12'),(4017,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',1,'31','chaine',0,'','2015-03-06 08:59:12'),(4018,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4019,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',1,'2','chaine',0,'','2015-03-06 08:59:12'),(4020,'MAIN_DELAY_RUNNING_SERVICES',1,'-15','chaine',0,'','2015-03-06 08:59:12'),(4021,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',1,'62','chaine',0,'','2015-03-06 08:59:13'),(4022,'MAIN_DELAY_MEMBERS',1,'31','chaine',0,'','2015-03-06 08:59:13'),(4023,'MAIN_DISABLE_METEO',1,'0','chaine',0,'','2015-03-06 08:59:13'),(4044,'ADHERENT_VAT_FOR_SUBSCRIPTIONS',1,'0','',0,'','2015-03-06 16:06:38'),(4047,'ADHERENT_BANK_USE',1,'bankviainvoice','',0,'','2015-03-06 16:12:30'),(4049,'PHPSANE_SCANIMAGE',1,'/usr/bin/scanimage','chaine',0,'','2015-03-06 21:54:13'),(4050,'PHPSANE_PNMTOJPEG',1,'/usr/bin/pnmtojpeg','chaine',0,'','2015-03-06 21:54:13'),(4051,'PHPSANE_PNMTOTIFF',1,'/usr/bin/pnmtotiff','chaine',0,'','2015-03-06 21:54:13'),(4052,'PHPSANE_OCR',1,'/usr/bin/gocr','chaine',0,'','2015-03-06 21:54:13'),(4548,'ECM_AUTO_TREE_ENABLED',1,'1','chaine',0,'','2015-03-10 15:57:21'),(4579,'MAIN_MODULE_AGENDA',2,'1',NULL,0,NULL,'2015-03-13 15:29:19'),(4580,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4581,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4582,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4583,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4584,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4585,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4586,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4587,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4588,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4589,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4590,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4591,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4592,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4593,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4594,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4688,'GOOGLE_ENABLE_AGENDA',2,'1','chaine',0,'','2015-03-13 15:36:29'),(4689,'GOOGLE_AGENDA_NAME1',2,'eldy','chaine',0,'','2015-03-13 15:36:29'),(4690,'GOOGLE_AGENDA_SRC1',2,'eldy10@mail.com','chaine',0,'','2015-03-13 15:36:29'),(4691,'GOOGLE_AGENDA_COLOR1',2,'BE6D00','chaine',0,'','2015-03-13 15:36:29'),(4692,'GOOGLE_AGENDA_COLOR2',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4693,'GOOGLE_AGENDA_COLOR3',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4694,'GOOGLE_AGENDA_COLOR4',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4695,'GOOGLE_AGENDA_COLOR5',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4696,'GOOGLE_AGENDA_TIMEZONE',2,'Europe/Paris','chaine',0,'','2015-03-13 15:36:29'),(4697,'GOOGLE_AGENDA_NB',2,'5','chaine',0,'','2015-03-13 15:36:29'),(4725,'SOCIETE_CODECLIENT_ADDON',2,'mod_codeclient_leopard','chaine',0,'Module to control third parties codes','2015-03-13 20:21:35'),(4726,'SOCIETE_CODECOMPTA_ADDON',2,'mod_codecompta_panicum','chaine',0,'Module to control third parties codes','2015-03-13 20:21:35'),(4727,'SOCIETE_FISCAL_MONTH_START',2,'','chaine',0,'Mettre le numero du mois du debut d\\\'annee fiscale, ex: 9 pour septembre','2015-03-13 20:21:35'),(4728,'MAIN_SEARCHFORM_SOCIETE',2,'1','yesno',0,'Show form for quick company search','2015-03-13 20:21:35'),(4729,'MAIN_SEARCHFORM_CONTACT',2,'1','yesno',0,'Show form for quick contact search','2015-03-13 20:21:35'),(4730,'COMPANY_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2015-03-13 20:21:35'),(4743,'MAIN_MODULE_CLICKTODIAL',2,'1',NULL,0,NULL,'2015-03-13 20:30:28'),(4744,'MAIN_MODULE_NOTIFICATION',2,'1',NULL,0,NULL,'2015-03-13 20:30:34'),(4745,'MAIN_MODULE_WEBSERVICES',2,'1',NULL,0,NULL,'2015-03-13 20:30:41'),(4746,'MAIN_MODULE_PROPALE',2,'1',NULL,0,NULL,'2015-03-13 20:32:38'),(4747,'PROPALE_ADDON_PDF',2,'azur','chaine',0,'Nom du gestionnaire de generation des propales en PDF','2015-03-13 20:32:38'),(4748,'PROPALE_ADDON',2,'mod_propale_marbre','chaine',0,'Nom du gestionnaire de numerotation des propales','2015-03-13 20:32:38'),(4749,'PROPALE_VALIDITY_DURATION',2,'15','chaine',0,'Duration of validity of business proposals','2015-03-13 20:32:38'),(4750,'PROPALE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2015-03-13 20:32:38'),(4752,'MAIN_MODULE_TAX',2,'1',NULL,0,NULL,'2015-03-13 20:32:47'),(4753,'MAIN_MODULE_DON',2,'1',NULL,0,NULL,'2015-03-13 20:32:54'),(4754,'DON_ADDON_MODEL',2,'html_cerfafr','chaine',0,'Nom du gestionnaire de generation de recu de dons','2015-03-13 20:32:54'),(4755,'POS_USE_TICKETS',2,'1','chaine',0,'','2015-03-13 20:33:09'),(4756,'POS_MAX_TTC',2,'100','chaine',0,'','2015-03-13 20:33:09'),(4757,'MAIN_MODULE_POS',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4758,'TICKET_ADDON',2,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2015-03-13 20:33:09'),(4759,'MAIN_MODULE_BANQUE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4760,'MAIN_MODULE_FACTURE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4761,'FACTURE_ADDON_PDF',2,'crabe','chaine',0,'Name of PDF model of invoice','2015-03-13 20:33:09'),(4762,'FACTURE_ADDON',2,'mod_facture_terre','chaine',0,'Name of numbering numerotation rules of invoice','2015-03-13 20:33:09'),(4763,'FACTURE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2015-03-13 20:33:09'),(4764,'MAIN_MODULE_SOCIETE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4765,'MAIN_MODULE_PRODUCT',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4766,'PRODUCT_CODEPRODUCT_ADDON',2,'mod_codeproduct_leopard','chaine',0,'Module to control product codes','2015-03-13 20:33:09'),(4767,'MAIN_SEARCHFORM_PRODUITSERVICE',2,'1','yesno',0,'Show form for quick product search','2015-03-13 20:33:09'),(4772,'FACSIM_ADDON',2,'mod_facsim_alcoy','chaine',0,'','2015-03-13 20:33:32'),(4773,'MAIN_MODULE_MAILING',2,'1',NULL,0,NULL,'2015-03-13 20:33:37'),(4774,'MAIN_MODULE_OPENSURVEY',2,'1',NULL,0,NULL,'2015-03-13 20:33:42'),(4782,'AGENDA_USE_EVENT_TYPE',2,'1','chaine',0,'','2015-03-13 20:53:36'),(4884,'AGENDA_DISABLE_EXT',2,'1','chaine',0,'','2015-03-13 22:03:40'),(4928,'COMMANDE_SUPPLIER_ADDON_NUMBER',1,'mod_commande_fournisseur_muguet','chaine',0,'Nom du gestionnaire de numerotation des commandes fournisseur','2015-03-22 09:24:29'),(4929,'INVOICE_SUPPLIER_ADDON_NUMBER',1,'mod_facture_fournisseur_cactus','chaine',0,'Nom du gestionnaire de numerotation des factures fournisseur','2015-03-22 09:24:29'),(5001,'MAIN_CRON_KEY',0,'bc54582fe30d5d4a830c6f582ec28810','chaine',0,'','2015-03-23 17:54:53'),(5009,'CRON_KEY',0,'2c2e755c20be2014098f629865598006','chaine',0,'','2015-03-23 18:06:24'),(5139,'SOCIETE_ADD_REF_IN_LIST',1,'','yesno',0,'Display customer ref into select list','2015-09-08 23:06:08'),(5150,'PROJECT_TASK_ADDON_PDF',1,'','chaine',0,'Name of PDF/ODT tasks manager class','2015-09-08 23:06:14'),(5151,'PROJECT_TASK_ADDON',1,'mod_task_simple','chaine',0,'Name of Numbering Rule task manager class','2015-09-08 23:06:14'),(5152,'PROJECT_TASK_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/tasks','chaine',0,'','2015-09-08 23:06:14'),(5239,'BOOKMARKS_SHOW_IN_MENU',1,'10','chaine',0,'','2016-03-02 15:42:26'),(5271,'DONATION_ART200',1,'','yesno',0,'Option Française - Eligibilité Art200 du CGI','2016-12-21 12:51:28'),(5272,'DONATION_ART238',1,'','yesno',0,'Option Française - Eligibilité Art238 bis du CGI','2016-12-21 12:51:28'),(5274,'DONATION_MESSAGE',1,'Thank you','chaine',0,'Message affiché sur le récépissé de versements ou dons','2016-12-21 12:51:28'),(5349,'MAIN_SEARCHFORM_CONTACT',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5351,'MAIN_SEARCHFORM_PRODUITSERVICE',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5352,'MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER',1,'0','chaine',0,'','2017-10-03 10:11:33'),(5353,'MAIN_SEARCHFORM_ADHERENT',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5354,'MAIN_SEARCHFORM_PROJECT',1,'0','chaine',0,'','2017-10-03 10:11:33'),(5394,'FCKEDITOR_ENABLE_DETAILS',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2017-11-04 15:27:44'),(5395,'FCKEDITOR_ENABLE_USERSIGN',1,'1','yesno',0,'WYSIWIG for user signature','2017-11-04 15:27:44'),(5396,'FCKEDITOR_ENABLE_MAIL',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2017-11-04 15:27:44'),(5398,'CATEGORIE_RECURSIV_ADD',1,'','yesno',0,'Affect parent categories','2017-11-04 15:27:46'),(5404,'MAIN_MODULE_CATEGORIE',1,'1',NULL,0,NULL,'2017-11-04 15:41:43'),(5415,'EXPEDITION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/shipment','chaine',0,NULL,'2017-11-15 22:38:28'),(5416,'LIVRAISON_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/delivery','chaine',0,NULL,'2017-11-15 22:38:28'),(5426,'MAIN_MODULE_PROJET',1,'1',NULL,0,NULL,'2017-11-15 22:38:44'),(5427,'PROJECT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/projects','chaine',0,NULL,'2017-11-15 22:38:44'),(5428,'PROJECT_USE_OPPORTUNIES',1,'1','chaine',0,NULL,'2017-11-15 22:38:44'),(5430,'MAIN_MODULE_EXPORT',1,'1',NULL,0,NULL,'2017-11-15 22:38:56'),(5431,'MAIN_MODULE_IMPORT',1,'1',NULL,0,NULL,'2017-11-15 22:38:58'),(5432,'MAIN_MODULE_MAILING',1,'1',NULL,0,NULL,'2017-11-15 22:39:00'),(5434,'EXPENSEREPORT_ADDON_PDF',1,'standard','chaine',0,'Name of manager to build PDF expense reports documents','2017-11-15 22:39:05'),(5437,'SALARIES_ACCOUNTING_ACCOUNT_CHARGE',1,'641','chaine',0,NULL,'2017-11-15 22:39:08'),(5441,'ADHERENT_ETIQUETTE_TEXT',1,'%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%','text',0,'Text to print on member address sheets','2018-11-23 11:56:07'),(5443,'MAIN_MODULE_PRELEVEMENT',1,'1',NULL,0,NULL,'2017-11-15 22:39:33'),(5453,'MAIN_MODULE_CONTRAT',1,'1',NULL,0,NULL,'2017-11-15 22:39:52'),(5455,'MAIN_MODULE_FICHEINTER',1,'1',NULL,0,NULL,'2017-11-15 22:39:56'),(5459,'MAIN_MODULE_PAYPAL',1,'1',NULL,0,NULL,'2017-11-15 22:41:02'),(5463,'MAIN_MODULE_PROPALE',1,'1',NULL,0,NULL,'2017-11-15 22:41:47'),(5483,'GENBARCODE_BARCODETYPE_THIRDPARTY',1,'6','chaine',0,'','2018-01-16 15:49:43'),(5484,'PRODUIT_DEFAULT_BARCODE_TYPE',1,'2','chaine',0,'','2018-01-16 15:49:46'),(5586,'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',1,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur les notes de frais impayées','2018-01-22 17:28:18'),(5587,'MAIN_FIX_FOR_BUGGED_MTA',1,'1','chaine',1,'Set constant to fix email ending from PHP with some linux ike system','2018-01-22 17:28:18'),(5590,'MAIN_VERSION_LAST_INSTALL',0,'3.8.3','chaine',0,'Dolibarr version when install','2018-01-22 17:28:42'),(5604,'MAIN_INFO_SOCIETE_LOGO',1,'mybigcompany.png','chaine',0,'','2018-01-22 17:33:49'),(5605,'MAIN_INFO_SOCIETE_LOGO_SMALL',1,'mybigcompany_small.png','chaine',0,'','2018-01-22 17:33:49'),(5606,'MAIN_INFO_SOCIETE_LOGO_MINI',1,'mybigcompany_mini.png','chaine',0,'','2018-01-22 17:33:49'),(5614,'MAIN_SIZE_SHORTLISTE_LIMIT',1,'4','chaine',0,'Longueur maximum des listes courtes (fiche client)','2018-03-13 10:54:46'),(5627,'SUPPLIER_PROPOSAL_ADDON_PDF',1,'aurore','chaine',0,'Name of submodule to generate PDF for supplier quotation request','2018-07-30 11:13:20'),(5628,'SUPPLIER_PROPOSAL_ADDON',1,'mod_supplier_proposal_marbre','chaine',0,'Name of submodule to number supplier quotation request','2018-07-30 11:13:20'),(5629,'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/supplier_proposal','chaine',0,NULL,'2018-07-30 11:13:20'),(5633,'MAIN_MODULE_API',1,'1',NULL,0,NULL,'2018-07-30 11:13:54'),(5634,'MAIN_MODULE_WEBSERVICES',1,'1',NULL,0,NULL,'2018-07-30 11:13:56'),(5635,'WEBSERVICES_KEY',1,'dolibarrkey','chaine',0,'','2018-07-30 11:14:04'),(5638,'MAIN_MODULE_EXTERNALRSS',1,'1',NULL,0,NULL,'2018-07-30 11:15:04'),(5642,'SOCIETE_CODECOMPTA_ADDON',1,'mod_codecompta_aquarium','chaine',0,'','2018-07-30 11:16:42'),(5707,'CASHDESK_NO_DECREASE_STOCK',1,'1','chaine',0,'','2018-07-30 13:38:11'),(5708,'MAIN_MODULE_PRODUCTBATCH',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5710,'MAIN_MODULE_STOCK',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5711,'MAIN_MODULE_PRODUCT',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5808,'MARGIN_TYPE',1,'costprice','chaine',0,'','2018-07-30 16:32:18'),(5809,'DISPLAY_MARGIN_RATES',1,'1','chaine',0,'','2018-07-30 16:32:20'),(5833,'ACCOUNTING_EXPORT_SEPARATORCSV',1,',','string',0,NULL,'2017-01-29 15:11:56'),(5840,'CHARTOFACCOUNTS',1,'2','chaine',0,NULL,'2017-01-29 15:11:56'),(5841,'ACCOUNTING_EXPORT_MODELCSV',1,'1','chaine',0,NULL,'2017-01-29 15:11:56'),(5842,'ACCOUNTING_LENGTH_GACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5843,'ACCOUNTING_LENGTH_AACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5844,'ACCOUNTING_LIST_SORT_VENTILATION_TODO',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5845,'ACCOUNTING_LIST_SORT_VENTILATION_DONE',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5846,'ACCOUNTING_EXPORT_DATE',1,'%d%m%Y','chaine',0,NULL,'2017-01-29 15:11:56'),(5848,'ACCOUNTING_EXPORT_FORMAT',1,'csv','chaine',0,NULL,'2017-01-29 15:11:56'),(5853,'MAIN_MODULE_WORKFLOW',1,'1',NULL,0,NULL,'2017-01-29 15:12:12'),(5854,'MAIN_MODULE_NOTIFICATION',1,'1',NULL,0,NULL,'2017-01-29 15:12:35'),(5855,'MAIN_MODULE_OAUTH',1,'1',NULL,0,NULL,'2017-01-29 15:12:41'),(5883,'MAILING_LIMIT_SENDBYWEB',0,'15','chaine',1,'Number of targets to defined packet size when sending mass email','2017-01-29 17:36:33'),(5884,'MAIN_MAIL_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5885,'MAIN_SOAP_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5925,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5931,'DATABASE_PWD_ENCRYPTED',1,'1','chaine',0,'','2017-02-01 15:06:04'),(5932,'MAIN_DISABLE_ALL_MAILS',1,'0','chaine',0,'','2017-02-01 15:09:09'),(5933,'MAIN_MAIL_SENDMODE',1,'mail','chaine',0,'','2017-02-01 15:09:09'),(5934,'MAIN_MAIL_SMTP_PORT',1,'465','chaine',0,'','2017-02-01 15:09:09'),(5935,'MAIN_MAIL_SMTP_SERVER',1,'smtp.mail.com','chaine',0,'','2017-02-01 15:09:09'),(5936,'MAIN_MAIL_SMTPS_ID',1,'eldy10@mail.com','chaine',0,'','2017-02-01 15:09:09'),(5937,'MAIN_MAIL_SMTPS_PW',1,'bidonge','chaine',0,'','2017-02-01 15:09:09'),(5938,'MAIN_MAIL_EMAIL_FROM',1,'robot@example.com','chaine',0,'','2017-02-01 15:09:09'),(5939,'MAIN_MAIL_DEFAULT_FROMTYPE',1,'user','chaine',0,'','2017-02-01 15:09:09'),(5940,'PRELEVEMENT_ID_BANKACCOUNT',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5941,'PRELEVEMENT_ICS',1,'ICS123456','chaine',0,'','2017-02-06 04:04:47'),(5942,'PRELEVEMENT_USER',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5943,'BANKADDON_PDF',1,'sepamandate','chaine',0,'','2017-02-06 04:13:52'),(5947,'CHEQUERECEIPTS_THYME_MASK',1,'CHK{yy}{mm}-{0000@1}','chaine',0,'','2017-02-06 04:16:27'),(5948,'MAIN_MODULE_LOAN',1,'1',NULL,0,NULL,'2017-02-06 19:19:05'),(5954,'MAIN_SUBMODULE_EXPEDITION',1,'1','chaine',0,'','2017-02-06 23:57:37'),(5964,'MAIN_MODULE_TAX',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(6019,'MAIN_INFO_SOCIETE_COUNTRY',2,'1:FR:France','chaine',0,'','2017-02-15 17:18:22'),(6020,'MAIN_INFO_SOCIETE_NOM',2,'MySecondCompany','chaine',0,'','2017-02-15 17:18:22'),(6021,'MAIN_INFO_SOCIETE_STATE',2,'0','chaine',0,'','2017-02-15 17:18:22'),(6022,'MAIN_MONNAIE',2,'EUR','chaine',0,'','2017-02-15 17:18:22'),(6023,'MAIN_LANG_DEFAULT',2,'auto','chaine',0,'','2017-02-15 17:18:22'),(6032,'MAIN_MODULE_MULTICURRENCY',1,'1',NULL,0,NULL,'2017-02-15 17:29:59'),(6048,'SYSLOG_FACILITY',0,'LOG_USER','chaine',0,'','2017-02-15 22:37:01'),(6049,'SYSLOG_FIREPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/firephp/firephp-core/lib/','chaine',0,'','2017-02-15 22:37:01'),(6050,'SYSLOG_FILE',0,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2017-02-15 22:37:01'),(6051,'SYSLOG_CHROMEPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/ccampbell/chromephp/','chaine',0,'','2017-02-15 22:37:01'),(6052,'SYSLOG_HANDLERS',0,'[\"mod_syslog_file\"]','chaine',0,'','2017-02-15 22:37:01'),(6092,'MAIN_SIZE_SHORTLIST_LIMIT',0,'3','chaine',0,'Max length for small lists (tabs)','2017-05-12 09:02:38'),(6099,'MAIN_MODULE_SKYPE',1,'1',NULL,0,NULL,'2017-05-12 09:03:51'),(6100,'MAIN_MODULE_GRAVATAR',1,'1',NULL,0,NULL,'2017-05-12 09:03:54'),(6102,'PRODUCT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/products','chaine',0,'','2017-08-27 13:29:07'),(6103,'CONTRACT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/contracts','chaine',0,'','2017-08-27 13:29:07'),(6104,'USERGROUP_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/usergroups','chaine',0,'','2017-08-27 13:29:07'),(6105,'USER_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/users','chaine',0,'','2017-08-27 13:29:07'),(6106,'MAIN_ENABLE_OVERWRITE_TRANSLATION',1,'1','chaine',0,'Enable overwrote of translation','2017-08-27 13:29:07'),(6377,'COMMANDE_SAPHIR_MASK',1,'{yy}{mm}{000}{ttt}','chaine',0,'','2017-09-06 07:56:25'),(6518,'GOOGLE_DUPLICATE_INTO_THIRDPARTIES',1,'1','chaine',0,'','2017-09-06 19:43:57'),(6519,'GOOGLE_DUPLICATE_INTO_CONTACTS',1,'0','chaine',0,'','2017-09-06 19:43:57'),(6520,'GOOGLE_TAG_PREFIX',1,'Dolibarr (Thirdparties)','chaine',0,'','2017-09-06 19:43:57'),(6521,'GOOGLE_TAG_PREFIX_CONTACTS',1,'Dolibarr (Contacts/Addresses)','chaine',0,'','2017-09-06 19:43:57'),(6522,'GOOGLE_ENABLE_AGENDA',1,'1','chaine',0,'','2017-09-06 19:44:12'),(6523,'GOOGLE_AGENDA_COLOR1',1,'1B887A','chaine',0,'','2017-09-06 19:44:12'),(6524,'GOOGLE_AGENDA_COLOR2',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6525,'GOOGLE_AGENDA_COLOR3',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6526,'GOOGLE_AGENDA_COLOR4',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6527,'GOOGLE_AGENDA_COLOR5',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6528,'GOOGLE_AGENDA_TIMEZONE',1,'Europe/Paris','chaine',0,'','2017-09-06 19:44:12'),(6529,'GOOGLE_AGENDA_NB',1,'5','chaine',0,'','2017-09-06 19:44:12'),(6543,'MAIN_SMS_DEBUG',0,'1','chaine',1,'This is to enable OVH SMS debug','2017-09-06 19:44:34'),(6562,'BLOCKEDLOG_ENTITY_FINGERPRINT',1,'b63e359ffca54d5c2bab869916eaf23d4a736703028ccbf77ce1167c5f830e7b','chaine',0,'Numeric Unique Fingerprint','2018-01-19 11:27:15'),(6564,'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY',1,'FR','chaine',0,'This is list of country code where the module may be mandatory','2018-01-19 11:27:15'),(6565,'MAIN_MODULE_BOOKMARK',1,'1',NULL,0,'{\"authorid\":\"12\",\"ip\":\"82.240.38.230\"}','2018-01-19 11:27:34'),(6566,'MAIN_MODULE_ADHERENT',1,'1',NULL,0,'{\"authorid\":\"12\",\"ip\":\"82.240.38.230\"}','2018-01-19 11:27:56'),(6567,'ADHERENT_ADDON_PDF',1,'standard','chaine',0,'Name of PDF model of member','2018-01-19 11:27:56'),(6636,'MAIN_MODULE_TICKET_MODELS',1,'1','chaine',0,NULL,'2019-06-05 09:15:29'),(6647,'MAIN_MODULE_SOCIALNETWORKS',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-06-05 09:16:49'),(6795,'TICKET_ADDON',1,'mod_ticket_simple','chaine',0,'','2019-09-26 12:07:59'),(6796,'PRODUCT_CODEPRODUCT_ADDON',1,'mod_codeproduct_elephant','chaine',0,'','2019-09-26 12:59:00'),(6800,'CASHDESK_ID_THIRDPARTY1',1,'7','chaine',0,'','2019-09-26 15:30:09'),(6801,'CASHDESK_ID_BANKACCOUNT_CASH1',1,'3','chaine',0,'','2019-09-26 15:30:09'),(6802,'CASHDESK_ID_BANKACCOUNT_CHEQUE1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6803,'CASHDESK_ID_BANKACCOUNT_CB1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6804,'CASHDESK_ID_BANKACCOUNT_PRE1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6805,'CASHDESK_ID_BANKACCOUNT_VIR1',1,'1','chaine',0,'','2019-09-26 15:30:09'),(6806,'CASHDESK_NO_DECREASE_STOCK1',1,'1','chaine',0,'','2019-09-26 15:30:09'),(6811,'FORCEPROJECT_ON_PROPOSAL',1,'1','chaine',0,'','2019-09-27 14:52:57'),(6813,'PROJECT_USE_OPPORTUNITIES',1,'1','chaine',0,'','2019-10-01 11:48:09'),(6814,'PACKTHEMEACTIVATEDTHEME',0,'modOwnTheme','chaine',0,'','2019-10-02 11:41:58'),(6815,'OWNTHEME_COL1',0,'#6a89cc','chaine',0,'','2019-10-02 11:41:58'),(6816,'OWNTHEME_COL2',0,'#60a3bc','chaine',0,'','2019-10-02 11:41:58'),(6817,'DOL_VERSION',0,'10.0.2','chaine',0,'Dolibarr version','2019-10-02 11:41:58'),(6823,'OWNTHEME_COL_BODY_BCKGRD',0,'#E9E9E9','chaine',0,'','2019-10-02 11:41:58'),(6824,'OWNTHEME_COL_LOGO_BCKGRD',0,'#474c80','chaine',0,'','2019-10-02 11:41:58'),(6825,'OWNTHEME_COL_TXT_MENU',0,'#b8c6e5','chaine',0,'','2019-10-02 11:41:58'),(6826,'OWNTHEME_COL_HEADER_BCKGRD',0,'#474c80','chaine',0,'','2019-10-02 11:41:58'),(6827,'OWNTHEME_CUSTOM_CSS',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6828,'OWNTHEME_CUSTOM_JS',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6829,'OWNTHEME_FIXED_MENU',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6830,'OWNTHEME_D_HEADER_FONT_SIZE',0,'1.7rem','chaine',0,'','2019-10-02 11:41:58'),(6831,'OWNTHEME_S_HEADER_FONT_SIZE',0,'1.6rem','chaine',0,'','2019-10-02 11:41:58'),(6832,'OWNTHEME_D_VMENU_FONT_SIZE',0,'1.2rem','chaine',0,'','2019-10-02 11:41:58'),(6833,'OWNTHEME_S_VMENU_FONT_SIZE',0,'1.2rem','chaine',0,'','2019-10-02 11:41:58'),(6844,'MAIN_THEME',0,'eldy','chaine',0,'','2019-10-02 11:46:02'),(6845,'MAIN_MENU_STANDARD',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6846,'MAIN_MENUFRONT_STANDARD',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6847,'MAIN_MENU_SMARTPHONE',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6848,'MAIN_MENUFRONT_SMARTPHONE',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6851,'BECREATIVE_COL1',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6852,'BECREATIVE_COL2',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6853,'DOL_VERSION',1,'10.0.2','chaine',0,'Dolibarr version','2019-10-02 11:47:10'),(6859,'BECREATIVE_COL_BODY_BCKGRD',1,'#e6eaef','chaine',0,'','2019-10-02 11:47:10'),(6860,'BECREATIVE_COL_LOGO_BCKGRD',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6861,'BECREATIVE_COL_TXT_MENU',1,'#b8c6e5','chaine',0,'','2019-10-02 11:47:10'),(6862,'BECREATIVE_COL_HEADER_BCKGRD',1,'#26a69a','chaine',0,'','2019-10-02 11:47:10'),(6863,'BECREATIVE_CUSTOM_CSS',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6864,'BECREATIVE_CUSTOM_JS',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6865,'BECREATIVE_FIXED_MENU',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6866,'BECREATIVE_D_HEADER_FONT_SIZE',1,'1.7rem','chaine',0,'','2019-10-02 11:47:10'),(6867,'BECREATIVE_S_HEADER_FONT_SIZE',1,'1.6rem','chaine',0,'','2019-10-02 11:47:10'),(6868,'BECREATIVE_D_VMENU_FONT_SIZE',1,'1.2rem','chaine',0,'','2019-10-02 11:47:10'),(6869,'BECREATIVE_S_VMENU_FONT_SIZE',1,'1.2rem','chaine',0,'','2019-10-02 11:47:10'),(6881,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6882,'MAIN_MENUFRONT_STANDARD',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6883,'MAIN_MENU_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6884,'MAIN_MENUFRONT_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6885,'ACCOUNTING_ACCOUNT_CUSTOMER',1,'411','chaine',0,'','2019-10-04 08:15:44'),(6886,'ACCOUNTING_ACCOUNT_SUPPLIER',1,'401','chaine',0,'','2019-10-04 08:15:44'),(6887,'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',1,'421','chaine',0,'','2019-10-04 08:15:44'),(6888,'ACCOUNTING_PRODUCT_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6889,'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6890,'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6891,'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6892,'ACCOUNTING_SERVICE_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6893,'ACCOUNTING_SERVICE_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6894,'ACCOUNTING_VAT_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6895,'ACCOUNTING_VAT_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6896,'ACCOUNTING_VAT_PAY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6897,'ACCOUNTING_ACCOUNT_SUSPENSE',1,'471','chaine',0,'','2019-10-04 08:15:44'),(6898,'ACCOUNTING_ACCOUNT_TRANSFER_CASH',1,'58','chaine',0,'','2019-10-04 08:15:44'),(6899,'DONATION_ACCOUNTINGACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6900,'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6901,'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',1,'164','chaine',0,'','2019-10-04 08:15:44'),(6902,'LOAN_ACCOUNTING_ACCOUNT_INTEREST',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6903,'LOAN_ACCOUNTING_ACCOUNT_INSURANCE',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6912,'TICKET_ENABLE_PUBLIC_INTERFACE',1,'1','chaine',0,'','2019-10-04 11:44:33'),(6934,'TICKET_NOTIFICATION_EMAIL_FROM',1,'fff','chaine',0,'','2019-10-04 12:03:51'),(6935,'TICKET_NOTIFICATION_EMAIL_TO',1,'ff','chaine',0,'','2019-10-04 12:03:51'),(6936,'TICKET_MESSAGE_MAIL_INTRO',1,'Hello,
\r\nA new response was sent on a ticket that you contact. Here is the message:\"\"','chaine',0,'','2019-10-04 12:03:51'),(6937,'TICKET_MESSAGE_MAIL_SIGNATURE',1,'

Sincerely,

\r\n\r\n

--\"\"

\r\n','chaine',0,'','2019-10-04 12:03:51'),(7027,'USER_PASSWORD_GENERATED',1,'Perso','chaine',0,'','2019-10-07 10:52:46'),(7028,'USER_PASSWORD_PATTERN',1,'12;1;0;1;0;1','chaine',0,'','2019-10-07 10:57:03'),(7034,'BOM_ADDON',1,'mod_bom_standard','chaine',0,'Name of numbering rules of BOM','2019-10-08 18:49:41'),(7035,'BOM_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/boms','chaine',0,NULL,'2019-10-08 18:49:41'),(7036,'MAIN_MODULE_GEOIPMAXMIND',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-10-08 18:51:54'),(7037,'MAIN_MODULE_DAV',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-10-08 18:54:07'),(7122,'BOM_ADDON_PDF',1,'generic_bom_odt','chaine',0,'','2019-11-28 14:00:58'),(7195,'MAIN_AGENDA_ACTIONAUTO_MO_VALIDATE',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7196,'MAIN_AGENDA_ACTIONAUTO_MO_PRODUCED',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7197,'MAIN_AGENDA_ACTIONAUTO_MO_DELETE',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7198,'MAIN_AGENDA_ACTIONAUTO_MO_CANCEL',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7201,'TICKET_PUBLIC_INTERFACE_TOPIC',1,'MyBigCompany public interface for Ticket','chaine',0,'','2019-11-29 08:49:36'),(7202,'TICKET_PUBLIC_TEXT_HOME',1,'You can create a support ticket or view existing from its identifier tracking ticket.','chaine',0,'','2019-11-29 08:49:36'),(7203,'TICKET_PUBLIC_TEXT_HELP_MESSAGE',1,'Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request.','chaine',0,'','2019-11-29 08:49:36'),(7204,'TICKET_MESSAGE_MAIL_NEW',1,'TicketMessageMailNewText','chaine',0,'','2019-11-29 08:49:36'),(7220,'MRP_MO_ADDON',1,'mod_mo_standard','chaine',0,'Name of numbering rules of MO','2019-11-29 08:57:42'),(7221,'MRP_MO_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/mrps','chaine',0,NULL,'2019-11-29 08:57:42'),(7222,'MRP_MO_ADDON_PDF',1,'generic_mo_odt','chaine',0,'','2019-11-29 08:57:47'),(7254,'MAIN_INFO_OPENINGHOURS_MONDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7255,'MAIN_INFO_OPENINGHOURS_TUESDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7256,'MAIN_INFO_OPENINGHOURS_WEDNESDAY',1,'8-13','chaine',0,'','2019-12-19 11:14:21'),(7257,'MAIN_INFO_OPENINGHOURS_THURSDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7258,'MAIN_INFO_OPENINGHOURS_FRIDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7264,'MAIN_INFO_ACCOUNTANT_NAME',1,'Bob Bookkeeper','chaine',0,'','2019-12-19 11:14:54'),(7265,'MAIN_INFO_ACCOUNTANT_TOWN',1,'Berlin','chaine',0,'','2019-12-19 11:14:54'),(7266,'MAIN_INFO_ACCOUNTANT_STATE',1,'0','chaine',0,'','2019-12-19 11:14:54'),(7267,'MAIN_INFO_ACCOUNTANT_COUNTRY',1,'5','chaine',0,'','2019-12-19 11:14:54'),(7268,'MAIN_INFO_ACCOUNTANT_MAIL',1,'mybookkeeper@example.com','chaine',0,'','2019-12-19 11:14:54'),(7313,'MODULEBUILDER_ASCIIDOCTOR',1,'asciidoctor','chaine',0,'','2019-12-20 10:57:21'),(7314,'MODULEBUILDER_ASCIIDOCTORPDF',1,'asciidoctor-pdf','chaine',0,'','2019-12-20 10:57:21'),(7337,'EXTERNAL_RSS_TITLE_1',1,'Dolibarr.org News','chaine',0,'','2019-12-20 12:10:38'),(7338,'EXTERNAL_RSS_URLRSS_1',1,'https://www.dolibarr.org/rss','chaine',0,'','2019-12-20 12:10:38'),(7339,'EXPENSEREPORT_ADDON',1,'mod_expensereport_jade','chaine',0,'','2019-12-20 16:33:46'),(7378,'COMPANY_USE_SEARCH_TO_SELECT',1,'0','chaine',0,'','2019-12-21 15:54:22'),(7420,'CASHDESK_SERVICES',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7421,'TAKEPOS_ROOT_CATEGORY_ID',1,'31','chaine',0,'','2019-12-23 12:15:06'),(7422,'TAKEPOSCONNECTOR',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7423,'TAKEPOS_BAR_RESTAURANT',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7424,'TAKEPOS_TICKET_VAT_GROUPPED',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7425,'TAKEPOS_AUTO_PRINT_TICKETS',1,'0','int',0,'','2019-12-23 12:15:06'),(7426,'TAKEPOS_NUMPAD',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7427,'TAKEPOS_NUM_TERMINALS',1,'1','chaine',0,'','2019-12-23 12:15:06'),(7428,'TAKEPOS_DIRECT_PAYMENT',1,'0','int',0,'','2019-12-23 12:15:06'),(7429,'TAKEPOS_CUSTOM_RECEIPT',1,'0','int',0,'','2019-12-23 12:15:06'),(7430,'TAKEPOS_EMAIL_TEMPLATE_INVOICE',1,'-1','chaine',0,'','2019-12-23 12:15:06'),(7452,'MEMBER_ENABLE_PUBLIC',1,'1','chaine',0,'','2020-01-01 10:31:46'),(7453,'MEMBER_NEWFORM_AMOUNT',1,'20','chaine',0,'','2020-01-01 10:31:46'),(7454,'MEMBER_NEWFORM_EDITAMOUNT',1,'0','chaine',0,'','2020-01-01 10:31:46'),(7455,'MEMBER_NEWFORM_PAYONLINE',1,'all','chaine',0,'','2020-01-01 10:31:46'),(7456,'MEMBER_NEWFORM_FORCETYPE',1,'1','chaine',0,'','2020-01-01 10:31:46'),(7470,'STRIPE_TEST_PUBLISHABLE_KEY',1,'pk_test_123456789','chaine',0,'','2020-01-01 11:43:44'),(7471,'STRIPE_TEST_SECRET_KEY',1,'sk_test_123456','chaine',0,'','2020-01-01 11:43:44'),(7472,'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS',1,'4','chaine',0,'','2020-01-01 11:43:44'),(7473,'STRIPE_USER_ACCOUNT_FOR_ACTIONS',1,'1','chaine',0,'','2020-01-01 11:43:44'),(7489,'CAPTURESERVER_SECURITY_KEY',1,'securitykey123','chaine',0,'','2020-01-01 12:00:49'),(8136,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_DELETE',1,'1','chaine',0,'','2020-01-02 19:56:28'),(8190,'ACCOUNTING_PRODUCT_MODE',1,'ACCOUNTANCY_SELL_EXPORT','chaine',0,'','2020-01-06 01:23:30'),(8191,'MAIN_ENABLE_DEFAULT_VALUES',1,'1','chaine',0,'','2020-01-06 16:09:52'),(8210,'CABINETMED_RHEUMATOLOGY_ON',1,'0','texte',0,'','2020-01-06 16:51:43'),(8213,'MAIN_SEARCHFORM_SOCIETE',1,'1','texte',0,'','2020-01-06 16:51:43'),(8214,'CABINETMED_BANK_PATIENT_REQUIRED',1,'0','texte',0,'','2020-01-06 16:51:43'),(8215,'DIAGNOSTIC_IS_NOT_MANDATORY',1,'1','texte',0,'','2020-01-06 16:51:43'),(8216,'USER_ADDON_PDF_ODT',1,'generic_user_odt','chaine',0,'','2020-01-07 13:45:19'),(8217,'USERGROUP_ADDON_PDF_ODT',1,'generic_usergroup_odt','chaine',0,'','2020-01-07 13:45:23'),(8230,'MAIN_MODULE_EMAILCOLLECTOR',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-12 20:13:55'),(8232,'MAIN_MODULE_SUPPLIERPROPOSAL',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-13 14:37:09'),(8233,'MAIN_MODULE_EXPEDITION',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-13 14:38:20'),(8252,'SYSTEMTOOLS_MYSQLDUMP',1,'/usr/bin/mysqldump','chaine',0,'','2020-01-15 15:42:41'),(8259,'ACCOUNTING_REEXPORT',1,'1','yesno',0,'','2020-01-17 13:42:56'),(8291,'PRODUIT_MULTIPRICES_LIMIT',1,'5','chaine',0,'','2020-01-17 14:21:46'),(8293,'PRODUIT_CUSTOMER_PRICES_BY_QTY',1,'0','chaine',0,'','2020-01-17 14:21:46'),(8303,'PRODUCT_PRICE_UNIQ',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8304,'PRODUIT_MULTIPRICES',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8305,'PRODUIT_CUSTOMER_PRICES',1,'1','chaine',0,'','2020-01-17 14:25:30'),(8306,'PRODUIT_SOUSPRODUITS',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8307,'PRODUIT_DESC_IN_FORM',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8308,'PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8309,'PRODUIT_USE_SEARCH_TO_SELECT',1,'1','chaine',0,'','2020-01-17 14:25:30'),(8310,'PRODUIT_FOURN_TEXTS',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8313,'MAIN_MODULE_FCKEDITOR',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-18 17:13:27'),(8314,'FCKEDITOR_ENABLE_TICKET',1,'1','chaine',0,'','2020-01-18 19:39:54'),(8321,'FCKEDITOR_SKIN',1,'moono-lisa','chaine',0,'','2020-01-18 19:41:15'),(8322,'FCKEDITOR_TEST',1,'Test < aaa
\r\n
\r\n\"\"','chaine',0,'','2020-01-18 19:41:15'),(8486,'MAIN_MULTILANGS',1,'1','chaine',0,'','2020-01-21 09:40:00'),(8491,'MAIN_DISABLE_JAVASCRIPT',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8492,'MAIN_BUTTON_HIDE_UNAUTHORIZED',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8496,'MAIN_SHOW_LOGO',1,'1','chaine',0,'','2020-01-21 09:40:00'),(8498,'MAIN_HELPCENTER_DISABLELINK',0,'0','chaine',0,'','2020-01-21 09:40:00'),(8501,'MAIN_BUGTRACK_ENABLELINK',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8554,'MAIN_INFO_SOCIETE_FACEBOOK_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8555,'MAIN_INFO_SOCIETE_TWITTER_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8556,'MAIN_INFO_SOCIETE_LINKEDIN_URL',1,'https://www.linkedin.com/company/9400559/admin/','chaine',0,'','2020-06-12 17:24:42'),(8557,'MAIN_INFO_SOCIETE_INSTAGRAM_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8558,'MAIN_INFO_SOCIETE_YOUTUBE_URL',1,'DolibarrERPCRM','chaine',0,'','2020-06-12 17:24:42'),(8559,'MAIN_INFO_SOCIETE_GITHUB_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8577,'PRODUCT_PRICE_BASE_TYPE',0,'HT','string',0,NULL,'2020-12-10 12:24:38'),(8612,'MAIN_UPLOAD_DOC',1,'50000','chaine',0,'','2020-12-10 12:26:31'),(8613,'MAIN_UMASK',1,'0664','chaine',0,'','2020-12-10 12:26:31'),(8614,'MAIN_ANTIVIRUS_PARAM',1,'--fdpass','chaine',0,'','2020-12-10 12:26:31'),(8619,'WEBSITE_EDITINLINE',1,'0','chaine',0,'','2020-12-10 12:27:05'),(8620,'WEBSITE_SUBCONTAINERSINLINE',1,'1','chaine',0,'','2020-12-10 12:27:17'),(8633,'MAIN_MODULE_RECEPTION',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:30:13'),(8634,'RECEPTION_ADDON_PDF',1,'squille','chaine',0,'Nom du gestionnaire de generation des bons receptions en PDF','2020-12-10 12:30:13'),(8635,'RECEPTION_ADDON_NUMBER',1,'mod_reception_beryl','chaine',0,'Name for numbering manager for receptions','2020-12-10 12:30:13'),(8636,'RECEPTION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/receptions','chaine',0,NULL,'2020-12-10 12:30:13'),(8637,'MAIN_SUBMODULE_RECEPTION',1,'1','chaine',0,'Enable receptions','2020-12-10 12:30:13'),(8638,'MAIN_MODULE_PAYMENTBYBANKTRANSFER',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:30:17'),(8640,'MAIN_MODULE_MARGIN_TABS_0',1,'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__','chaine',0,NULL,'2020-12-10 12:30:20'),(8641,'MAIN_MODULE_MARGIN_TABS_1',1,'thirdparty:+margin:Margins:margins:empty($user->socid) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__','chaine',0,NULL,'2020-12-10 12:30:20'),(8643,'MAIN_MODULE_BLOCKEDLOG',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:31:17'),(8644,'MAIN_MODULE_INCOTERM',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:31:36'),(8645,'INCOTERM_ACTIVATE',1,'','chaine',0,'Description de INCOTERM_ACTIVATE','2020-12-10 12:31:36'),(8649,'MAIN_MODULE_ACCOUNTING',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:57'),(8650,'MAIN_MODULE_AGENDA',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8651,'MAIN_MODULE_BOM',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8652,'MAIN_MODULE_BANQUE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8653,'MAIN_MODULE_BARCODE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8654,'MAIN_MODULE_CRON',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8655,'MAIN_MODULE_COMMANDE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8656,'MAIN_MODULE_DON',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:58'),(8657,'MAIN_MODULE_ECM',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:59'),(8658,'MAIN_MODULE_EXPENSEREPORT',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:59'),(8659,'MAIN_MODULE_FACTURE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:59'),(8660,'MAIN_MODULE_FOURNISSEUR',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:22:59'),(8661,'MAIN_MODULE_HOLIDAY',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8662,'MAIN_MODULE_MARGIN',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8665,'MAIN_MODULE_MRP',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8666,'MAIN_MODULE_MRP_TRIGGERS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8667,'MAIN_MODULE_MRP_LOGIN',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8668,'MAIN_MODULE_MRP_SUBSTITUTIONS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8669,'MAIN_MODULE_MRP_MENUS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8670,'MAIN_MODULE_MRP_TPL',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8671,'MAIN_MODULE_MRP_BARCODE',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8672,'MAIN_MODULE_MRP_MODELS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8673,'MAIN_MODULE_MRP_THEME',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8674,'MAIN_MODULE_MRP_MODULEFOREXTERNAL',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8675,'MAIN_MODULE_OPENSURVEY',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8676,'MAIN_MODULE_PRINTING',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8677,'MAIN_MODULE_RECRUITMENT',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8678,'MAIN_MODULE_RECRUITMENT_TRIGGERS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8679,'MAIN_MODULE_RECRUITMENT_LOGIN',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8680,'MAIN_MODULE_RECRUITMENT_SUBSTITUTIONS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8681,'MAIN_MODULE_RECRUITMENT_MENUS',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8682,'MAIN_MODULE_RECRUITMENT_TPL',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8683,'MAIN_MODULE_RECRUITMENT_BARCODE',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8684,'MAIN_MODULE_RECRUITMENT_MODELS',1,'1','chaine',0,NULL,'2021-04-15 10:23:00'),(8685,'MAIN_MODULE_RECRUITMENT_THEME',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8686,'MAIN_MODULE_RECRUITMENT_MODULEFOREXTERNAL',1,'0','chaine',0,NULL,'2021-04-15 10:23:00'),(8687,'MAIN_MODULE_RESOURCE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8688,'MAIN_MODULE_SALARIES',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8689,'MAIN_MODULE_SERVICE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:00'),(8690,'MAIN_MODULE_SOCIETE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8691,'MAIN_MODULE_STRIPE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8692,'MAIN_MODULE_TICKET',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8693,'MAIN_MODULE_TICKET_TABS_0',1,'thirdparty:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__','chaine',0,NULL,'2021-04-15 10:23:01'),(8694,'MAIN_MODULE_TICKET_TABS_1',1,'project:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__','chaine',0,NULL,'2021-04-15 10:23:01'),(8695,'MAIN_MODULE_TICKET_TRIGGERS',1,'1','chaine',0,NULL,'2021-04-15 10:23:01'),(8696,'TAKEPOS_PRINT_METHOD',1,'browser','chaine',0,'','2021-04-15 10:23:01'),(8697,'MAIN_MODULE_TAKEPOS',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8698,'MAIN_MODULE_TAKEPOS_TRIGGERS',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8699,'MAIN_MODULE_TAKEPOS_LOGIN',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8700,'MAIN_MODULE_TAKEPOS_SUBSTITUTIONS',1,'1','chaine',0,NULL,'2021-04-15 10:23:01'),(8701,'MAIN_MODULE_TAKEPOS_MENUS',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8702,'MAIN_MODULE_TAKEPOS_THEME',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8703,'MAIN_MODULE_TAKEPOS_TPL',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8704,'MAIN_MODULE_TAKEPOS_BARCODE',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8705,'MAIN_MODULE_TAKEPOS_MODELS',1,'0','chaine',0,NULL,'2021-04-15 10:23:01'),(8706,'MAIN_MODULE_USER',0,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8707,'MAIN_MODULE_VARIANTS',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:01'),(8708,'MAIN_MODULE_WEBSITE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-04-15 10:23:02'),(8709,'MAIN_VERSION_LAST_UPGRADE',0,'14.0.0-alpha','chaine',0,'Dolibarr version for last upgrade','2021-04-15 10:25:08'),(8711,'MAIN_FIRST_PING_OK_DATE',1,'20210415102513','chaine',0,'','2021-04-15 10:25:13'),(8712,'MAIN_FIRST_PING_OK_ID',1,'9646d6c55a34bca208868c98dac4678b','chaine',0,'','2021-04-15 10:25:13'),(8714,'MAIN_MODULE_SYSLOG',0,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2021-04-15 10:34:00'),(8715,'SYSLOG_LEVEL',0,'5','chaine',0,'','2021-04-15 10:34:05'),(8716,'MAIN_SECURITY_HASH_ALGO',1,'password_hash','chaine',1,'','2021-04-15 10:38:33'),(8717,'MAIN_INFO_SOCIETE_COUNTRY',1,'117:IN:India','chaine',0,'','2021-04-15 10:46:30'),(8718,'MAIN_INFO_SOCIETE_NOM',1,'MyBigCompany','chaine',0,'','2021-04-15 10:46:30'),(8719,'MAIN_INFO_SOCIETE_ADDRESS',1,'21 Jump street.','chaine',0,'','2021-04-15 10:46:30'),(8720,'MAIN_INFO_SOCIETE_TOWN',1,'MyTown','chaine',0,'','2021-04-15 10:46:30'),(8721,'MAIN_INFO_SOCIETE_ZIP',1,'75500','chaine',0,'','2021-04-15 10:46:30'),(8722,'MAIN_MONNAIE',1,'EUR','chaine',0,'','2021-04-15 10:46:30'),(8723,'MAIN_INFO_SOCIETE_TEL',1,'09123123','chaine',0,'','2021-04-15 10:46:30'),(8724,'MAIN_INFO_SOCIETE_FAX',1,'09123124','chaine',0,'','2021-04-15 10:46:30'),(8725,'MAIN_INFO_SOCIETE_MAIL',1,'myemail@mybigcompany.com','chaine',0,'','2021-04-15 10:46:30'),(8726,'MAIN_INFO_SOCIETE_WEB',1,'https://www.dolibarr.org','chaine',0,'','2021-04-15 10:46:30'),(8727,'MAIN_INFO_SOCIETE_NOTE',1,'This is note about my company','chaine',0,'','2021-04-15 10:46:30'),(8728,'MAIN_INFO_SOCIETE_LOGO_SQUARRED',1,'mybigcompany_squarred.png','chaine',0,'','2021-04-15 10:46:30'),(8729,'MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL',1,'mybigcompany_squarred_small.png','chaine',0,'','2021-04-15 10:46:30'),(8730,'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI',1,'mybigcompany_squarred_mini.png','chaine',0,'','2021-04-15 10:46:30'),(8731,'MAIN_INFO_SOCIETE_MANAGERS',1,'Zack Zeceo','chaine',0,'','2021-04-15 10:46:30'),(8732,'MAIN_INFO_GDPR',1,'Zack Zeceo','chaine',0,'','2021-04-15 10:46:30'),(8733,'MAIN_INFO_CAPITAL',1,'10000','chaine',0,'','2021-04-15 10:46:30'),(8734,'MAIN_INFO_SOCIETE_FORME_JURIDIQUE',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8735,'MAIN_INFO_SIREN',1,'123456','chaine',0,'','2021-04-15 10:46:30'),(8736,'MAIN_INFO_SIRET',1,'ABC-DEF','chaine',0,'','2021-04-15 10:46:30'),(8737,'MAIN_INFO_APE',1,'15E-45-8D','chaine',0,'','2021-04-15 10:46:30'),(8738,'MAIN_INFO_TVAINTRA',1,'FR12345678','chaine',0,'','2021-04-15 10:46:30'),(8739,'MAIN_INFO_SOCIETE_OBJECT',1,'A company demo to show how Dolibarr ERP CRM is wonderfull','chaine',0,'','2021-04-15 10:46:30'),(8740,'SOCIETE_FISCAL_MONTH_START',1,'4','chaine',0,'','2021-04-15 10:46:30'),(8741,'FACTURE_TVAOPTION',1,'1','chaine',0,'','2021-04-15 10:46:30'),(8742,'FACTURE_LOCAL_TAX1_OPTION',1,'localtax1on','chaine',0,'','2021-04-15 10:46:30'),(8743,'FACTURE_LOCAL_TAX2_OPTION',1,'localtax2on','chaine',0,'','2021-04-15 10:46:30'),(8744,'MAIN_INFO_VALUE_LOCALTAX1',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8745,'MAIN_INFO_LOCALTAX_CALC1',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8746,'MAIN_INFO_VALUE_LOCALTAX2',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8747,'MAIN_INFO_LOCALTAX_CALC2',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8759,'MAIN_LOGIN_BACKGROUND',1,'background_dolibarr.jpg','chaine',0,'','2021-04-15 10:54:37'),(8760,'MAIN_LANG_DEFAULT',1,'auto','chaine',0,'','2021-04-15 10:56:30'),(8761,'MAIN_IHM_PARAMS_REV',1,'13','chaine',0,'','2021-04-15 10:56:30'),(8762,'MAIN_THEME',1,'eldy','chaine',0,'','2021-04-15 10:56:30'),(8763,'THEME_ELDY_USE_HOVER',1,'237,244,251','chaine',0,'','2021-04-15 10:56:30'),(8764,'MAIN_SIZE_LISTE_LIMIT',1,'25','chaine',0,'','2021-04-15 10:56:30'),(8765,'MAIN_SIZE_SHORTLIST_LIMIT',1,'3','chaine',0,'','2021-04-15 10:56:30'),(8766,'MAIN_START_WEEK',1,'1','chaine',0,'','2021-04-15 10:56:30'),(8767,'MAIN_DEFAULT_WORKING_DAYS',1,'1-5','chaine',0,'','2021-04-15 10:56:30'),(8768,'MAIN_DEFAULT_WORKING_HOURS',1,'9-18','chaine',0,'','2021-04-15 10:56:30'),(8769,'MAIN_FIRSTNAME_NAME_POSITION',1,'0','chaine',0,'','2021-04-15 10:56:30'),(8770,'MAIN_HOME',1,'__(NoteSomeFeaturesAreDisabled)__
\r\n__(SomeTranslationAreUncomplete)__','chaine',0,'','2021-04-15 10:56:30'),(8771,'MAIN_FEATURES_LEVEL',0,'0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development','2021-04-15 11:46:30'),(8775,'MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8776,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8777,'MAIN_AGENDA_ACTIONAUTO_COMPANY_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8778,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_REFUSED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8779,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8780,'MAIN_AGENDA_ACTIONAUTO_PROPAL_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8781,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8782,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_SIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8783,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8784,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8785,'MAIN_AGENDA_ACTIONAUTO_ORDER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8786,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8787,'MAIN_AGENDA_ACTIONAUTO_ORDER_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8788,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8789,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8790,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8791,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8792,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8793,'MAIN_AGENDA_ACTIONAUTO_BILL_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8794,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8795,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8796,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8797,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8798,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_CLOSE_SIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8799,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_CLOSE_REFUSED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8800,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8801,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8802,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8803,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8804,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_RECEIVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8805,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SUBMIT',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8806,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_REFUSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8807,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8808,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8809,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8810,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8811,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8812,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_PAYED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8813,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8814,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_CANCELED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8815,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8816,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8817,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8818,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8819,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8820,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8821,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_REOPEN',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8822,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8823,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8824,'MAIN_AGENDA_ACTIONAUTO_MEMBER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8825,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8826,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8827,'MAIN_AGENDA_ACTIONAUTO_MEMBER_RESILIATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8828,'MAIN_AGENDA_ACTIONAUTO_MEMBER_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8829,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8830,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8831,'MAIN_AGENDA_ACTIONAUTO_MEMBER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8832,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8833,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8834,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8835,'MAIN_AGENDA_ACTIONAUTO_TASK_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8836,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8837,'MAIN_AGENDA_ACTIONAUTO_TASK_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8838,'MAIN_AGENDA_ACTIONAUTO_TASK_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8839,'MAIN_AGENDA_ACTIONAUTO_CONTACT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8840,'MAIN_AGENDA_ACTIONAUTO_CONTACT_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8841,'MAIN_AGENDA_ACTIONAUTO_CONTACT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8842,'MAIN_AGENDA_ACTIONAUTO_PROJECT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8843,'MAIN_AGENDA_ACTIONAUTO_PROJECT_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8844,'MAIN_AGENDA_ACTIONAUTO_PROJECT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8845,'MAIN_AGENDA_ACTIONAUTO_TICKET_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8846,'MAIN_AGENDA_ACTIONAUTO_TICKET_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8847,'MAIN_AGENDA_ACTIONAUTO_TICKET_ASSIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8848,'MAIN_AGENDA_ACTIONAUTO_TICKET_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8849,'MAIN_AGENDA_ACTIONAUTO_TICKET_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8850,'MAIN_AGENDA_ACTIONAUTO_TICKET_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8851,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8852,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8853,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8854,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8855,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_PAID',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8856,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8857,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8858,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8859,'MAIN_AGENDA_ACTIONAUTO_USER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8860,'MAIN_AGENDA_ACTIONAUTO_BOM_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8861,'MAIN_AGENDA_ACTIONAUTO_BOM_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8862,'MAIN_AGENDA_ACTIONAUTO_BOM_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8863,'MAIN_AGENDA_ACTIONAUTO_BOM_REOPEN',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8864,'MAIN_AGENDA_ACTIONAUTO_BOM_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8865,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8866,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_PRODUCED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8867,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8868,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8869,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8870,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8871,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8872,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8873,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8874,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8875,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8876,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8877,'AGENDA_REMINDER_BROWSER',1,'1','chaine',0,'','2021-04-15 13:32:29'); +INSERT INTO `llx_const` VALUES (8,'MAIN_UPLOAD_DOC',0,'2048','chaine',0,'Max size for file upload (0 means no upload allowed)','2012-07-08 11:17:57'),(9,'MAIN_SEARCHFORM_SOCIETE',0,'1','yesno',0,'Show form for quick company search','2012-07-08 11:17:57'),(10,'MAIN_SEARCHFORM_CONTACT',0,'1','yesno',0,'Show form for quick contact search','2012-07-08 11:17:57'),(11,'MAIN_SEARCHFORM_PRODUITSERVICE',0,'1','yesno',0,'Show form for quick product search','2012-07-08 11:17:58'),(12,'MAIN_SEARCHFORM_ADHERENT',0,'1','yesno',0,'Show form for quick member search','2012-07-08 11:17:58'),(16,'MAIN_SIZE_LISTE_LIMIT',0,'25','chaine',0,'Longueur maximum des listes','2012-07-08 11:17:58'),(29,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',1,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2012-07-08 11:17:58'),(33,'SOCIETE_NOLIST_COURRIER',0,'1','yesno',0,'Liste les fichiers du repertoire courrier','2012-07-08 11:17:58'),(36,'ADHERENT_MAIL_REQUIRED',1,'1','yesno',0,'EMail required to create a new member','2012-07-08 11:17:58'),(37,'ADHERENT_MAIL_FROM',1,'adherents@domain.com','chaine',0,'Sender EMail for automatic emails','2012-07-08 11:17:58'),(38,'ADHERENT_MAIL_RESIL',1,'Your subscription has been resiliated.\r\nWe hope to see you soon again','html',0,'Mail resiliation','2018-11-23 11:56:07'),(39,'ADHERENT_MAIL_VALID',1,'Your subscription has been validated.\r\nThis is a remind of your personal information :\r\n\r\n%INFOS%\r\n\r\n','html',0,'Mail de validation','2018-11-23 11:56:07'),(40,'ADHERENT_MAIL_COTIS',1,'Hello %PRENOM%,\r\nThanks for your subscription.\r\nThis email confirms that your subscription has been received and processed.\r\n\r\n','html',0,'Mail de validation de cotisation','2018-11-23 11:56:07'),(41,'ADHERENT_MAIL_VALID_SUBJECT',1,'Your subscription has been validated','chaine',0,'Sujet du mail de validation','2012-07-08 11:17:59'),(42,'ADHERENT_MAIL_RESIL_SUBJECT',1,'Resiliating your subscription','chaine',0,'Sujet du mail de resiliation','2012-07-08 11:17:59'),(43,'ADHERENT_MAIL_COTIS_SUBJECT',1,'Receipt of your subscription','chaine',0,'Sujet du mail de validation de cotisation','2012-07-08 11:17:59'),(44,'MAILING_EMAIL_FROM',1,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2012-07-08 11:17:59'),(45,'ADHERENT_USE_MAILMAN',1,'0','yesno',0,'Utilisation de Mailman','2012-07-08 11:17:59'),(46,'ADHERENT_MAILMAN_UNSUB_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%','chaine',0,'Url de desinscription aux listes mailman','2012-07-08 11:17:59'),(47,'ADHERENT_MAILMAN_URL',1,'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%','chaine',0,'Url pour les inscriptions mailman','2012-07-08 11:17:59'),(48,'ADHERENT_MAILMAN_LISTS',1,'test-test,test-test2','chaine',0,'Listes auxquelles inscrire les nouveaux adherents','2012-07-08 11:17:59'),(49,'ADHERENT_MAILMAN_ADMINPW',1,'','chaine',0,'Mot de passe Admin des liste mailman','2012-07-08 11:17:59'),(50,'ADHERENT_MAILMAN_SERVER',1,'lists.domain.com','chaine',0,'Serveur hebergeant les interfaces d Admin des listes mailman','2012-07-08 11:17:59'),(51,'ADHERENT_MAILMAN_LISTS_COTISANT',1,'','chaine',0,'Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement','2012-07-08 11:17:59'),(52,'ADHERENT_USE_SPIP',1,'0','yesno',0,'Utilisation de SPIP ?','2012-07-08 11:17:59'),(53,'ADHERENT_USE_SPIP_AUTO',1,'0','yesno',0,'Utilisation de SPIP automatiquement','2012-07-08 11:17:59'),(54,'ADHERENT_SPIP_USER',1,'user','chaine',0,'user spip','2012-07-08 11:17:59'),(55,'ADHERENT_SPIP_PASS',1,'pass','chaine',0,'Pass de connection','2012-07-08 11:17:59'),(56,'ADHERENT_SPIP_SERVEUR',1,'localhost','chaine',0,'serveur spip','2012-07-08 11:17:59'),(57,'ADHERENT_SPIP_DB',1,'spip','chaine',0,'db spip','2012-07-08 11:17:59'),(58,'ADHERENT_CARD_HEADER_TEXT',1,'%ANNEE%','chaine',0,'Texte imprime sur le haut de la carte adherent','2012-07-08 11:17:59'),(59,'ADHERENT_CARD_FOOTER_TEXT',1,'Association AZERTY','chaine',0,'Texte imprime sur le bas de la carte adherent','2012-07-08 11:17:59'),(61,'FCKEDITOR_ENABLE_USER',1,'1','yesno',0,'Activation fckeditor sur notes utilisateurs','2012-07-08 11:17:59'),(62,'FCKEDITOR_ENABLE_SOCIETE',1,'1','yesno',0,'Activation fckeditor sur notes societe','2012-07-08 11:17:59'),(63,'FCKEDITOR_ENABLE_PRODUCTDESC',1,'1','yesno',0,'Activation fckeditor sur notes produits','2012-07-08 11:17:59'),(64,'FCKEDITOR_ENABLE_MEMBER',1,'1','yesno',0,'Activation fckeditor sur notes adherent','2012-07-08 11:17:59'),(65,'FCKEDITOR_ENABLE_MAILING',1,'1','yesno',0,'Activation fckeditor sur emailing','2012-07-08 11:17:59'),(67,'DON_ADDON_MODEL',1,'html_cerfafr','chaine',0,'','2012-07-08 11:18:00'),(68,'PROPALE_ADDON',1,'mod_propale_marbre','chaine',0,'','2012-07-08 11:18:00'),(69,'PROPALE_ADDON_PDF',1,'azur','chaine',0,'','2012-07-08 11:18:00'),(70,'COMMANDE_ADDON',1,'mod_commande_marbre','chaine',0,'','2012-07-08 11:18:00'),(71,'COMMANDE_ADDON_PDF',1,'einstein','chaine',0,'','2012-07-08 11:18:00'),(72,'COMMANDE_SUPPLIER_ADDON',1,'mod_commande_fournisseur_muguet','chaine',0,'','2012-07-08 11:18:00'),(73,'COMMANDE_SUPPLIER_ADDON_PDF',1,'muscadet','chaine',0,'','2012-07-08 11:18:00'),(74,'EXPEDITION_ADDON',1,'enlevement','chaine',0,'','2012-07-08 11:18:00'),(76,'FICHEINTER_ADDON',1,'pacific','chaine',0,'','2012-07-08 11:18:00'),(77,'FICHEINTER_ADDON_PDF',1,'soleil','chaine',0,'','2012-07-08 11:18:00'),(79,'FACTURE_ADDON_PDF',1,'crabe','chaine',0,'','2012-07-08 11:18:00'),(80,'PROPALE_VALIDITY_DURATION',1,'15','chaine',0,'Durée de validitée des propales','2012-07-08 11:18:00'),(230,'COMPANY_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2012-07-08 11:26:20'),(238,'LIVRAISON_ADDON_PDF',1,'typhon','chaine',0,'Nom du gestionnaire de generation des commandes en PDF','2012-07-08 11:26:27'),(239,'DELIVERY_ADDON_NUMBER',1,'mod_delivery_jade','chaine',0,'Nom du gestionnaire de numerotation des bons de livraison','2020-12-10 12:24:40'),(245,'FACTURE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2012-07-08 11:28:53'),(249,'DON_FORM',1,'html_cerfafr','chaine',0,'Nom du gestionnaire de formulaire de dons','2017-09-06 16:12:22'),(254,'ADHERENT_BANK_ACCOUNT',1,'','chaine',0,'ID du Compte banquaire utilise','2012-07-08 11:29:05'),(255,'ADHERENT_BANK_CATEGORIE',1,'','chaine',0,'ID de la categorie banquaire des cotisations','2012-07-08 11:29:05'),(256,'ADHERENT_ETIQUETTE_TYPE',1,'L7163','chaine',0,'Type d etiquette (pour impression de planche d etiquette)','2012-07-08 11:29:05'),(269,'PROJECT_ADDON_PDF',1,'baleine','chaine',0,'Nom du gestionnaire de generation des projets en PDF','2012-07-08 11:29:33'),(270,'PROJECT_ADDON',1,'mod_project_simple','chaine',0,'Nom du gestionnaire de numerotation des projets','2012-07-08 11:29:33'),(369,'EXPEDITION_ADDON_PDF',1,'merou','chaine',0,'','2012-07-08 22:58:07'),(377,'FACTURE_ADDON',1,'mod_facture_terre','chaine',0,'','2012-07-08 23:08:12'),(380,'ADHERENT_CARD_TEXT',1,'%TYPE% n° %ID%\r\n%PRENOM% %NOM%\r\n<%EMAIL%>\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%','',0,'Texte imprime sur la carte adherent','2012-07-08 23:14:46'),(381,'ADHERENT_CARD_TEXT_RIGHT',1,'aaa','',0,'','2012-07-08 23:14:55'),(386,'STOCK_CALCULATE_ON_SHIPMENT',1,'1','chaine',0,'','2012-07-08 23:23:21'),(387,'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER',1,'1','chaine',0,'','2012-07-08 23:23:26'),(392,'MAIN_AGENDA_XCAL_EXPORTKEY',1,'dolibarr','chaine',0,'','2012-07-08 23:27:50'),(393,'MAIN_AGENDA_EXPORT_PAST_DELAY',1,'100','chaine',0,'','2012-07-08 23:27:50'),(610,'CASHDESK_ID_THIRDPARTY',1,'7','chaine',0,'','2012-07-11 17:08:18'),(611,'CASHDESK_ID_BANKACCOUNT_CASH',1,'3','chaine',0,'','2012-07-11 17:08:18'),(612,'CASHDESK_ID_BANKACCOUNT_CHEQUE',1,'1','chaine',0,'','2012-07-11 17:08:18'),(613,'CASHDESK_ID_BANKACCOUNT_CB',1,'1','chaine',0,'','2012-07-11 17:08:18'),(614,'CASHDESK_ID_WAREHOUSE',1,'2','chaine',0,'','2012-07-11 17:08:18'),(660,'LDAP_USER_DN',1,'ou=users,dc=my-domain,dc=com','chaine',0,NULL,'2012-07-18 10:25:27'),(661,'LDAP_GROUP_DN',1,'ou=groups,dc=my-domain,dc=com','chaine',0,NULL,'2012-07-18 10:25:27'),(662,'LDAP_FILTER_CONNECTION',1,'&(objectClass=user)(objectCategory=person)','chaine',0,NULL,'2012-07-18 10:25:27'),(663,'LDAP_FIELD_LOGIN',1,'uid','chaine',0,NULL,'2012-07-18 10:25:27'),(664,'LDAP_FIELD_FULLNAME',1,'cn','chaine',0,NULL,'2012-07-18 10:25:27'),(665,'LDAP_FIELD_NAME',1,'sn','chaine',0,NULL,'2012-07-18 10:25:27'),(666,'LDAP_FIELD_FIRSTNAME',1,'givenname','chaine',0,NULL,'2012-07-18 10:25:27'),(667,'LDAP_FIELD_MAIL',1,'mail','chaine',0,NULL,'2012-07-18 10:25:27'),(668,'LDAP_FIELD_PHONE',1,'telephonenumber','chaine',0,NULL,'2012-07-18 10:25:27'),(669,'LDAP_FIELD_FAX',1,'facsimiletelephonenumber','chaine',0,NULL,'2012-07-18 10:25:27'),(670,'LDAP_FIELD_MOBILE',1,'mobile','chaine',0,NULL,'2012-07-18 10:25:27'),(671,'LDAP_SERVER_TYPE',1,'openldap','chaine',0,'','2012-07-18 10:25:46'),(672,'LDAP_SERVER_PROTOCOLVERSION',1,'3','chaine',0,'','2012-07-18 10:25:47'),(673,'LDAP_SERVER_HOST',1,'localhost','chaine',0,'','2012-07-18 10:25:47'),(674,'LDAP_SERVER_PORT',1,'389','chaine',0,'','2012-07-18 10:25:47'),(675,'LDAP_SERVER_USE_TLS',1,'0','chaine',0,'','2012-07-18 10:25:47'),(676,'LDAP_SYNCHRO_ACTIVE',1,'dolibarr2ldap','chaine',0,'','2012-07-18 10:25:47'),(677,'LDAP_CONTACT_ACTIVE',1,'1','chaine',0,'','2012-07-18 10:25:47'),(678,'LDAP_MEMBER_ACTIVE',1,'1','chaine',0,'','2012-07-18 10:25:47'),(974,'MAIN_MODULE_WORKFLOW_TRIGGERS',1,'1','chaine',0,NULL,'2013-07-18 18:02:20'),(975,'WORKFLOW_PROPAL_AUTOCREATE_ORDER',1,'1','chaine',0,'','2013-07-18 18:02:24'),(980,'PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR',1,'1234567','chaine',0,'','2013-07-18 18:05:50'),(983,'FACTURE_RIB_NUMBER',1,'1','chaine',0,'','2013-07-18 18:35:14'),(984,'FACTURE_CHQ_NUMBER',1,'1','chaine',0,'','2013-07-18 18:35:14'),(1016,'GOOGLE_DUPLICATE_INTO_GCAL',1,'1','chaine',0,'','2013-07-18 21:40:20'),(1152,'SOCIETE_CODECLIENT_ADDON',1,'mod_codeclient_monkey','chaine',0,'','2013-07-29 20:50:02'),(1240,'MAIN_LOGEVENTS_USER_LOGIN',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1241,'MAIN_LOGEVENTS_USER_LOGIN_FAILED',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1242,'MAIN_LOGEVENTS_USER_LOGOUT',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1243,'MAIN_LOGEVENTS_USER_CREATE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1244,'MAIN_LOGEVENTS_USER_MODIFY',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1245,'MAIN_LOGEVENTS_USER_NEW_PASSWORD',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1246,'MAIN_LOGEVENTS_USER_ENABLEDISABLE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1247,'MAIN_LOGEVENTS_USER_DELETE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1248,'MAIN_LOGEVENTS_GROUP_CREATE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1249,'MAIN_LOGEVENTS_GROUP_MODIFY',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1250,'MAIN_LOGEVENTS_GROUP_DELETE',1,'1','chaine',0,'','2013-07-29 21:05:01'),(1251,'MAIN_BOXES_MAXLINES',1,'5','',0,'','2013-07-29 21:05:42'),(1482,'EXPEDITION_ADDON_NUMBER',1,'mod_expedition_safor','chaine',0,'Nom du gestionnaire de numerotation des expeditions','2013-08-05 17:53:11'),(1490,'CONTRACT_ADDON',1,'mod_contract_serpis','chaine',0,'Nom du gestionnaire de numerotation des contrats','2013-08-05 18:11:58'),(1677,'COMMANDE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/orders','chaine',0,NULL,'2014-12-08 13:11:02'),(1724,'PROPALE_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2014-12-08 13:17:14'),(1730,'OPENSTREETMAP_ENABLE_MAPS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1731,'OPENSTREETMAP_ENABLE_MAPS_CONTACTS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1732,'OPENSTREETMAP_ENABLE_MAPS_MEMBERS',1,'1','chaine',0,'','2014-12-08 13:22:47'),(1733,'OPENSTREETMAP_MAPS_ZOOM_LEVEL',1,'15','chaine',0,'','2014-12-08 13:22:47'),(1742,'MAIN_MAIL_EMAIL_FROM',2,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2014-12-08 14:08:14'),(1743,'MAIN_MENU_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2015-02-11 19:43:54'),(1744,'MAIN_MENUFRONT_STANDARD',2,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2015-02-11 19:43:54'),(1745,'MAIN_MENU_SMARTPHONE',2,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2014-12-08 14:08:14'),(1746,'MAIN_MENUFRONT_SMARTPHONE',2,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2014-12-08 14:08:14'),(1747,'MAIN_THEME',2,'eldy','chaine',0,'Default theme','2014-12-08 14:08:14'),(1748,'MAIN_DELAY_ACTIONS_TODO',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2014-12-08 14:08:14'),(1749,'MAIN_DELAY_ORDERS_TO_PROCESS',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2014-12-08 14:08:14'),(1750,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2014-12-08 14:08:14'),(1751,'MAIN_DELAY_PROPALS_TO_CLOSE',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2014-12-08 14:08:14'),(1752,'MAIN_DELAY_PROPALS_TO_BILL',2,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2014-12-08 14:08:14'),(1753,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2014-12-08 14:08:14'),(1754,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',2,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2014-12-08 14:08:14'),(1755,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2014-12-08 14:08:14'),(1756,'MAIN_DELAY_RUNNING_SERVICES',2,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2014-12-08 14:08:14'),(1757,'MAIN_DELAY_MEMBERS',2,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2014-12-08 14:08:14'),(1758,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',2,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2014-12-08 14:08:14'),(1759,'MAILING_EMAIL_FROM',2,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2014-12-08 14:08:14'),(1760,'MAIN_INFO_SOCIETE_COUNTRY',3,'1:FR:France','chaine',0,'','2015-02-26 21:56:28'),(1761,'MAIN_INFO_SOCIETE_NOM',3,'bbb','chaine',0,'','2014-12-08 14:08:20'),(1762,'MAIN_INFO_SOCIETE_STATE',3,'0','chaine',0,'','2015-02-27 14:20:27'),(1763,'MAIN_MONNAIE',3,'EUR','chaine',0,'','2014-12-08 14:08:20'),(1764,'MAIN_LANG_DEFAULT',3,'auto','chaine',0,'','2014-12-08 14:08:20'),(1765,'MAIN_MAIL_EMAIL_FROM',3,'dolibarr-robot@domain.com','chaine',0,'EMail emetteur pour les emails automatiques Dolibarr','2014-12-08 14:08:20'),(1766,'MAIN_MENU_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs internes','2015-02-11 19:43:54'),(1767,'MAIN_MENUFRONT_STANDARD',3,'eldy_menu.php','chaine',0,'Module de gestion de la barre de menu du haut pour utilisateurs externes','2015-02-11 19:43:54'),(1768,'MAIN_MENU_SMARTPHONE',3,'iphone_backoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs internes','2014-12-08 14:08:20'),(1769,'MAIN_MENUFRONT_SMARTPHONE',3,'iphone_frontoffice.php','chaine',0,'Module de gestion de la barre de menu smartphone pour utilisateurs externes','2014-12-08 14:08:20'),(1770,'MAIN_THEME',3,'eldy','chaine',0,'Default theme','2014-12-08 14:08:20'),(1771,'MAIN_DELAY_ACTIONS_TODO',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur actions planifiées non réalisées','2014-12-08 14:08:20'),(1772,'MAIN_DELAY_ORDERS_TO_PROCESS',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes clients non traitées','2014-12-08 14:08:20'),(1773,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées','2014-12-08 14:08:20'),(1774,'MAIN_DELAY_PROPALS_TO_CLOSE',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales à cloturer','2014-12-08 14:08:20'),(1775,'MAIN_DELAY_PROPALS_TO_BILL',3,'7','chaine',0,'Tolérance de retard avant alerte (en jours) sur propales non facturées','2014-12-08 14:08:20'),(1776,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures client impayées','2014-12-08 14:08:20'),(1777,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',3,'2','chaine',0,'Tolérance de retard avant alerte (en jours) sur factures fournisseur impayées','2014-12-08 14:08:20'),(1778,'MAIN_DELAY_NOT_ACTIVATED_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services à activer','2014-12-08 14:08:20'),(1779,'MAIN_DELAY_RUNNING_SERVICES',3,'0','chaine',0,'Tolérance de retard avant alerte (en jours) sur services expirés','2014-12-08 14:08:20'),(1780,'MAIN_DELAY_MEMBERS',3,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur cotisations adhérent en retard','2014-12-08 14:08:20'),(1781,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',3,'62','chaine',0,'Tolérance de retard avant alerte (en jours) sur rapprochements bancaires à faire','2014-12-08 14:08:20'),(1782,'MAILING_EMAIL_FROM',3,'dolibarr@domain.com','chaine',0,'EMail emmetteur pour les envois d emailings','2014-12-08 14:08:20'),(1803,'SYSLOG_FILE',1,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2014-12-08 14:15:08'),(1804,'SYSLOG_HANDLERS',1,'[\"mod_syslog_file\"]','chaine',0,'','2014-12-08 14:15:08'),(1805,'MAIN_MODULE_SKINCOLOREDITOR',3,'1',NULL,0,NULL,'2014-12-08 14:35:40'),(1922,'PAYPAL_API_SANDBOX',1,'1','chaine',0,'','2014-12-12 12:11:05'),(1923,'PAYPAL_API_USER',1,'seller_1355312017_biz_api1.mydomain.com','chaine',0,'','2014-12-12 12:11:05'),(1924,'PAYPAL_API_PASSWORD',1,'1355312040','chaine',0,'','2014-12-12 12:11:05'),(1925,'PAYPAL_API_SIGNATURE',1,'ABCDEFWBzvfn0q5iNmbuiDv1y.3EAXIMWyl4C5KvDReR9HDwwAd6dQ4Q','chaine',0,'','2014-12-12 12:11:05'),(1926,'PAYPAL_API_INTEGRAL_OR_PAYPALONLY',1,'integral','chaine',0,'','2014-12-12 12:11:05'),(1927,'PAYPAL_SECURITY_TOKEN',1,'50c82fab36bb3b6aa83e2a50691803b2','chaine',0,'','2014-12-12 12:11:05'),(1928,'PAYPAL_SECURITY_TOKEN_UNIQUE',1,'0','chaine',0,'','2014-12-12 12:11:05'),(1929,'PAYPAL_ADD_PAYMENT_URL',1,'1','chaine',0,'','2014-12-12 12:11:05'),(1980,'MAIN_PDF_FORMAT',1,'EUA4','chaine',0,'','2014-12-12 19:58:05'),(1981,'MAIN_PROFID1_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1982,'MAIN_PROFID2_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1983,'MAIN_PROFID3_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1984,'MAIN_PROFID4_IN_ADDRESS',1,'0','chaine',0,'','2014-12-12 19:58:05'),(1985,'MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',1,'0','chaine',0,'','2014-12-12 19:58:05'),(2835,'MAIN_USE_CONNECT_TIMEOUT',1,'10','chaine',0,'','2015-01-16 19:28:50'),(2836,'MAIN_USE_RESPONSE_TIMEOUT',1,'30','chaine',0,'','2015-01-16 19:28:50'),(2837,'MAIN_PROXY_USE',1,'0','chaine',0,'','2015-01-16 19:28:50'),(2838,'MAIN_PROXY_HOST',1,'localhost','chaine',0,'','2015-01-16 19:28:50'),(2839,'MAIN_PROXY_PORT',1,'8080','chaine',0,'','2015-01-16 19:28:50'),(2840,'MAIN_PROXY_USER',1,'aaa','chaine',0,'','2015-01-16 19:28:50'),(2841,'MAIN_PROXY_PASS',1,'bbb','chaine',0,'','2015-01-16 19:28:50'),(2848,'OVHSMS_NICK',1,'BN196-OVH','chaine',0,'','2015-01-16 19:32:36'),(2849,'OVHSMS_PASS',1,'bigone-10','chaine',0,'','2015-01-16 19:32:36'),(2850,'OVHSMS_SOAPURL',1,'https://www.ovh.com/soapi/soapi-re-1.55.wsdl','chaine',0,'','2015-01-16 19:32:36'),(2854,'THEME_ELDY_RGB',1,'bfbf00','chaine',0,'','2015-01-18 10:02:53'),(2855,'THEME_ELDY_ENABLE_PERSONALIZED',1,'0','chaine',0,'','2015-01-18 10:02:55'),(2858,'MAIN_SESSION_TIMEOUT',1,'2000','chaine',0,'','2015-01-19 17:01:53'),(2867,'FACSIM_ADDON',1,'mod_facsim_alcoy','chaine',0,'','2015-01-19 17:16:25'),(2868,'POS_SERVICES',1,'0','chaine',0,'','2015-01-19 17:16:51'),(2869,'POS_USE_TICKETS',1,'1','chaine',0,'','2015-01-19 17:16:51'),(2870,'POS_MAX_TTC',1,'100','chaine',0,'','2015-01-19 17:16:51'),(3190,'MAIN_MODULE_HOLIDAY',2,'1',NULL,0,NULL,'2015-02-01 08:52:34'),(3195,'INVOICE_SUPPLIER_ADDON_PDF',1,'canelle','chaine',0,'','2015-02-10 19:50:27'),(3199,'MAIN_FORCE_RELOAD_PAGE',1,'1','chaine',0,NULL,'2015-02-12 16:22:55'),(3223,'OVH_THIRDPARTY_IMPORT',1,'2','chaine',0,'','2015-02-13 16:20:18'),(3409,'AGENDA_USE_EVENT_TYPE',1,'1','chaine',0,'','2015-02-27 18:12:24'),(3886,'MAIN_REMOVE_INSTALL_WARNING',1,'1','chaine',1,'','2015-03-02 18:32:50'),(4013,'MAIN_DELAY_ACTIONS_TODO',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4014,'MAIN_DELAY_PROPALS_TO_CLOSE',1,'31','chaine',0,'','2015-03-06 08:59:12'),(4015,'MAIN_DELAY_PROPALS_TO_BILL',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4016,'MAIN_DELAY_ORDERS_TO_PROCESS',1,'2','chaine',0,'','2015-03-06 08:59:12'),(4017,'MAIN_DELAY_CUSTOMER_BILLS_UNPAYED',1,'31','chaine',0,'','2015-03-06 08:59:12'),(4018,'MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS',1,'7','chaine',0,'','2015-03-06 08:59:12'),(4019,'MAIN_DELAY_SUPPLIER_BILLS_TO_PAY',1,'2','chaine',0,'','2015-03-06 08:59:12'),(4020,'MAIN_DELAY_RUNNING_SERVICES',1,'-15','chaine',0,'','2015-03-06 08:59:12'),(4021,'MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE',1,'62','chaine',0,'','2015-03-06 08:59:13'),(4022,'MAIN_DELAY_MEMBERS',1,'31','chaine',0,'','2015-03-06 08:59:13'),(4023,'MAIN_DISABLE_METEO',1,'0','chaine',0,'','2015-03-06 08:59:13'),(4044,'ADHERENT_VAT_FOR_SUBSCRIPTIONS',1,'0','',0,'','2015-03-06 16:06:38'),(4047,'ADHERENT_BANK_USE',1,'bankviainvoice','',0,'','2015-03-06 16:12:30'),(4049,'PHPSANE_SCANIMAGE',1,'/usr/bin/scanimage','chaine',0,'','2015-03-06 21:54:13'),(4050,'PHPSANE_PNMTOJPEG',1,'/usr/bin/pnmtojpeg','chaine',0,'','2015-03-06 21:54:13'),(4051,'PHPSANE_PNMTOTIFF',1,'/usr/bin/pnmtotiff','chaine',0,'','2015-03-06 21:54:13'),(4052,'PHPSANE_OCR',1,'/usr/bin/gocr','chaine',0,'','2015-03-06 21:54:13'),(4548,'ECM_AUTO_TREE_ENABLED',1,'1','chaine',0,'','2015-03-10 15:57:21'),(4579,'MAIN_MODULE_AGENDA',2,'1',NULL,0,NULL,'2015-03-13 15:29:19'),(4580,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4581,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4582,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4583,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4584,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4585,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4586,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4587,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4588,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4589,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4590,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4591,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4592,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4593,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4594,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',2,'1','chaine',0,NULL,'2015-03-13 15:29:19'),(4688,'GOOGLE_ENABLE_AGENDA',2,'1','chaine',0,'','2015-03-13 15:36:29'),(4689,'GOOGLE_AGENDA_NAME1',2,'eldy','chaine',0,'','2015-03-13 15:36:29'),(4690,'GOOGLE_AGENDA_SRC1',2,'eldy10@mail.com','chaine',0,'','2015-03-13 15:36:29'),(4691,'GOOGLE_AGENDA_COLOR1',2,'BE6D00','chaine',0,'','2015-03-13 15:36:29'),(4692,'GOOGLE_AGENDA_COLOR2',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4693,'GOOGLE_AGENDA_COLOR3',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4694,'GOOGLE_AGENDA_COLOR4',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4695,'GOOGLE_AGENDA_COLOR5',2,'7A367A','chaine',0,'','2015-03-13 15:36:29'),(4696,'GOOGLE_AGENDA_TIMEZONE',2,'Europe/Paris','chaine',0,'','2015-03-13 15:36:29'),(4697,'GOOGLE_AGENDA_NB',2,'5','chaine',0,'','2015-03-13 15:36:29'),(4725,'SOCIETE_CODECLIENT_ADDON',2,'mod_codeclient_leopard','chaine',0,'Module to control third parties codes','2015-03-13 20:21:35'),(4726,'SOCIETE_CODECOMPTA_ADDON',2,'mod_codecompta_panicum','chaine',0,'Module to control third parties codes','2015-03-13 20:21:35'),(4727,'SOCIETE_FISCAL_MONTH_START',2,'','chaine',0,'Mettre le numero du mois du debut d\\\'annee fiscale, ex: 9 pour septembre','2015-03-13 20:21:35'),(4728,'MAIN_SEARCHFORM_SOCIETE',2,'1','yesno',0,'Show form for quick company search','2015-03-13 20:21:35'),(4729,'MAIN_SEARCHFORM_CONTACT',2,'1','yesno',0,'Show form for quick contact search','2015-03-13 20:21:35'),(4730,'COMPANY_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/thirdparties','chaine',0,NULL,'2015-03-13 20:21:35'),(4743,'MAIN_MODULE_CLICKTODIAL',2,'1',NULL,0,NULL,'2015-03-13 20:30:28'),(4744,'MAIN_MODULE_NOTIFICATION',2,'1',NULL,0,NULL,'2015-03-13 20:30:34'),(4745,'MAIN_MODULE_WEBSERVICES',2,'1',NULL,0,NULL,'2015-03-13 20:30:41'),(4746,'MAIN_MODULE_PROPALE',2,'1',NULL,0,NULL,'2015-03-13 20:32:38'),(4747,'PROPALE_ADDON_PDF',2,'azur','chaine',0,'Nom du gestionnaire de generation des propales en PDF','2015-03-13 20:32:38'),(4748,'PROPALE_ADDON',2,'mod_propale_marbre','chaine',0,'Nom du gestionnaire de numerotation des propales','2015-03-13 20:32:38'),(4749,'PROPALE_VALIDITY_DURATION',2,'15','chaine',0,'Duration of validity of business proposals','2015-03-13 20:32:38'),(4750,'PROPALE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/proposals','chaine',0,NULL,'2015-03-13 20:32:38'),(4752,'MAIN_MODULE_TAX',2,'1',NULL,0,NULL,'2015-03-13 20:32:47'),(4753,'MAIN_MODULE_DON',2,'1',NULL,0,NULL,'2015-03-13 20:32:54'),(4754,'DON_ADDON_MODEL',2,'html_cerfafr','chaine',0,'Nom du gestionnaire de generation de recu de dons','2015-03-13 20:32:54'),(4755,'POS_USE_TICKETS',2,'1','chaine',0,'','2015-03-13 20:33:09'),(4756,'POS_MAX_TTC',2,'100','chaine',0,'','2015-03-13 20:33:09'),(4757,'MAIN_MODULE_POS',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4758,'TICKET_ADDON',2,'mod_ticket_avenc','chaine',0,'Nom du gestionnaire de numerotation des tickets','2015-03-13 20:33:09'),(4759,'MAIN_MODULE_BANQUE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4760,'MAIN_MODULE_FACTURE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4761,'FACTURE_ADDON_PDF',2,'crabe','chaine',0,'Name of PDF model of invoice','2015-03-13 20:33:09'),(4762,'FACTURE_ADDON',2,'mod_facture_terre','chaine',0,'Name of numbering numerotation rules of invoice','2015-03-13 20:33:09'),(4763,'FACTURE_ADDON_PDF_ODT_PATH',2,'DOL_DATA_ROOT/doctemplates/invoices','chaine',0,NULL,'2015-03-13 20:33:09'),(4764,'MAIN_MODULE_SOCIETE',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4765,'MAIN_MODULE_PRODUCT',2,'1',NULL,0,NULL,'2015-03-13 20:33:09'),(4766,'PRODUCT_CODEPRODUCT_ADDON',2,'mod_codeproduct_leopard','chaine',0,'Module to control product codes','2015-03-13 20:33:09'),(4767,'MAIN_SEARCHFORM_PRODUITSERVICE',2,'1','yesno',0,'Show form for quick product search','2015-03-13 20:33:09'),(4772,'FACSIM_ADDON',2,'mod_facsim_alcoy','chaine',0,'','2015-03-13 20:33:32'),(4773,'MAIN_MODULE_MAILING',2,'1',NULL,0,NULL,'2015-03-13 20:33:37'),(4774,'MAIN_MODULE_OPENSURVEY',2,'1',NULL,0,NULL,'2015-03-13 20:33:42'),(4782,'AGENDA_USE_EVENT_TYPE',2,'1','chaine',0,'','2015-03-13 20:53:36'),(4884,'AGENDA_DISABLE_EXT',2,'1','chaine',0,'','2015-03-13 22:03:40'),(4928,'COMMANDE_SUPPLIER_ADDON_NUMBER',1,'mod_commande_fournisseur_muguet','chaine',0,'Nom du gestionnaire de numerotation des commandes fournisseur','2015-03-22 09:24:29'),(4929,'INVOICE_SUPPLIER_ADDON_NUMBER',1,'mod_facture_fournisseur_cactus','chaine',0,'Nom du gestionnaire de numerotation des factures fournisseur','2015-03-22 09:24:29'),(5001,'MAIN_CRON_KEY',0,'bc54582fe30d5d4a830c6f582ec28810','chaine',0,'','2015-03-23 17:54:53'),(5009,'CRON_KEY',0,'2c2e755c20be2014098f629865598006','chaine',0,'','2015-03-23 18:06:24'),(5139,'SOCIETE_ADD_REF_IN_LIST',1,'','yesno',0,'Display customer ref into select list','2015-09-08 23:06:08'),(5150,'PROJECT_TASK_ADDON_PDF',1,'','chaine',0,'Name of PDF/ODT tasks manager class','2015-09-08 23:06:14'),(5151,'PROJECT_TASK_ADDON',1,'mod_task_simple','chaine',0,'Name of Numbering Rule task manager class','2015-09-08 23:06:14'),(5152,'PROJECT_TASK_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/tasks','chaine',0,'','2015-09-08 23:06:14'),(5239,'BOOKMARKS_SHOW_IN_MENU',1,'10','chaine',0,'','2016-03-02 15:42:26'),(5271,'DONATION_ART200',1,'','yesno',0,'Option Française - Eligibilité Art200 du CGI','2016-12-21 12:51:28'),(5272,'DONATION_ART238',1,'','yesno',0,'Option Française - Eligibilité Art238 bis du CGI','2016-12-21 12:51:28'),(5274,'DONATION_MESSAGE',1,'Thank you','chaine',0,'Message affiché sur le récépissé de versements ou dons','2016-12-21 12:51:28'),(5349,'MAIN_SEARCHFORM_CONTACT',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5351,'MAIN_SEARCHFORM_PRODUITSERVICE',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5352,'MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER',1,'0','chaine',0,'','2017-10-03 10:11:33'),(5353,'MAIN_SEARCHFORM_ADHERENT',1,'1','chaine',0,'','2017-10-03 10:11:33'),(5354,'MAIN_SEARCHFORM_PROJECT',1,'0','chaine',0,'','2017-10-03 10:11:33'),(5394,'FCKEDITOR_ENABLE_DETAILS',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2017-11-04 15:27:44'),(5395,'FCKEDITOR_ENABLE_USERSIGN',1,'1','yesno',0,'WYSIWIG for user signature','2017-11-04 15:27:44'),(5396,'FCKEDITOR_ENABLE_MAIL',1,'1','yesno',0,'WYSIWIG for products details lines for all entities','2017-11-04 15:27:44'),(5398,'CATEGORIE_RECURSIV_ADD',1,'','yesno',0,'Affect parent categories','2017-11-04 15:27:46'),(5404,'MAIN_MODULE_CATEGORIE',1,'1',NULL,0,NULL,'2017-11-04 15:41:43'),(5415,'EXPEDITION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/shipment','chaine',0,NULL,'2017-11-15 22:38:28'),(5416,'LIVRAISON_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/delivery','chaine',0,NULL,'2017-11-15 22:38:28'),(5426,'MAIN_MODULE_PROJET',1,'1',NULL,0,NULL,'2017-11-15 22:38:44'),(5427,'PROJECT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/projects','chaine',0,NULL,'2017-11-15 22:38:44'),(5428,'PROJECT_USE_OPPORTUNIES',1,'1','chaine',0,NULL,'2017-11-15 22:38:44'),(5430,'MAIN_MODULE_EXPORT',1,'1',NULL,0,NULL,'2017-11-15 22:38:56'),(5431,'MAIN_MODULE_IMPORT',1,'1',NULL,0,NULL,'2017-11-15 22:38:58'),(5432,'MAIN_MODULE_MAILING',1,'1',NULL,0,NULL,'2017-11-15 22:39:00'),(5434,'EXPENSEREPORT_ADDON_PDF',1,'standard','chaine',0,'Name of manager to build PDF expense reports documents','2017-11-15 22:39:05'),(5437,'SALARIES_ACCOUNTING_ACCOUNT_CHARGE',1,'641','chaine',0,NULL,'2017-11-15 22:39:08'),(5441,'ADHERENT_ETIQUETTE_TEXT',1,'%FULLNAME%\n%ADDRESS%\n%ZIP% %TOWN%\n%COUNTRY%','text',0,'Text to print on member address sheets','2018-11-23 11:56:07'),(5443,'MAIN_MODULE_PRELEVEMENT',1,'1',NULL,0,NULL,'2017-11-15 22:39:33'),(5453,'MAIN_MODULE_CONTRAT',1,'1',NULL,0,NULL,'2017-11-15 22:39:52'),(5455,'MAIN_MODULE_FICHEINTER',1,'1',NULL,0,NULL,'2017-11-15 22:39:56'),(5459,'MAIN_MODULE_PAYPAL',1,'1',NULL,0,NULL,'2017-11-15 22:41:02'),(5463,'MAIN_MODULE_PROPALE',1,'1',NULL,0,NULL,'2017-11-15 22:41:47'),(5483,'GENBARCODE_BARCODETYPE_THIRDPARTY',1,'6','chaine',0,'','2018-01-16 15:49:43'),(5484,'PRODUIT_DEFAULT_BARCODE_TYPE',1,'2','chaine',0,'','2018-01-16 15:49:46'),(5586,'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',1,'31','chaine',0,'Tolérance de retard avant alerte (en jours) sur les notes de frais impayées','2018-01-22 17:28:18'),(5587,'MAIN_FIX_FOR_BUGGED_MTA',1,'1','chaine',1,'Set constant to fix email ending from PHP with some linux ike system','2018-01-22 17:28:18'),(5590,'MAIN_VERSION_LAST_INSTALL',0,'3.8.3','chaine',0,'Dolibarr version when install','2018-01-22 17:28:42'),(5604,'MAIN_INFO_SOCIETE_LOGO',1,'mybigcompany.png','chaine',0,'','2018-01-22 17:33:49'),(5605,'MAIN_INFO_SOCIETE_LOGO_SMALL',1,'mybigcompany_small.png','chaine',0,'','2018-01-22 17:33:49'),(5606,'MAIN_INFO_SOCIETE_LOGO_MINI',1,'mybigcompany_mini.png','chaine',0,'','2018-01-22 17:33:49'),(5614,'MAIN_SIZE_SHORTLISTE_LIMIT',1,'4','chaine',0,'Longueur maximum des listes courtes (fiche client)','2018-03-13 10:54:46'),(5627,'SUPPLIER_PROPOSAL_ADDON_PDF',1,'aurore','chaine',0,'Name of submodule to generate PDF for supplier quotation request','2018-07-30 11:13:20'),(5628,'SUPPLIER_PROPOSAL_ADDON',1,'mod_supplier_proposal_marbre','chaine',0,'Name of submodule to number supplier quotation request','2018-07-30 11:13:20'),(5629,'SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/supplier_proposal','chaine',0,NULL,'2018-07-30 11:13:20'),(5633,'MAIN_MODULE_API',1,'1',NULL,0,NULL,'2018-07-30 11:13:54'),(5634,'MAIN_MODULE_WEBSERVICES',1,'1',NULL,0,NULL,'2018-07-30 11:13:56'),(5635,'WEBSERVICES_KEY',1,'dolibarrkey','chaine',0,'','2018-07-30 11:14:04'),(5638,'MAIN_MODULE_EXTERNALRSS',1,'1',NULL,0,NULL,'2018-07-30 11:15:04'),(5642,'SOCIETE_CODECOMPTA_ADDON',1,'mod_codecompta_aquarium','chaine',0,'','2018-07-30 11:16:42'),(5707,'CASHDESK_NO_DECREASE_STOCK',1,'1','chaine',0,'','2018-07-30 13:38:11'),(5708,'MAIN_MODULE_PRODUCTBATCH',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5710,'MAIN_MODULE_STOCK',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5711,'MAIN_MODULE_PRODUCT',1,'1',NULL,0,NULL,'2018-07-30 13:38:11'),(5808,'MARGIN_TYPE',1,'costprice','chaine',0,'','2018-07-30 16:32:18'),(5809,'DISPLAY_MARGIN_RATES',1,'1','chaine',0,'','2018-07-30 16:32:20'),(5833,'ACCOUNTING_EXPORT_SEPARATORCSV',1,',','string',0,NULL,'2017-01-29 15:11:56'),(5840,'CHARTOFACCOUNTS',1,'2','chaine',0,NULL,'2017-01-29 15:11:56'),(5841,'ACCOUNTING_EXPORT_MODELCSV',1,'1','chaine',0,NULL,'2017-01-29 15:11:56'),(5842,'ACCOUNTING_LENGTH_GACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5843,'ACCOUNTING_LENGTH_AACCOUNT',1,'','chaine',0,NULL,'2017-01-29 15:11:56'),(5844,'ACCOUNTING_LIST_SORT_VENTILATION_TODO',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5845,'ACCOUNTING_LIST_SORT_VENTILATION_DONE',1,'1','yesno',0,NULL,'2017-01-29 15:11:56'),(5846,'ACCOUNTING_EXPORT_DATE',1,'%d%m%Y','chaine',0,NULL,'2017-01-29 15:11:56'),(5848,'ACCOUNTING_EXPORT_FORMAT',1,'csv','chaine',0,NULL,'2017-01-29 15:11:56'),(5853,'MAIN_MODULE_WORKFLOW',1,'1',NULL,0,NULL,'2017-01-29 15:12:12'),(5854,'MAIN_MODULE_NOTIFICATION',1,'1',NULL,0,NULL,'2017-01-29 15:12:35'),(5855,'MAIN_MODULE_OAUTH',1,'1',NULL,0,NULL,'2017-01-29 15:12:41'),(5883,'MAILING_LIMIT_SENDBYWEB',0,'15','chaine',1,'Number of targets to defined packet size when sending mass email','2017-01-29 17:36:33'),(5884,'MAIN_MAIL_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5885,'MAIN_SOAP_DEBUG',1,'0','chaine',1,'','2017-01-29 18:53:02'),(5925,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION',1,'1','chaine',0,'','2017-02-01 14:48:55'),(5931,'DATABASE_PWD_ENCRYPTED',1,'1','chaine',0,'','2017-02-01 15:06:04'),(5932,'MAIN_DISABLE_ALL_MAILS',1,'0','chaine',0,'','2017-02-01 15:09:09'),(5933,'MAIN_MAIL_SENDMODE',1,'mail','chaine',0,'','2017-02-01 15:09:09'),(5934,'MAIN_MAIL_SMTP_PORT',1,'465','chaine',0,'','2017-02-01 15:09:09'),(5935,'MAIN_MAIL_SMTP_SERVER',1,'smtp.mail.com','chaine',0,'','2017-02-01 15:09:09'),(5936,'MAIN_MAIL_SMTPS_ID',1,'eldy10@mail.com','chaine',0,'','2017-02-01 15:09:09'),(5937,'MAIN_MAIL_SMTPS_PW',1,'bidonge','chaine',0,'','2017-02-01 15:09:09'),(5938,'MAIN_MAIL_EMAIL_FROM',1,'robot@example.com','chaine',0,'','2017-02-01 15:09:09'),(5939,'MAIN_MAIL_DEFAULT_FROMTYPE',1,'user','chaine',0,'','2017-02-01 15:09:09'),(5940,'PRELEVEMENT_ID_BANKACCOUNT',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5941,'PRELEVEMENT_ICS',1,'ICS123456','chaine',0,'','2017-02-06 04:04:47'),(5942,'PRELEVEMENT_USER',1,'1','chaine',0,'','2017-02-06 04:04:47'),(5943,'BANKADDON_PDF',1,'sepamandate','chaine',0,'','2017-02-06 04:13:52'),(5947,'CHEQUERECEIPTS_THYME_MASK',1,'CHK{yy}{mm}-{0000@1}','chaine',0,'','2017-02-06 04:16:27'),(5948,'MAIN_MODULE_LOAN',1,'1',NULL,0,NULL,'2017-02-06 19:19:05'),(5954,'MAIN_SUBMODULE_EXPEDITION',1,'1','chaine',0,'','2017-02-06 23:57:37'),(5964,'MAIN_MODULE_TAX',1,'1',NULL,0,NULL,'2017-02-07 18:56:12'),(6019,'MAIN_INFO_SOCIETE_COUNTRY',2,'1:FR:France','chaine',0,'','2017-02-15 17:18:22'),(6020,'MAIN_INFO_SOCIETE_NOM',2,'MySecondCompany','chaine',0,'','2017-02-15 17:18:22'),(6021,'MAIN_INFO_SOCIETE_STATE',2,'0','chaine',0,'','2017-02-15 17:18:22'),(6022,'MAIN_MONNAIE',2,'EUR','chaine',0,'','2017-02-15 17:18:22'),(6023,'MAIN_LANG_DEFAULT',2,'auto','chaine',0,'','2017-02-15 17:18:22'),(6032,'MAIN_MODULE_MULTICURRENCY',1,'1',NULL,0,NULL,'2017-02-15 17:29:59'),(6048,'SYSLOG_FACILITY',0,'LOG_USER','chaine',0,'','2017-02-15 22:37:01'),(6049,'SYSLOG_FIREPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/firephp/firephp-core/lib/','chaine',0,'','2017-02-15 22:37:01'),(6050,'SYSLOG_FILE',0,'DOL_DATA_ROOT/dolibarr.log','chaine',0,'','2017-02-15 22:37:01'),(6051,'SYSLOG_CHROMEPHP_INCLUDEPATH',0,'/home/ldestailleur/git/dolibarr_5.0/htdocs/includes/ccampbell/chromephp/','chaine',0,'','2017-02-15 22:37:01'),(6052,'SYSLOG_HANDLERS',0,'[\"mod_syslog_file\"]','chaine',0,'','2017-02-15 22:37:01'),(6092,'MAIN_SIZE_SHORTLIST_LIMIT',0,'3','chaine',0,'Max length for small lists (tabs)','2017-05-12 09:02:38'),(6099,'MAIN_MODULE_SKYPE',1,'1',NULL,0,NULL,'2017-05-12 09:03:51'),(6100,'MAIN_MODULE_GRAVATAR',1,'1',NULL,0,NULL,'2017-05-12 09:03:54'),(6102,'PRODUCT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/products','chaine',0,'','2017-08-27 13:29:07'),(6103,'CONTRACT_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/contracts','chaine',0,'','2017-08-27 13:29:07'),(6104,'USERGROUP_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/usergroups','chaine',0,'','2017-08-27 13:29:07'),(6105,'USER_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/users','chaine',0,'','2017-08-27 13:29:07'),(6106,'MAIN_ENABLE_OVERWRITE_TRANSLATION',1,'1','chaine',0,'Enable overwrote of translation','2017-08-27 13:29:07'),(6377,'COMMANDE_SAPHIR_MASK',1,'{yy}{mm}{000}{ttt}','chaine',0,'','2017-09-06 07:56:25'),(6518,'GOOGLE_DUPLICATE_INTO_THIRDPARTIES',1,'1','chaine',0,'','2017-09-06 19:43:57'),(6519,'GOOGLE_DUPLICATE_INTO_CONTACTS',1,'0','chaine',0,'','2017-09-06 19:43:57'),(6520,'GOOGLE_TAG_PREFIX',1,'Dolibarr (Thirdparties)','chaine',0,'','2017-09-06 19:43:57'),(6521,'GOOGLE_TAG_PREFIX_CONTACTS',1,'Dolibarr (Contacts/Addresses)','chaine',0,'','2017-09-06 19:43:57'),(6522,'GOOGLE_ENABLE_AGENDA',1,'1','chaine',0,'','2017-09-06 19:44:12'),(6523,'GOOGLE_AGENDA_COLOR1',1,'1B887A','chaine',0,'','2017-09-06 19:44:12'),(6524,'GOOGLE_AGENDA_COLOR2',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6525,'GOOGLE_AGENDA_COLOR3',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6526,'GOOGLE_AGENDA_COLOR4',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6527,'GOOGLE_AGENDA_COLOR5',1,'7A367A','chaine',0,'','2017-09-06 19:44:12'),(6528,'GOOGLE_AGENDA_TIMEZONE',1,'Europe/Paris','chaine',0,'','2017-09-06 19:44:12'),(6529,'GOOGLE_AGENDA_NB',1,'5','chaine',0,'','2017-09-06 19:44:12'),(6543,'MAIN_SMS_DEBUG',0,'1','chaine',1,'This is to enable OVH SMS debug','2017-09-06 19:44:34'),(6562,'BLOCKEDLOG_ENTITY_FINGERPRINT',1,'b63e359ffca54d5c2bab869916eaf23d4a736703028ccbf77ce1167c5f830e7b','chaine',0,'Numeric Unique Fingerprint','2018-01-19 11:27:15'),(6564,'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY',1,'FR','chaine',0,'This is list of country code where the module may be mandatory','2018-01-19 11:27:15'),(6565,'MAIN_MODULE_BOOKMARK',1,'1',NULL,0,'{\"authorid\":\"12\",\"ip\":\"82.240.38.230\"}','2018-01-19 11:27:34'),(6566,'MAIN_MODULE_ADHERENT',1,'1',NULL,0,'{\"authorid\":\"12\",\"ip\":\"82.240.38.230\"}','2018-01-19 11:27:56'),(6567,'ADHERENT_ADDON_PDF',1,'standard','chaine',0,'Name of PDF model of member','2018-01-19 11:27:56'),(6636,'MAIN_MODULE_TICKET_MODELS',1,'1','chaine',0,NULL,'2019-06-05 09:15:29'),(6647,'MAIN_MODULE_SOCIALNETWORKS',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-06-05 09:16:49'),(6795,'TICKET_ADDON',1,'mod_ticket_simple','chaine',0,'','2019-09-26 12:07:59'),(6796,'PRODUCT_CODEPRODUCT_ADDON',1,'mod_codeproduct_elephant','chaine',0,'','2019-09-26 12:59:00'),(6800,'CASHDESK_ID_THIRDPARTY1',1,'7','chaine',0,'','2019-09-26 15:30:09'),(6801,'CASHDESK_ID_BANKACCOUNT_CASH1',1,'3','chaine',0,'','2019-09-26 15:30:09'),(6802,'CASHDESK_ID_BANKACCOUNT_CHEQUE1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6803,'CASHDESK_ID_BANKACCOUNT_CB1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6804,'CASHDESK_ID_BANKACCOUNT_PRE1',1,'4','chaine',0,'','2019-09-26 15:30:09'),(6805,'CASHDESK_ID_BANKACCOUNT_VIR1',1,'1','chaine',0,'','2019-09-26 15:30:09'),(6806,'CASHDESK_NO_DECREASE_STOCK1',1,'1','chaine',0,'','2019-09-26 15:30:09'),(6811,'FORCEPROJECT_ON_PROPOSAL',1,'1','chaine',0,'','2019-09-27 14:52:57'),(6813,'PROJECT_USE_OPPORTUNITIES',1,'1','chaine',0,'','2019-10-01 11:48:09'),(6814,'PACKTHEMEACTIVATEDTHEME',0,'modOwnTheme','chaine',0,'','2019-10-02 11:41:58'),(6815,'OWNTHEME_COL1',0,'#6a89cc','chaine',0,'','2019-10-02 11:41:58'),(6816,'OWNTHEME_COL2',0,'#60a3bc','chaine',0,'','2019-10-02 11:41:58'),(6817,'DOL_VERSION',0,'10.0.2','chaine',0,'Dolibarr version','2019-10-02 11:41:58'),(6823,'OWNTHEME_COL_BODY_BCKGRD',0,'#E9E9E9','chaine',0,'','2019-10-02 11:41:58'),(6824,'OWNTHEME_COL_LOGO_BCKGRD',0,'#474c80','chaine',0,'','2019-10-02 11:41:58'),(6825,'OWNTHEME_COL_TXT_MENU',0,'#b8c6e5','chaine',0,'','2019-10-02 11:41:58'),(6826,'OWNTHEME_COL_HEADER_BCKGRD',0,'#474c80','chaine',0,'','2019-10-02 11:41:58'),(6827,'OWNTHEME_CUSTOM_CSS',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6828,'OWNTHEME_CUSTOM_JS',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6829,'OWNTHEME_FIXED_MENU',0,'0','yesno',0,'','2019-10-02 11:41:58'),(6830,'OWNTHEME_D_HEADER_FONT_SIZE',0,'1.7rem','chaine',0,'','2019-10-02 11:41:58'),(6831,'OWNTHEME_S_HEADER_FONT_SIZE',0,'1.6rem','chaine',0,'','2019-10-02 11:41:58'),(6832,'OWNTHEME_D_VMENU_FONT_SIZE',0,'1.2rem','chaine',0,'','2019-10-02 11:41:58'),(6833,'OWNTHEME_S_VMENU_FONT_SIZE',0,'1.2rem','chaine',0,'','2019-10-02 11:41:58'),(6844,'MAIN_THEME',0,'eldy','chaine',0,'','2019-10-02 11:46:02'),(6845,'MAIN_MENU_STANDARD',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6846,'MAIN_MENUFRONT_STANDARD',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6847,'MAIN_MENU_SMARTPHONE',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6848,'MAIN_MENUFRONT_SMARTPHONE',0,'eldy_menu.php','chaine',0,'','2019-10-02 11:46:02'),(6851,'BECREATIVE_COL1',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6852,'BECREATIVE_COL2',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6853,'DOL_VERSION',1,'10.0.2','chaine',0,'Dolibarr version','2019-10-02 11:47:10'),(6859,'BECREATIVE_COL_BODY_BCKGRD',1,'#e6eaef','chaine',0,'','2019-10-02 11:47:10'),(6860,'BECREATIVE_COL_LOGO_BCKGRD',1,'#1e88e5','chaine',0,'','2019-10-02 11:47:10'),(6861,'BECREATIVE_COL_TXT_MENU',1,'#b8c6e5','chaine',0,'','2019-10-02 11:47:10'),(6862,'BECREATIVE_COL_HEADER_BCKGRD',1,'#26a69a','chaine',0,'','2019-10-02 11:47:10'),(6863,'BECREATIVE_CUSTOM_CSS',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6864,'BECREATIVE_CUSTOM_JS',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6865,'BECREATIVE_FIXED_MENU',1,'0','yesno',0,'','2019-10-02 11:47:10'),(6866,'BECREATIVE_D_HEADER_FONT_SIZE',1,'1.7rem','chaine',0,'','2019-10-02 11:47:10'),(6867,'BECREATIVE_S_HEADER_FONT_SIZE',1,'1.6rem','chaine',0,'','2019-10-02 11:47:10'),(6868,'BECREATIVE_D_VMENU_FONT_SIZE',1,'1.2rem','chaine',0,'','2019-10-02 11:47:10'),(6869,'BECREATIVE_S_VMENU_FONT_SIZE',1,'1.2rem','chaine',0,'','2019-10-02 11:47:10'),(6881,'MAIN_MENU_STANDARD',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6882,'MAIN_MENUFRONT_STANDARD',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6883,'MAIN_MENU_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6884,'MAIN_MENUFRONT_SMARTPHONE',1,'eldy_menu.php','chaine',0,'','2019-10-02 11:48:49'),(6885,'ACCOUNTING_ACCOUNT_CUSTOMER',1,'411','chaine',0,'','2019-10-04 08:15:44'),(6886,'ACCOUNTING_ACCOUNT_SUPPLIER',1,'401','chaine',0,'','2019-10-04 08:15:44'),(6887,'SALARIES_ACCOUNTING_ACCOUNT_PAYMENT',1,'421','chaine',0,'','2019-10-04 08:15:44'),(6888,'ACCOUNTING_PRODUCT_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6889,'ACCOUNTING_PRODUCT_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6890,'ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6891,'ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6892,'ACCOUNTING_SERVICE_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6893,'ACCOUNTING_SERVICE_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6894,'ACCOUNTING_VAT_BUY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6895,'ACCOUNTING_VAT_SOLD_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6896,'ACCOUNTING_VAT_PAY_ACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6897,'ACCOUNTING_ACCOUNT_SUSPENSE',1,'471','chaine',0,'','2019-10-04 08:15:44'),(6898,'ACCOUNTING_ACCOUNT_TRANSFER_CASH',1,'58','chaine',0,'','2019-10-04 08:15:44'),(6899,'DONATION_ACCOUNTINGACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6900,'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6901,'LOAN_ACCOUNTING_ACCOUNT_CAPITAL',1,'164','chaine',0,'','2019-10-04 08:15:44'),(6902,'LOAN_ACCOUNTING_ACCOUNT_INTEREST',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6903,'LOAN_ACCOUNTING_ACCOUNT_INSURANCE',1,'-1','chaine',0,'','2019-10-04 08:15:44'),(6912,'TICKET_ENABLE_PUBLIC_INTERFACE',1,'1','chaine',0,'','2019-10-04 11:44:33'),(6934,'TICKET_NOTIFICATION_EMAIL_FROM',1,'fff','chaine',0,'','2019-10-04 12:03:51'),(6935,'TICKET_NOTIFICATION_EMAIL_TO',1,'ff','chaine',0,'','2019-10-04 12:03:51'),(6936,'TICKET_MESSAGE_MAIL_INTRO',1,'Hello,
\r\nA new response was sent on a ticket that you contact. Here is the message:\"\"','chaine',0,'','2019-10-04 12:03:51'),(6937,'TICKET_MESSAGE_MAIL_SIGNATURE',1,'

Sincerely,

\r\n\r\n

--\"\"

\r\n','chaine',0,'','2019-10-04 12:03:51'),(7027,'USER_PASSWORD_GENERATED',1,'Perso','chaine',0,'','2019-10-07 10:52:46'),(7028,'USER_PASSWORD_PATTERN',1,'12;1;0;1;0;1','chaine',0,'','2019-10-07 10:57:03'),(7034,'BOM_ADDON',1,'mod_bom_standard','chaine',0,'Name of numbering rules of BOM','2019-10-08 18:49:41'),(7035,'BOM_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/boms','chaine',0,NULL,'2019-10-08 18:49:41'),(7036,'MAIN_MODULE_GEOIPMAXMIND',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-10-08 18:51:54'),(7037,'MAIN_MODULE_DAV',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2019-10-08 18:54:07'),(7122,'BOM_ADDON_PDF',1,'generic_bom_odt','chaine',0,'','2019-11-28 14:00:58'),(7195,'MAIN_AGENDA_ACTIONAUTO_MO_VALIDATE',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7196,'MAIN_AGENDA_ACTIONAUTO_MO_PRODUCED',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7197,'MAIN_AGENDA_ACTIONAUTO_MO_DELETE',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7198,'MAIN_AGENDA_ACTIONAUTO_MO_CANCEL',1,'1','chaine',0,'','2019-11-29 08:44:37'),(7201,'TICKET_PUBLIC_INTERFACE_TOPIC',1,'MyBigCompany public interface for Ticket','chaine',0,'','2019-11-29 08:49:36'),(7202,'TICKET_PUBLIC_TEXT_HOME',1,'You can create a support ticket or view existing from its identifier tracking ticket.','chaine',0,'','2019-11-29 08:49:36'),(7203,'TICKET_PUBLIC_TEXT_HELP_MESSAGE',1,'Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request.','chaine',0,'','2019-11-29 08:49:36'),(7204,'TICKET_MESSAGE_MAIL_NEW',1,'TicketMessageMailNewText','chaine',0,'','2019-11-29 08:49:36'),(7220,'MRP_MO_ADDON',1,'mod_mo_standard','chaine',0,'Name of numbering rules of MO','2019-11-29 08:57:42'),(7221,'MRP_MO_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/mrps','chaine',0,NULL,'2019-11-29 08:57:42'),(7222,'MRP_MO_ADDON_PDF',1,'generic_mo_odt','chaine',0,'','2019-11-29 08:57:47'),(7254,'MAIN_INFO_OPENINGHOURS_MONDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7255,'MAIN_INFO_OPENINGHOURS_TUESDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7256,'MAIN_INFO_OPENINGHOURS_WEDNESDAY',1,'8-13','chaine',0,'','2019-12-19 11:14:21'),(7257,'MAIN_INFO_OPENINGHOURS_THURSDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7258,'MAIN_INFO_OPENINGHOURS_FRIDAY',1,'8-12 13-18','chaine',0,'','2019-12-19 11:14:21'),(7264,'MAIN_INFO_ACCOUNTANT_NAME',1,'Bob Bookkeeper','chaine',0,'','2019-12-19 11:14:54'),(7265,'MAIN_INFO_ACCOUNTANT_TOWN',1,'Berlin','chaine',0,'','2019-12-19 11:14:54'),(7266,'MAIN_INFO_ACCOUNTANT_STATE',1,'0','chaine',0,'','2019-12-19 11:14:54'),(7267,'MAIN_INFO_ACCOUNTANT_COUNTRY',1,'5','chaine',0,'','2019-12-19 11:14:54'),(7268,'MAIN_INFO_ACCOUNTANT_MAIL',1,'mybookkeeper@example.com','chaine',0,'','2019-12-19 11:14:54'),(7313,'MODULEBUILDER_ASCIIDOCTOR',1,'asciidoctor','chaine',0,'','2019-12-20 10:57:21'),(7314,'MODULEBUILDER_ASCIIDOCTORPDF',1,'asciidoctor-pdf','chaine',0,'','2019-12-20 10:57:21'),(7337,'EXTERNAL_RSS_TITLE_1',1,'Dolibarr.org News','chaine',0,'','2019-12-20 12:10:38'),(7338,'EXTERNAL_RSS_URLRSS_1',1,'https://www.dolibarr.org/rss','chaine',0,'','2019-12-20 12:10:38'),(7339,'EXPENSEREPORT_ADDON',1,'mod_expensereport_jade','chaine',0,'','2019-12-20 16:33:46'),(7378,'COMPANY_USE_SEARCH_TO_SELECT',1,'0','chaine',0,'','2019-12-21 15:54:22'),(7420,'CASHDESK_SERVICES',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7421,'TAKEPOS_ROOT_CATEGORY_ID',1,'31','chaine',0,'','2019-12-23 12:15:06'),(7422,'TAKEPOSCONNECTOR',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7423,'TAKEPOS_BAR_RESTAURANT',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7424,'TAKEPOS_TICKET_VAT_GROUPPED',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7425,'TAKEPOS_AUTO_PRINT_TICKETS',1,'0','int',0,'','2019-12-23 12:15:06'),(7426,'TAKEPOS_NUMPAD',1,'0','chaine',0,'','2019-12-23 12:15:06'),(7427,'TAKEPOS_NUM_TERMINALS',1,'1','chaine',0,'','2019-12-23 12:15:06'),(7428,'TAKEPOS_DIRECT_PAYMENT',1,'0','int',0,'','2019-12-23 12:15:06'),(7429,'TAKEPOS_CUSTOM_RECEIPT',1,'0','int',0,'','2019-12-23 12:15:06'),(7430,'TAKEPOS_EMAIL_TEMPLATE_INVOICE',1,'-1','chaine',0,'','2019-12-23 12:15:06'),(7452,'MEMBER_ENABLE_PUBLIC',1,'1','chaine',0,'','2020-01-01 10:31:46'),(7453,'MEMBER_NEWFORM_AMOUNT',1,'20','chaine',0,'','2020-01-01 10:31:46'),(7454,'MEMBER_NEWFORM_EDITAMOUNT',1,'0','chaine',0,'','2020-01-01 10:31:46'),(7455,'MEMBER_NEWFORM_PAYONLINE',1,'all','chaine',0,'','2020-01-01 10:31:46'),(7456,'MEMBER_NEWFORM_FORCETYPE',1,'1','chaine',0,'','2020-01-01 10:31:46'),(7470,'STRIPE_TEST_PUBLISHABLE_KEY',1,'pk_test_123456789','chaine',0,'','2020-01-01 11:43:44'),(7471,'STRIPE_TEST_SECRET_KEY',1,'sk_test_123456','chaine',0,'','2020-01-01 11:43:44'),(7472,'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS',1,'4','chaine',0,'','2020-01-01 11:43:44'),(7473,'STRIPE_USER_ACCOUNT_FOR_ACTIONS',1,'1','chaine',0,'','2020-01-01 11:43:44'),(7489,'CAPTURESERVER_SECURITY_KEY',1,'securitykey123','chaine',0,'','2020-01-01 12:00:49'),(8136,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_DELETE',1,'1','chaine',0,'','2020-01-02 19:56:28'),(8190,'ACCOUNTING_PRODUCT_MODE',1,'ACCOUNTANCY_SELL_EXPORT','chaine',0,'','2020-01-06 01:23:30'),(8191,'MAIN_ENABLE_DEFAULT_VALUES',1,'1','chaine',0,'','2020-01-06 16:09:52'),(8210,'CABINETMED_RHEUMATOLOGY_ON',1,'0','texte',0,'','2020-01-06 16:51:43'),(8213,'MAIN_SEARCHFORM_SOCIETE',1,'1','texte',0,'','2020-01-06 16:51:43'),(8214,'CABINETMED_BANK_PATIENT_REQUIRED',1,'0','texte',0,'','2020-01-06 16:51:43'),(8215,'DIAGNOSTIC_IS_NOT_MANDATORY',1,'1','texte',0,'','2020-01-06 16:51:43'),(8216,'USER_ADDON_PDF_ODT',1,'generic_user_odt','chaine',0,'','2020-01-07 13:45:19'),(8217,'USERGROUP_ADDON_PDF_ODT',1,'generic_usergroup_odt','chaine',0,'','2020-01-07 13:45:23'),(8230,'MAIN_MODULE_EMAILCOLLECTOR',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-12 20:13:55'),(8232,'MAIN_MODULE_SUPPLIERPROPOSAL',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-13 14:37:09'),(8233,'MAIN_MODULE_EXPEDITION',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-13 14:38:20'),(8252,'SYSTEMTOOLS_MYSQLDUMP',1,'/usr/bin/mysqldump','chaine',0,'','2020-01-15 15:42:41'),(8259,'ACCOUNTING_REEXPORT',1,'1','yesno',0,'','2020-01-17 13:42:56'),(8291,'PRODUIT_MULTIPRICES_LIMIT',1,'5','chaine',0,'','2020-01-17 14:21:46'),(8293,'PRODUIT_CUSTOMER_PRICES_BY_QTY',1,'0','chaine',0,'','2020-01-17 14:21:46'),(8303,'PRODUCT_PRICE_UNIQ',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8304,'PRODUIT_MULTIPRICES',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8305,'PRODUIT_CUSTOMER_PRICES',1,'1','chaine',0,'','2020-01-17 14:25:30'),(8306,'PRODUIT_SOUSPRODUITS',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8307,'PRODUIT_DESC_IN_FORM',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8308,'PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8309,'PRODUIT_USE_SEARCH_TO_SELECT',1,'1','chaine',0,'','2020-01-17 14:25:30'),(8310,'PRODUIT_FOURN_TEXTS',1,'0','chaine',0,'','2020-01-17 14:25:30'),(8313,'MAIN_MODULE_FCKEDITOR',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-01-18 17:13:27'),(8314,'FCKEDITOR_ENABLE_TICKET',1,'1','chaine',0,'','2020-01-18 19:39:54'),(8321,'FCKEDITOR_SKIN',1,'moono-lisa','chaine',0,'','2020-01-18 19:41:15'),(8322,'FCKEDITOR_TEST',1,'Test < aaa
\r\n
\r\n\"\"','chaine',0,'','2020-01-18 19:41:15'),(8486,'MAIN_MULTILANGS',1,'1','chaine',0,'','2020-01-21 09:40:00'),(8491,'MAIN_DISABLE_JAVASCRIPT',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8492,'MAIN_BUTTON_HIDE_UNAUTHORIZED',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8496,'MAIN_SHOW_LOGO',1,'1','chaine',0,'','2020-01-21 09:40:00'),(8498,'MAIN_HELPCENTER_DISABLELINK',0,'0','chaine',0,'','2020-01-21 09:40:00'),(8501,'MAIN_BUGTRACK_ENABLELINK',1,'0','chaine',0,'','2020-01-21 09:40:00'),(8554,'MAIN_INFO_SOCIETE_FACEBOOK_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8555,'MAIN_INFO_SOCIETE_TWITTER_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8556,'MAIN_INFO_SOCIETE_LINKEDIN_URL',1,'https://www.linkedin.com/company/9400559/admin/','chaine',0,'','2020-06-12 17:24:42'),(8557,'MAIN_INFO_SOCIETE_INSTAGRAM_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8558,'MAIN_INFO_SOCIETE_YOUTUBE_URL',1,'DolibarrERPCRM','chaine',0,'','2020-06-12 17:24:42'),(8559,'MAIN_INFO_SOCIETE_GITHUB_URL',1,'dolibarr','chaine',0,'','2020-06-12 17:24:42'),(8577,'PRODUCT_PRICE_BASE_TYPE',0,'HT','string',0,NULL,'2020-12-10 12:24:38'),(8612,'MAIN_UPLOAD_DOC',1,'50000','chaine',0,'','2020-12-10 12:26:31'),(8613,'MAIN_UMASK',1,'0664','chaine',0,'','2020-12-10 12:26:31'),(8614,'MAIN_ANTIVIRUS_PARAM',1,'--fdpass','chaine',0,'','2020-12-10 12:26:31'),(8619,'WEBSITE_EDITINLINE',1,'0','chaine',0,'','2020-12-10 12:27:05'),(8620,'WEBSITE_SUBCONTAINERSINLINE',1,'1','chaine',0,'','2020-12-10 12:27:17'),(8633,'MAIN_MODULE_RECEPTION',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:30:13'),(8634,'RECEPTION_ADDON_PDF',1,'squille','chaine',0,'Nom du gestionnaire de generation des bons receptions en PDF','2020-12-10 12:30:13'),(8635,'RECEPTION_ADDON_NUMBER',1,'mod_reception_beryl','chaine',0,'Name for numbering manager for receptions','2020-12-10 12:30:13'),(8636,'RECEPTION_ADDON_PDF_ODT_PATH',1,'DOL_DATA_ROOT/doctemplates/receptions','chaine',0,NULL,'2020-12-10 12:30:13'),(8637,'MAIN_SUBMODULE_RECEPTION',1,'1','chaine',0,'Enable receptions','2020-12-10 12:30:13'),(8638,'MAIN_MODULE_PAYMENTBYBANKTRANSFER',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:30:17'),(8640,'MAIN_MODULE_MARGIN_TABS_0',1,'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__','chaine',0,NULL,'2020-12-10 12:30:20'),(8641,'MAIN_MODULE_MARGIN_TABS_1',1,'thirdparty:+margin:Margins:margins:empty($user->socid) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__','chaine',0,NULL,'2020-12-10 12:30:20'),(8643,'MAIN_MODULE_BLOCKEDLOG',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:31:17'),(8644,'MAIN_MODULE_INCOTERM',1,'1','string',0,'{\"authorid\":\"12\",\"ip\":\"127.0.0.1\"}','2020-12-10 12:31:36'),(8645,'INCOTERM_ACTIVATE',1,'','chaine',0,'Description de INCOTERM_ACTIVATE','2020-12-10 12:31:36'),(8715,'SYSLOG_LEVEL',0,'5','chaine',0,'','2021-04-15 10:34:05'),(8716,'MAIN_SECURITY_HASH_ALGO',1,'password_hash','chaine',1,'','2021-04-15 10:38:33'),(8717,'MAIN_INFO_SOCIETE_COUNTRY',1,'117:IN:India','chaine',0,'','2021-04-15 10:46:30'),(8718,'MAIN_INFO_SOCIETE_NOM',1,'MyBigCompany','chaine',0,'','2021-04-15 10:46:30'),(8719,'MAIN_INFO_SOCIETE_ADDRESS',1,'21 Jump street.','chaine',0,'','2021-04-15 10:46:30'),(8720,'MAIN_INFO_SOCIETE_TOWN',1,'MyTown','chaine',0,'','2021-04-15 10:46:30'),(8721,'MAIN_INFO_SOCIETE_ZIP',1,'75500','chaine',0,'','2021-04-15 10:46:30'),(8722,'MAIN_MONNAIE',1,'EUR','chaine',0,'','2021-04-15 10:46:30'),(8723,'MAIN_INFO_SOCIETE_TEL',1,'09123123','chaine',0,'','2021-04-15 10:46:30'),(8724,'MAIN_INFO_SOCIETE_FAX',1,'09123124','chaine',0,'','2021-04-15 10:46:30'),(8725,'MAIN_INFO_SOCIETE_MAIL',1,'myemail@mybigcompany.com','chaine',0,'','2021-04-15 10:46:30'),(8726,'MAIN_INFO_SOCIETE_WEB',1,'https://www.dolibarr.org','chaine',0,'','2021-04-15 10:46:30'),(8727,'MAIN_INFO_SOCIETE_NOTE',1,'This is note about my company','chaine',0,'','2021-04-15 10:46:30'),(8728,'MAIN_INFO_SOCIETE_LOGO_SQUARRED',1,'mybigcompany_squarred.png','chaine',0,'','2021-04-15 10:46:30'),(8729,'MAIN_INFO_SOCIETE_LOGO_SQUARRED_SMALL',1,'mybigcompany_squarred_small.png','chaine',0,'','2021-04-15 10:46:30'),(8730,'MAIN_INFO_SOCIETE_LOGO_SQUARRED_MINI',1,'mybigcompany_squarred_mini.png','chaine',0,'','2021-04-15 10:46:30'),(8731,'MAIN_INFO_SOCIETE_MANAGERS',1,'Zack Zeceo','chaine',0,'','2021-04-15 10:46:30'),(8732,'MAIN_INFO_GDPR',1,'Zack Zeceo','chaine',0,'','2021-04-15 10:46:30'),(8733,'MAIN_INFO_CAPITAL',1,'10000','chaine',0,'','2021-04-15 10:46:30'),(8734,'MAIN_INFO_SOCIETE_FORME_JURIDIQUE',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8735,'MAIN_INFO_SIREN',1,'123456','chaine',0,'','2021-04-15 10:46:30'),(8736,'MAIN_INFO_SIRET',1,'ABC-DEF','chaine',0,'','2021-04-15 10:46:30'),(8737,'MAIN_INFO_APE',1,'15E-45-8D','chaine',0,'','2021-04-15 10:46:30'),(8738,'MAIN_INFO_TVAINTRA',1,'FR12345678','chaine',0,'','2021-04-15 10:46:30'),(8739,'MAIN_INFO_SOCIETE_OBJECT',1,'A company demo to show how Dolibarr ERP CRM is wonderfull','chaine',0,'','2021-04-15 10:46:30'),(8740,'SOCIETE_FISCAL_MONTH_START',1,'4','chaine',0,'','2021-04-15 10:46:30'),(8741,'FACTURE_TVAOPTION',1,'1','chaine',0,'','2021-04-15 10:46:30'),(8742,'FACTURE_LOCAL_TAX1_OPTION',1,'localtax1on','chaine',0,'','2021-04-15 10:46:30'),(8743,'FACTURE_LOCAL_TAX2_OPTION',1,'localtax2on','chaine',0,'','2021-04-15 10:46:30'),(8744,'MAIN_INFO_VALUE_LOCALTAX1',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8745,'MAIN_INFO_LOCALTAX_CALC1',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8746,'MAIN_INFO_VALUE_LOCALTAX2',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8747,'MAIN_INFO_LOCALTAX_CALC2',1,'0','chaine',0,'','2021-04-15 10:46:30'),(8759,'MAIN_LOGIN_BACKGROUND',1,'background_dolibarr.jpg','chaine',0,'','2021-04-15 10:54:37'),(8760,'MAIN_LANG_DEFAULT',1,'auto','chaine',0,'','2021-04-15 10:56:30'),(8761,'MAIN_IHM_PARAMS_REV',1,'13','chaine',0,'','2021-04-15 10:56:30'),(8762,'MAIN_THEME',1,'eldy','chaine',0,'','2021-04-15 10:56:30'),(8763,'THEME_ELDY_USE_HOVER',1,'237,244,251','chaine',0,'','2021-04-15 10:56:30'),(8764,'MAIN_SIZE_LISTE_LIMIT',1,'25','chaine',0,'','2021-04-15 10:56:30'),(8765,'MAIN_SIZE_SHORTLIST_LIMIT',1,'3','chaine',0,'','2021-04-15 10:56:30'),(8766,'MAIN_START_WEEK',1,'1','chaine',0,'','2021-04-15 10:56:30'),(8767,'MAIN_DEFAULT_WORKING_DAYS',1,'1-5','chaine',0,'','2021-04-15 10:56:30'),(8768,'MAIN_DEFAULT_WORKING_HOURS',1,'9-18','chaine',0,'','2021-04-15 10:56:30'),(8769,'MAIN_FIRSTNAME_NAME_POSITION',1,'0','chaine',0,'','2021-04-15 10:56:30'),(8770,'MAIN_HOME',1,'__(NoteSomeFeaturesAreDisabled)__
\r\n__(SomeTranslationAreUncomplete)__','chaine',0,'','2021-04-15 10:56:30'),(8771,'MAIN_FEATURES_LEVEL',0,'0','chaine',1,'Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development','2021-04-15 11:46:30'),(8775,'MAIN_AGENDA_ACTIONAUTO_COMPANY_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8776,'MAIN_AGENDA_ACTIONAUTO_COMPANY_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8777,'MAIN_AGENDA_ACTIONAUTO_COMPANY_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8778,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_REFUSED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8779,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8780,'MAIN_AGENDA_ACTIONAUTO_PROPAL_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8781,'MAIN_AGENDA_ACTIONAUTO_PROPAL_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8782,'MAIN_AGENDA_ACTIONAUTO_PROPAL_CLOSE_SIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8783,'MAIN_AGENDA_ACTIONAUTO_PROPAL_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8784,'MAIN_AGENDA_ACTIONAUTO_ORDER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8785,'MAIN_AGENDA_ACTIONAUTO_ORDER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8786,'MAIN_AGENDA_ACTIONAUTO_ORDER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8787,'MAIN_AGENDA_ACTIONAUTO_ORDER_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8788,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8789,'MAIN_AGENDA_ACTIONAUTO_ORDER_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8790,'MAIN_AGENDA_ACTIONAUTO_BILL_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8791,'MAIN_AGENDA_ACTIONAUTO_BILL_PAYED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8792,'MAIN_AGENDA_ACTIONAUTO_BILL_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8793,'MAIN_AGENDA_ACTIONAUTO_BILL_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8794,'MAIN_AGENDA_ACTIONAUTO_BILL_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8795,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8796,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8797,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8798,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_CLOSE_SIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8799,'MAIN_AGENDA_ACTIONAUTO_PROPOSAL_SUPPLIER_CLOSE_REFUSED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8800,'MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8801,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8802,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8803,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8804,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_RECEIVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8805,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SUBMIT',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8806,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_REFUSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8807,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_CLASSIFY_BILLED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8808,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8809,'MAIN_AGENDA_ACTIONAUTO_ORDER_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8810,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8811,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8812,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_PAYED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8813,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8814,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_CANCELED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8815,'MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8816,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8817,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8818,'MAIN_AGENDA_ACTIONAUTO_CONTRACT_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8819,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8820,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8821,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_REOPEN',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8822,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8823,'MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8824,'MAIN_AGENDA_ACTIONAUTO_MEMBER_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8825,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8826,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8827,'MAIN_AGENDA_ACTIONAUTO_MEMBER_RESILIATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8828,'MAIN_AGENDA_ACTIONAUTO_MEMBER_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8829,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8830,'MAIN_AGENDA_ACTIONAUTO_MEMBER_SUBSCRIPTION_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8831,'MAIN_AGENDA_ACTIONAUTO_MEMBER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8832,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8833,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8834,'MAIN_AGENDA_ACTIONAUTO_PRODUCT_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8835,'MAIN_AGENDA_ACTIONAUTO_TASK_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8836,'MAIN_AGENDA_ACTIONAUTO_FICHINTER_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8837,'MAIN_AGENDA_ACTIONAUTO_TASK_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8838,'MAIN_AGENDA_ACTIONAUTO_TASK_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8839,'MAIN_AGENDA_ACTIONAUTO_CONTACT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8840,'MAIN_AGENDA_ACTIONAUTO_CONTACT_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8841,'MAIN_AGENDA_ACTIONAUTO_CONTACT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8842,'MAIN_AGENDA_ACTIONAUTO_PROJECT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8843,'MAIN_AGENDA_ACTIONAUTO_PROJECT_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8844,'MAIN_AGENDA_ACTIONAUTO_PROJECT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8845,'MAIN_AGENDA_ACTIONAUTO_TICKET_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8846,'MAIN_AGENDA_ACTIONAUTO_TICKET_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8847,'MAIN_AGENDA_ACTIONAUTO_TICKET_ASSIGNED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8848,'MAIN_AGENDA_ACTIONAUTO_TICKET_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8849,'MAIN_AGENDA_ACTIONAUTO_TICKET_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8850,'MAIN_AGENDA_ACTIONAUTO_TICKET_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8851,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8852,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8853,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8854,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8855,'MAIN_AGENDA_ACTIONAUTO_EXPENSE_REPORT_PAID',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8856,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8857,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8858,'MAIN_AGENDA_ACTIONAUTO_HOLIDAY_APPROVE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8859,'MAIN_AGENDA_ACTIONAUTO_USER_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8860,'MAIN_AGENDA_ACTIONAUTO_BOM_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8861,'MAIN_AGENDA_ACTIONAUTO_BOM_UNVALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8862,'MAIN_AGENDA_ACTIONAUTO_BOM_CLOSE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8863,'MAIN_AGENDA_ACTIONAUTO_BOM_REOPEN',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8864,'MAIN_AGENDA_ACTIONAUTO_BOM_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8865,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_VALIDATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8866,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_PRODUCED',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8867,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8868,'MAIN_AGENDA_ACTIONAUTO_MRP_MO_CANCEL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8869,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8870,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8871,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8872,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTJOBPOSITION_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8873,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_CREATE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8874,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_MODIFY',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8875,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_SENTBYMAIL',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8876,'MAIN_AGENDA_ACTIONAUTO_RECRUITMENTCANDIDATURE_DELETE',1,'1','chaine',0,'','2021-04-15 13:32:12'),(8877,'AGENDA_REMINDER_BROWSER',1,'1','chaine',0,'','2021-04-15 13:32:29'),(8878,'MAIN_MODULE_ACCOUNTING',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:45'),(8879,'MAIN_MODULE_AGENDA',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:45'),(8880,'MAIN_MODULE_BOM',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8881,'MAIN_MODULE_BANQUE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8882,'MAIN_MODULE_BARCODE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8883,'MAIN_MODULE_CRON',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8884,'MAIN_MODULE_COMMANDE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8885,'MAIN_MODULE_DON',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8886,'MAIN_MODULE_ECM',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8887,'MAIN_MODULE_EXPENSEREPORT',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8888,'MAIN_MODULE_FACTURE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8889,'MAIN_MODULE_FOURNISSEUR',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8890,'MAIN_MODULE_HOLIDAY',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:46'),(8891,'MAIN_MODULE_MARGIN',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8894,'MAIN_MODULE_MRP',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8895,'MAIN_MODULE_MRP_TRIGGERS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8896,'MAIN_MODULE_MRP_LOGIN',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8897,'MAIN_MODULE_MRP_SUBSTITUTIONS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8898,'MAIN_MODULE_MRP_MENUS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8899,'MAIN_MODULE_MRP_TPL',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8900,'MAIN_MODULE_MRP_BARCODE',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8901,'MAIN_MODULE_MRP_MODELS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8902,'MAIN_MODULE_MRP_THEME',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8903,'MAIN_MODULE_MRP_MODULEFOREXTERNAL',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8904,'MAIN_MODULE_OPENSURVEY',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8905,'MAIN_MODULE_PRINTING',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8906,'MAIN_MODULE_RECRUITMENT',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8907,'MAIN_MODULE_RECRUITMENT_TRIGGERS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8908,'MAIN_MODULE_RECRUITMENT_LOGIN',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8909,'MAIN_MODULE_RECRUITMENT_SUBSTITUTIONS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8910,'MAIN_MODULE_RECRUITMENT_MENUS',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8911,'MAIN_MODULE_RECRUITMENT_TPL',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8912,'MAIN_MODULE_RECRUITMENT_BARCODE',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8913,'MAIN_MODULE_RECRUITMENT_MODELS',1,'1','chaine',0,NULL,'2021-07-11 17:49:47'),(8914,'MAIN_MODULE_RECRUITMENT_THEME',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8915,'MAIN_MODULE_RECRUITMENT_MODULEFOREXTERNAL',1,'0','chaine',0,NULL,'2021-07-11 17:49:47'),(8916,'MAIN_MODULE_RESOURCE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8917,'MAIN_MODULE_SALARIES',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8918,'MAIN_MODULE_SERVICE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8919,'MAIN_MODULE_SYSLOG',0,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8920,'MAIN_MODULE_SOCIETE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8921,'MAIN_MODULE_STRIPE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8922,'MAIN_MODULE_TICKET',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:47'),(8923,'MAIN_MODULE_TICKET_TABS_0',1,'thirdparty:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?socid=__ID__','chaine',0,NULL,'2021-07-11 17:49:47'),(8924,'MAIN_MODULE_TICKET_TABS_1',1,'project:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__','chaine',0,NULL,'2021-07-11 17:49:47'),(8925,'MAIN_MODULE_TICKET_TRIGGERS',1,'1','chaine',0,NULL,'2021-07-11 17:49:47'),(8926,'TAKEPOS_PRINT_METHOD',1,'browser','chaine',0,'','2021-07-11 17:49:47'),(8927,'MAIN_MODULE_TAKEPOS',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:48'),(8928,'MAIN_MODULE_TAKEPOS_TRIGGERS',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8929,'MAIN_MODULE_TAKEPOS_LOGIN',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8930,'MAIN_MODULE_TAKEPOS_SUBSTITUTIONS',1,'1','chaine',0,NULL,'2021-07-11 17:49:48'),(8931,'MAIN_MODULE_TAKEPOS_MENUS',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8932,'MAIN_MODULE_TAKEPOS_THEME',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8933,'MAIN_MODULE_TAKEPOS_TPL',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8934,'MAIN_MODULE_TAKEPOS_BARCODE',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8935,'MAIN_MODULE_TAKEPOS_MODELS',1,'0','chaine',0,NULL,'2021-07-11 17:49:48'),(8936,'MAIN_MODULE_USER',0,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:48'),(8937,'MAIN_MODULE_VARIANTS',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:48'),(8938,'MAIN_MODULE_WEBSITE',1,'1','string',0,'{\"authorid\":0,\"ip\":\"127.0.0.1\"}','2021-07-11 17:49:48'),(8939,'MAIN_VERSION_LAST_UPGRADE',0,'14.0.0','chaine',0,'Dolibarr version for last upgrade','2021-07-11 17:49:49'),(8941,'MAIN_FIRST_PING_OK_DATE',1,'20210711174950','chaine',0,'','2021-07-11 17:49:50'),(8942,'MAIN_FIRST_PING_OK_ID',1,'9646d6c55a34bca208868c98dac4678b','chaine',0,'','2021-07-11 17:49:50'); /*!40000 ALTER TABLE `llx_const` ENABLE KEYS */; UNLOCK TABLES; @@ -5206,7 +4930,7 @@ CREATE TABLE `llx_cronjob` ( `test` varchar(255) COLLATE utf8_unicode_ci DEFAULT '1', `processing` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -5215,38 +4939,10 @@ CREATE TABLE `llx_cronjob` ( LOCK TABLES `llx_cronjob` WRITE; /*!40000 ALTER TABLE `llx_cronjob` DISABLE KEYS */; -INSERT INTO `llx_cronjob` VALUES (1,'2015-03-23 18:18:39','2015-03-23 19:18:39','command','aaa','aaaa','','','','','','',0,NULL,NULL,'2015-03-23 19:18:00',NULL,NULL,NULL,NULL,'3600',3600,0,0,1,1,'',NULL,0,0,0,NULL,'1',0),(40,'2018-11-23 11:58:15','2018-11-23 12:58:15','method','SendEmailsReminders',NULL,'comm/action/class/actioncomm.class.php','ActionComm','sendEmailsReminder',NULL,NULL,'agenda',10,NULL,NULL,'2018-11-23 12:58:15',NULL,NULL,NULL,NULL,'60',10,NULL,1,NULL,NULL,'SendEMailsReminder',NULL,1,0,0,NULL,'$conf->agenda->enabled',0),(41,'2018-11-23 11:58:16','2018-11-23 12:58:16','method','PurgeDeleteTemporaryFilesShort',NULL,'core/class/utils.class.php','Utils','purgeFiles',NULL,NULL,'cron',50,NULL,NULL,'2018-11-23 12:58:16',NULL,NULL,NULL,NULL,'604800',2,NULL,1,NULL,NULL,'PurgeDeleteTemporaryFiles',NULL,0,0,0,NULL,'1',0),(42,'2020-01-15 15:43:12','2018-11-23 12:58:16','method','MakeLocalDatabaseDumpShort',NULL,'core/class/utils.class.php','Utils','dumpDatabase','none,auto,1,auto,10',NULL,'cron',90,'2020-01-15 19:43:12','2020-01-17 12:58:16','2018-11-23 12:58:16',NULL,'2020-01-15 19:43:12','-1','Failed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir.\nFailed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir.','604800',1,2,1,NULL,12,'MakeLocalDatabaseDump',NULL,0,0,0,NULL,'1',0),(43,'2018-11-23 11:58:17','2018-11-23 12:58:17','method','RecurringInvoices',NULL,'compta/facture/class/facture-rec.class.php','FactureRec','createRecurringInvoices',NULL,NULL,'facture',50,NULL,NULL,'2018-11-23 23:00:00',NULL,NULL,NULL,NULL,'86400',1,NULL,1,NULL,NULL,'Generate recurring invoices',NULL,1,0,0,NULL,'$conf->facture->enabled',0),(45,'2020-01-01 12:00:34','2020-01-01 16:00:34','method','MyJob label',NULL,'/captureserver/class/myobject.class.php','MyObject','doScheduledJob',NULL,NULL,'captureserver',0,NULL,NULL,'2020-01-01 16:00:34',NULL,NULL,NULL,NULL,'3600',2,NULL,0,NULL,NULL,'Comment',NULL,1,0,0,NULL,'$conf->captureserver->enabled',0),(46,'2020-01-12 20:13:55','2020-01-13 00:13:55','method','Email collector',NULL,'/emailcollector/class/emailcollector.class.php','EmailCollector','doCollect',NULL,NULL,'emailcollector',50,NULL,NULL,'2020-01-13 00:13:55',NULL,NULL,NULL,NULL,'60',5,NULL,1,NULL,NULL,'Comment',NULL,1,0,0,NULL,'$conf->emailcollector->enabled',0),(47,'2021-04-15 10:34:00','2021-04-15 07:34:00','method','CompressSyslogs',NULL,'core/class/utils.class.php','Utils','compressSyslogs',NULL,NULL,'syslog',50,NULL,NULL,'2021-04-15 07:34:00',NULL,NULL,NULL,NULL,'86400',1,NULL,0,NULL,NULL,'Compress and archive log files. The number of versions to keep is defined into the setup of module. Warning: Main application cron script must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission \"rws\" on this directory so log files will always have the group and permissions of the web server Operating System group.',NULL,1,0,0,NULL,'1',0); +INSERT INTO `llx_cronjob` VALUES (1,'2015-03-23 18:18:39','2015-03-23 19:18:39','command','aaa','aaaa','','','','','','',0,NULL,NULL,'2015-03-23 19:18:00',NULL,NULL,NULL,NULL,'3600',3600,0,0,1,1,'',NULL,0,0,0,NULL,'1',0),(40,'2018-11-23 11:58:15','2018-11-23 12:58:15','method','SendEmailsReminders',NULL,'comm/action/class/actioncomm.class.php','ActionComm','sendEmailsReminder',NULL,NULL,'agenda',10,NULL,NULL,'2018-11-23 12:58:15',NULL,NULL,NULL,NULL,'60',10,NULL,1,NULL,NULL,'SendEMailsReminder',NULL,1,0,0,NULL,'$conf->agenda->enabled',0),(41,'2018-11-23 11:58:16','2018-11-23 12:58:16','method','PurgeDeleteTemporaryFilesShort',NULL,'core/class/utils.class.php','Utils','purgeFiles',NULL,NULL,'cron',50,NULL,NULL,'2018-11-23 12:58:16',NULL,NULL,NULL,NULL,'604800',2,NULL,1,NULL,NULL,'PurgeDeleteTemporaryFiles',NULL,0,0,0,NULL,'1',0),(42,'2020-01-15 15:43:12','2018-11-23 12:58:16','method','MakeLocalDatabaseDumpShort',NULL,'core/class/utils.class.php','Utils','dumpDatabase','none,auto,1,auto,10',NULL,'cron',90,'2020-01-15 19:43:12','2020-01-17 12:58:16','2018-11-23 12:58:16',NULL,'2020-01-15 19:43:12','-1','Failed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir.\nFailed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir.','604800',1,2,1,NULL,12,'MakeLocalDatabaseDump',NULL,0,0,0,NULL,'1',0),(43,'2018-11-23 11:58:17','2018-11-23 12:58:17','method','RecurringInvoices',NULL,'compta/facture/class/facture-rec.class.php','FactureRec','createRecurringInvoices',NULL,NULL,'facture',50,NULL,NULL,'2018-11-23 23:00:00',NULL,NULL,NULL,NULL,'86400',1,NULL,1,NULL,NULL,'Generate recurring invoices',NULL,1,0,0,NULL,'$conf->facture->enabled',0),(45,'2020-01-01 12:00:34','2020-01-01 16:00:34','method','MyJob label',NULL,'/captureserver/class/myobject.class.php','MyObject','doScheduledJob',NULL,NULL,'captureserver',0,NULL,NULL,'2020-01-01 16:00:34',NULL,NULL,NULL,NULL,'3600',2,NULL,0,NULL,NULL,'Comment',NULL,1,0,0,NULL,'$conf->captureserver->enabled',0),(46,'2020-01-12 20:13:55','2020-01-13 00:13:55','method','Email collector',NULL,'/emailcollector/class/emailcollector.class.php','EmailCollector','doCollect',NULL,NULL,'emailcollector',50,NULL,NULL,'2020-01-13 00:13:55',NULL,NULL,NULL,NULL,'60',5,NULL,1,NULL,NULL,'Comment',NULL,1,0,0,NULL,'$conf->emailcollector->enabled',0),(47,'2021-04-15 10:34:00','2021-04-15 07:34:00','method','CompressSyslogs',NULL,'core/class/utils.class.php','Utils','compressSyslogs',NULL,NULL,'syslog',50,NULL,NULL,'2021-04-15 07:34:00',NULL,NULL,NULL,NULL,'86400',1,NULL,0,NULL,NULL,'Compress and archive log files. The number of versions to keep is defined into the setup of module. Warning: Main application cron script must be run with same account than your web server to avoid to get log files with different owner than required by web server. Another solution is to set web server Operating System group as the group of directory documents and set GROUP permission \"rws\" on this directory so log files will always have the group and permissions of the web server Operating System group.',NULL,1,0,0,NULL,'1',0),(48,'2021-07-11 17:49:46','2021-07-11 19:49:46','method','SendEmailsRemindersOnInvoiceDueDate',NULL,'compta/facture/class/facture.class.php','Facture','sendEmailsRemindersOnInvoiceDueDate','10,all,EmailTemplateCode',NULL,'facture',50,NULL,NULL,'2021-07-11 23:00:00',NULL,NULL,NULL,NULL,'86400',1,NULL,0,NULL,NULL,'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is \"all\" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).',NULL,1,0,0,NULL,'$conf->facture->enabled',0); /*!40000 ALTER TABLE `llx_cronjob` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_cv_recrutement` --- - -DROP TABLE IF EXISTS `llx_cv_recrutement`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_cv_recrutement` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `nom` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `fichier` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `poste` int(11) DEFAULT NULL, - `candidature` int(11) DEFAULT NULL, - `type` varchar(20) CHARACTER SET utf8mb4 DEFAULT NULL, - `date` date DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_cv_recrutement` --- - -LOCK TABLES `llx_cv_recrutement` WRITE; -/*!40000 ALTER TABLE `llx_cv_recrutement` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_cv_recrutement` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_default_values` -- @@ -5414,31 +5110,6 @@ LOCK TABLES `llx_deliverydet_extrafields` WRITE; /*!40000 ALTER TABLE `llx_deliverydet_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_departements` --- - -DROP TABLE IF EXISTS `llx_departements`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_departements` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(355) CHARACTER SET utf8mb4 DEFAULT NULL, - `gestionnaire` int(11) NOT NULL, - PRIMARY KEY (`rowid`), - KEY `gestionnaire` (`gestionnaire`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_departements` --- - -LOCK TABLES `llx_departements` WRITE; -/*!40000 ALTER TABLE `llx_departements` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_departements` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_deplacement` -- @@ -5478,70 +5149,6 @@ INSERT INTO `llx_deplacement` VALUES (1,NULL,1,'2012-07-09 01:58:04','2012-07-08 /*!40000 ALTER TABLE `llx_deplacement` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_dispatch` --- - -DROP TABLE IF EXISTS `llx_dispatch`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_dispatch` ( - `rowid` int(11) NOT NULL DEFAULT 0, - `date_cre` datetime DEFAULT NULL, - `date_maj` datetime DEFAULT NULL, - `fk_object` int(11) NOT NULL DEFAULT 0, - `type_object` varchar(30) CHARACTER SET latin1 DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `date_cre` (`date_cre`), - KEY `date_maj` (`date_maj`), - KEY `fk_object` (`fk_object`), - KEY `type_object` (`type_object`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_dispatch` --- - -LOCK TABLES `llx_dispatch` WRITE; -/*!40000 ALTER TABLE `llx_dispatch` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_dispatch` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_dispatch_asset` --- - -DROP TABLE IF EXISTS `llx_dispatch_asset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_dispatch_asset` ( - `rowid` int(11) NOT NULL DEFAULT 0, - `date_cre` datetime DEFAULT NULL, - `date_maj` datetime DEFAULT NULL, - `fk_object` int(11) NOT NULL DEFAULT 0, - `fk_dispatch` int(11) NOT NULL DEFAULT 0, - `fk_asset` int(11) NOT NULL DEFAULT 0, - `type_object` varchar(30) CHARACTER SET latin1 DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `date_cre` (`date_cre`), - KEY `date_maj` (`date_maj`), - KEY `fk_object` (`fk_object`), - KEY `fk_dispatch` (`fk_dispatch`), - KEY `fk_asset` (`fk_asset`), - KEY `type_object` (`type_object`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_dispatch_asset` --- - -LOCK TABLES `llx_dispatch_asset` WRITE; -/*!40000 ALTER TABLE `llx_dispatch_asset` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_dispatch_asset` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_document_model` -- @@ -5558,7 +5165,7 @@ CREATE TABLE `llx_document_model` ( `description` text COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_document_model` (`nom`,`type`,`entity`) -) ENGINE=InnoDB AUTO_INCREMENT=402 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=410 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -5567,7 +5174,7 @@ CREATE TABLE `llx_document_model` ( LOCK TABLES `llx_document_model` WRITE; /*!40000 ALTER TABLE `llx_document_model` DISABLE KEYS */; -INSERT INTO `llx_document_model` VALUES (9,'merou',1,'shipping',NULL,NULL),(181,'generic_invoice_odt',1,'invoice','ODT templates','FACTURE_ADDON_PDF_ODT_PATH'),(193,'canelle2',1,'invoice_supplier','canelle2',NULL),(195,'canelle',1,'invoice_supplier','canelle',NULL),(198,'azur',2,'propal',NULL,NULL),(199,'html_cerfafr',2,'donation',NULL,NULL),(200,'crabe',2,'invoice',NULL,NULL),(201,'generic_odt',1,'company','ODT templates','COMPANY_ADDON_PDF_ODT_PATH'),(250,'baleine',1,'project',NULL,NULL),(255,'soleil',1,'ficheinter',NULL,NULL),(256,'azur',1,'propal',NULL,NULL),(273,'beluga',1,'project','beluga',NULL),(281,'sepamandate',1,'bankaccount','sepamandate',NULL),(299,'standard',1,'member',NULL,NULL),(319,'generic_bom_odt',1,'bom','ODT templates','BOM_ADDON_PDF_ODT_PATH'),(320,'generic_mo_odt',1,'mrp','ODT templates','MRP_MO_ADDON_PDF_ODT_PATH'),(366,'generic_user_odt',1,'user',NULL,NULL),(367,'generic_usergroup_odt',1,'group',NULL,NULL),(370,'aurore',1,'supplier_proposal',NULL,NULL),(371,'rouget',1,'shipping',NULL,NULL),(372,'typhon',1,'delivery',NULL,NULL),(393,'squille',1,'reception',NULL,NULL),(394,'einstein',1,'order',NULL,NULL),(395,'html_cerfafr',1,'donation',NULL,NULL),(396,'standard',1,'expensereport',NULL,NULL),(397,'crabe',1,'invoice',NULL,NULL),(398,'muscadet',1,'order_supplier',NULL,NULL),(399,'standard_recruitmentjobposition',1,'recruitmentjobposition',NULL,NULL),(400,'generic_recruitmentjobposition_odt',1,'recruitmentjobposition',NULL,NULL),(401,'TICKET_ADDON_PDF_ODT_PATH',1,'ticket',NULL,NULL); +INSERT INTO `llx_document_model` VALUES (9,'merou',1,'shipping',NULL,NULL),(181,'generic_invoice_odt',1,'invoice','ODT templates','FACTURE_ADDON_PDF_ODT_PATH'),(193,'canelle2',1,'invoice_supplier','canelle2',NULL),(195,'canelle',1,'invoice_supplier','canelle',NULL),(198,'azur',2,'propal',NULL,NULL),(199,'html_cerfafr',2,'donation',NULL,NULL),(200,'crabe',2,'invoice',NULL,NULL),(201,'generic_odt',1,'company','ODT templates','COMPANY_ADDON_PDF_ODT_PATH'),(250,'baleine',1,'project',NULL,NULL),(255,'soleil',1,'ficheinter',NULL,NULL),(256,'azur',1,'propal',NULL,NULL),(273,'beluga',1,'project','beluga',NULL),(281,'sepamandate',1,'bankaccount','sepamandate',NULL),(299,'standard',1,'member',NULL,NULL),(319,'generic_bom_odt',1,'bom','ODT templates','BOM_ADDON_PDF_ODT_PATH'),(320,'generic_mo_odt',1,'mrp','ODT templates','MRP_MO_ADDON_PDF_ODT_PATH'),(366,'generic_user_odt',1,'user',NULL,NULL),(367,'generic_usergroup_odt',1,'group',NULL,NULL),(370,'aurore',1,'supplier_proposal',NULL,NULL),(371,'rouget',1,'shipping',NULL,NULL),(372,'typhon',1,'delivery',NULL,NULL),(393,'squille',1,'reception',NULL,NULL),(402,'einstein',1,'order',NULL,NULL),(403,'html_cerfafr',1,'donation',NULL,NULL),(404,'standard',1,'expensereport',NULL,NULL),(405,'crabe',1,'invoice',NULL,NULL),(406,'muscadet',1,'order_supplier',NULL,NULL),(407,'standard_recruitmentjobposition',1,'recruitmentjobposition',NULL,NULL),(408,'generic_recruitmentjobposition_odt',1,'recruitmentjobposition',NULL,NULL),(409,'TICKET_ADDON_PDF_ODT_PATH',1,'ticket',NULL,NULL); /*!40000 ALTER TABLE `llx_document_model` ENABLE KEYS */; UNLOCK TABLES; @@ -5705,10 +5312,10 @@ CREATE TABLE `llx_ecm_directories_extrafields` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `fk_object` int(11) NOT NULL, - `import_key` varchar(14) DEFAULT NULL, + `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`rowid`), KEY `idx_ecm_directories_extrafields` (`fk_object`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -5779,10 +5386,10 @@ CREATE TABLE `llx_ecm_files_extrafields` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `fk_object` int(11) NOT NULL, - `import_key` varchar(14) DEFAULT NULL, + `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`rowid`), KEY `idx_ecm_files_extrafields` (`fk_object`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -5855,33 +5462,6 @@ INSERT INTO `llx_element_element` VALUES (4,1,'order_supplier',20,'invoice_suppl /*!40000 ALTER TABLE `llx_element_element` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_element_lock` --- - -DROP TABLE IF EXISTS `llx_element_lock`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_element_lock` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_element` int(11) NOT NULL, - `elementtype` varchar(32) COLLATE utf8_unicode_ci NOT NULL, - `datel` datetime DEFAULT NULL, - `datem` datetime DEFAULT NULL, - `sessionid` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_element_lock` --- - -LOCK TABLES `llx_element_lock` WRITE; -/*!40000 ALTER TABLE `llx_element_lock` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_element_lock` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_element_resources` -- @@ -6042,70 +5622,6 @@ INSERT INTO `llx_emailcollector_emailcollectorfilter` VALUES (21,3,'withouttrack /*!40000 ALTER TABLE `llx_emailcollector_emailcollectorfilter` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_emailsenderprofile` --- - -DROP TABLE IF EXISTS `llx_emailsenderprofile`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_emailsenderprofile` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `ref` varchar(64) COLLATE utf8_unicode_ci NOT NULL, - `entity` int(11) NOT NULL DEFAULT 1, - `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `amount` double(24,8) DEFAULT NULL, - `note_public` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL, - `note_private` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL, - `date_creation` datetime NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_user_creat` int(11) NOT NULL, - `fk_user_modif` int(11) DEFAULT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - `status` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_emailsenderprofile_rowid` (`rowid`), - KEY `idx_emailsenderprofile_ref` (`ref`), - KEY `idx_emailsenderprofile_entity` (`entity`), - KEY `idx_emailsenderprofile_import_key` (`import_key`), - KEY `idx_emailsenderprofile_status` (`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_emailsenderprofile` --- - -LOCK TABLES `llx_emailsenderprofile` WRITE; -/*!40000 ALTER TABLE `llx_emailsenderprofile` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_emailsenderprofile` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_emailsenderprofile_extrafields` --- - -DROP TABLE IF EXISTS `llx_emailsenderprofile_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_emailsenderprofile_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_emailsenderprofile_extrafields` --- - -LOCK TABLES `llx_emailsenderprofile_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_emailsenderprofile_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_emailsenderprofile_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_entrepot` -- @@ -6215,55 +5731,6 @@ LOCK TABLES `llx_establishment` WRITE; /*!40000 ALTER TABLE `llx_establishment` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_etapescandidature` --- - -DROP TABLE IF EXISTS `llx_etapescandidature`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_etapescandidature` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `color` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_etapescandidature` --- - -LOCK TABLES `llx_etapescandidature` WRITE; -/*!40000 ALTER TABLE `llx_etapescandidature` DISABLE KEYS */; -INSERT INTO `llx_etapescandidature` VALUES (1,'Qualification_initiale','#DBE270'),(2,'Premier_entretien','#F59A9A'),(3,'Second_entretien','#62B0F7'),(4,'Proposition_contrat','#FFB164'),(5,'Contrat_signe','#59D859'); -/*!40000 ALTER TABLE `llx_etapescandidature` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_etiquettes` --- - -DROP TABLE IF EXISTS `llx_etiquettes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_etiquettes` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `label` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `color` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_etiquettes` --- - -LOCK TABLES `llx_etiquettes` WRITE; -/*!40000 ALTER TABLE `llx_etiquettes` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_etiquettes` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_event_element` -- @@ -6362,140 +5829,6 @@ LOCK TABLES `llx_eventorganization_conferenceorboothattendee_extrafields` WRITE; /*!40000 ALTER TABLE `llx_eventorganization_conferenceorboothattendee_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_eventorganizer_attendee` --- - -DROP TABLE IF EXISTS `llx_eventorganizer_attendee`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_eventorganizer_attendee` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `ref` varchar(128) CHARACTER SET utf8mb4 NOT NULL DEFAULT '(PROV)', - `label` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `amount` double(24,8) DEFAULT NULL, - `qty` double DEFAULT NULL, - `fk_soc` int(11) DEFAULT NULL, - `description` text CHARACTER SET utf8mb4 DEFAULT NULL, - `note_public` text CHARACTER SET utf8mb4 DEFAULT NULL, - `note_private` text CHARACTER SET utf8mb4 DEFAULT NULL, - `date_creation` datetime NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_user_creat` int(11) NOT NULL, - `fk_user_modif` int(11) DEFAULT NULL, - `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, - `status` int(11) NOT NULL, - `fk_eventorganizer` int(11) NOT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_eventorganizer_attendee_rowid` (`rowid`), - KEY `idx_eventorganizer_attendee_ref` (`ref`), - KEY `idx_eventorganizer_attendee_fk_soc` (`fk_soc`), - KEY `idx_eventorganizer_attendee_status` (`status`), - KEY `idx_eventorganizer_attendee_fk_eventorganizer` (`fk_eventorganizer`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_eventorganizer_attendee` --- - -LOCK TABLES `llx_eventorganizer_attendee` WRITE; -/*!40000 ALTER TABLE `llx_eventorganizer_attendee` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_eventorganizer_attendee` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_eventorganizer_attendee_extrafields` --- - -DROP TABLE IF EXISTS `llx_eventorganizer_attendee_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_eventorganizer_attendee_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_eventorganizer_attendee_extrafields` --- - -LOCK TABLES `llx_eventorganizer_attendee_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_eventorganizer_attendee_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_eventorganizer_attendee_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_eventorganizer_organizedevent` --- - -DROP TABLE IF EXISTS `llx_eventorganizer_organizedevent`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_eventorganizer_organizedevent` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `ref` varchar(128) CHARACTER SET utf8mb4 NOT NULL DEFAULT '(PROV)', - `entity` int(11) NOT NULL DEFAULT 1, - `label` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - `amount` double(24,8) DEFAULT NULL, - `qty` double DEFAULT NULL, - `fk_soc` int(11) DEFAULT NULL, - `description` text CHARACTER SET utf8mb4 DEFAULT NULL, - `note_public` text CHARACTER SET utf8mb4 DEFAULT NULL, - `note_private` text CHARACTER SET utf8mb4 DEFAULT NULL, - `date_creation` datetime NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_user_creat` int(11) NOT NULL, - `fk_user_modif` int(11) DEFAULT NULL, - `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, - `status` int(11) NOT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_eventorganizer_organizedevent_rowid` (`rowid`), - KEY `idx_eventorganizer_organizedevent_ref` (`ref`), - KEY `idx_eventorganizer_organizedevent_entity` (`entity`), - KEY `idx_eventorganizer_organizedevent_fk_soc` (`fk_soc`), - KEY `idx_eventorganizer_organizedevent_status` (`status`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_eventorganizer_organizedevent` --- - -LOCK TABLES `llx_eventorganizer_organizedevent` WRITE; -/*!40000 ALTER TABLE `llx_eventorganizer_organizedevent` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_eventorganizer_organizedevent` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_eventorganizer_organizedevent_extrafields` --- - -DROP TABLE IF EXISTS `llx_eventorganizer_organizedevent_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_eventorganizer_organizedevent_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) CHARACTER SET utf8mb4 DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_eventorganizer_organizedevent_extrafields` --- - -LOCK TABLES `llx_eventorganizer_organizedevent_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_eventorganizer_organizedevent_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_eventorganizer_organizedevent_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_events` -- @@ -6625,34 +5958,6 @@ LOCK TABLES `llx_expedition_extrafields` WRITE; /*!40000 ALTER TABLE `llx_expedition_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_expedition_methode` --- - -DROP TABLE IF EXISTS `llx_expedition_methode`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_expedition_methode` ( - `rowid` int(11) NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `code` varchar(30) COLLATE utf8_unicode_ci NOT NULL, - `libelle` varchar(50) COLLATE utf8_unicode_ci NOT NULL, - `description` text COLLATE utf8_unicode_ci DEFAULT NULL, - `active` tinyint(4) DEFAULT 0, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_expedition_methode` --- - -LOCK TABLES `llx_expedition_methode` WRITE; -/*!40000 ALTER TABLE `llx_expedition_methode` DISABLE KEYS */; -INSERT INTO `llx_expedition_methode` VALUES (1,'2012-07-08 11:18:00','CATCH','Catch','Catch by client',1),(2,'2012-07-08 11:18:00','TRANS','Transporter','Generic transporter',1),(3,'2012-07-08 11:18:01','COLSUI','Colissimo Suivi','Colissimo Suivi',0); -/*!40000 ALTER TABLE `llx_expedition_methode` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_expedition_package` -- @@ -6719,46 +6024,6 @@ INSERT INTO `llx_expeditiondet` VALUES (1,1,10,3,1,0),(2,2,226,19,2,0); /*!40000 ALTER TABLE `llx_expeditiondet` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_expeditiondet_asset` --- - -DROP TABLE IF EXISTS `llx_expeditiondet_asset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_expeditiondet_asset` ( - `rowid` int(11) NOT NULL DEFAULT 0, - `date_cre` datetime DEFAULT NULL, - `date_maj` datetime DEFAULT NULL, - `fk_expeditiondet` int(11) NOT NULL DEFAULT 0, - `fk_asset` int(11) NOT NULL DEFAULT 0, - `rang` int(11) NOT NULL DEFAULT 0, - `lot_number` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `carton` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `numerosuivi` varchar(255) CHARACTER SET latin1 DEFAULT NULL, - `weight` double NOT NULL DEFAULT 0, - `weight_reel` double NOT NULL DEFAULT 0, - `tare` double NOT NULL DEFAULT 0, - `weight_unit` int(11) NOT NULL DEFAULT 0, - `weight_reel_unit` int(11) NOT NULL DEFAULT 0, - `tare_unit` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rowid`), - KEY `date_cre` (`date_cre`), - KEY `date_maj` (`date_maj`), - KEY `fk_expeditiondet` (`fk_expeditiondet`), - KEY `fk_asset` (`fk_asset`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_expeditiondet_asset` --- - -LOCK TABLES `llx_expeditiondet_asset` WRITE; -/*!40000 ALTER TABLE `llx_expeditiondet_asset` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_expeditiondet_asset` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_expeditiondet_batch` -- @@ -6858,6 +6123,7 @@ CREATE TABLE `llx_expensereport` ( `integration_compta` int(11) DEFAULT NULL, `fk_bank_account` int(11) DEFAULT NULL, `model_pdf` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `last_main_doc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `fk_multicurrency` int(11) DEFAULT NULL, `multicurrency_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `multicurrency_tx` double(24,8) DEFAULT 1.00000000, @@ -6885,7 +6151,7 @@ CREATE TABLE `llx_expensereport` ( LOCK TABLES `llx_expensereport` WRITE; /*!40000 ALTER TABLE `llx_expensereport` DISABLE KEYS */; -INSERT INTO `llx_expensereport` VALUES (1,'ADMIN-ER00002-150101',1,2,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2021-01-01','2021-01-03','2021-01-22 19:03:37','2021-01-22 19:06:50','2021-02-16 02:12:40',NULL,NULL,'2021-04-15 10:22:31',12,NULL,12,12,12,NULL,NULL,5,NULL,0,'Holidays',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(2,'ER1912-0001',1,NULL,NULL,141.67000000,28.33000000,0.00000000,0.00000000,170.00000000,'2021-02-01','2021-02-28','2021-01-22 19:04:44','2021-12-20 20:34:13','2021-12-20 20:34:19',NULL,'2021-12-21 00:34:26','2021-04-15 10:22:31',12,12,12,12,12,NULL,12,4,NULL,0,'Work on projet X','','','aaaa',NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(3,'(PROV3)',1,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'2021-02-02','2021-02-02','2021-02-02 03:57:03','2021-02-02 00:00:00',NULL,NULL,NULL,'2021-04-15 10:22:31',19,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL); +INSERT INTO `llx_expensereport` VALUES (1,'ADMIN-ER00002-150101',1,2,NULL,8.33000000,1.67000000,0.00000000,0.00000000,10.00000000,'2021-01-01','2021-01-03','2021-01-22 19:03:37','2021-01-22 19:06:50','2021-02-16 02:12:40',NULL,NULL,'2021-04-15 10:22:31',12,NULL,12,12,12,NULL,NULL,5,NULL,0,'Holidays',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(2,'ER1912-0001',1,NULL,NULL,141.67000000,28.33000000,0.00000000,0.00000000,170.00000000,'2021-02-01','2021-02-28','2021-01-22 19:04:44','2021-12-20 20:34:13','2021-12-20 20:34:19',NULL,'2021-12-21 00:34:26','2021-04-15 10:22:31',12,12,12,12,12,NULL,12,4,NULL,0,'Work on projet X','','','aaaa',NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL),(3,'(PROV3)',1,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,'2021-02-02','2021-02-02','2021-02-02 03:57:03','2021-02-02 00:00:00',NULL,NULL,NULL,'2021-04-15 10:22:31',19,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_expensereport` ENABLE KEYS */; UNLOCK TABLES; @@ -7076,9 +6342,10 @@ CREATE TABLE `llx_export_model` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `fk_user` int(11) NOT NULL DEFAULT 0, `label` varchar(50) COLLATE utf8_unicode_ci NOT NULL, - `type` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `field` text COLLATE utf8_unicode_ci NOT NULL, `filter` text COLLATE utf8_unicode_ci DEFAULT NULL, + `entity` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_export_model` (`label`,`type`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -7090,7 +6357,7 @@ CREATE TABLE `llx_export_model` ( LOCK TABLES `llx_export_model` WRITE; /*!40000 ALTER TABLE `llx_export_model` DISABLE KEYS */; -INSERT INTO `llx_export_model` VALUES (1,0,'MyExport','facture_2','s.rowid,s.nom,s.code_client,s.address,s.zip,s.town,c.code,cd.nom,s.phone,s.siren,s.siret,s.ape,s.idprof4,s.code_compta,s.code_compta_fournisseur,s.tva_intra,f.rowid,f.ref,f.ref_client,f.type,f.datec,f.datef,f.date_lim_reglement,f.total,f.total_ttc,f.tva,f.localtax1,f.localtax2,none.rest,f.paye,f.fk_statut,f.note_private,f.note_public,f.fk_user_author,uc.login,f.fk_user_valid,uv.login,pj.ref,pj.title,p.rowid,p.ref,p.amount,pf.amount,p.datep,p.num_paiement,pt.code,pt.libelle,p.note,p.fk_bank,ba.ref,f.multicurrency_code,f.multicurrency_tx,f.multicurrency_total_ht,f.multicurrency_total_tva,f.multicurrency_total_ttc,f.module_source,f.pos_source',''),(2,11,'Export by joe','facture_2','s.rowid,s.nom,s.code_client,s.address,s.zip,s.town,c.code,cd.nom,s.phone,s.siren,s.siret,s.ape,s.idprof4,s.code_compta,s.code_compta_fournisseur,s.tva_intra,f.rowid,f.ref,f.ref_client,f.type,f.datec,f.datef,f.date_lim_reglement,f.total,f.total_ttc,f.tva,f.localtax1,f.localtax2,none.rest,f.paye,f.fk_statut,f.note_private,f.note_public,f.fk_user_author,uc.login,f.fk_user_valid,uv.login,pj.ref,pj.title,p.rowid,p.ref,p.amount,pf.amount,p.datep,p.num_paiement,pt.code,pt.libelle,p.note,p.fk_bank,ba.ref,f.multicurrency_code,f.multicurrency_tx,f.multicurrency_total_ht,f.multicurrency_total_tva,f.multicurrency_total_ttc,f.module_source,f.pos_source',''),(3,12,'test','societe_1','s.rowid,s.nom,s.name_alias,s.status,s.client,s.fournisseur,s.datec,s.tms,s.code_client,s.code_fournisseur,s.code_compta,s.code_compta_fournisseur,s.address,s.zip,s.town,d.nom,c.label,c.code,s.phone,s.fax,s.url,s.email,s.default_lang,s.siren,s.siret,s.ape,s.idprof4,s.idprof5,s.idprof6,s.tva_intra,s.capital,s.note_private,s.note_public,t.libelle,ce.code,cfj.libelle,s.fk_prospectlevel,st.code,payterm.libelle,paymode.libelle,s.price_level,extra.height,extra.weight,extra.prof,extra.birthdate,u.login,u.firstname,u.lastname','s.nom=%a%'); +INSERT INTO `llx_export_model` VALUES (1,0,'MyExport','facture_2','s.rowid,s.nom,s.code_client,s.address,s.zip,s.town,c.code,cd.nom,s.phone,s.siren,s.siret,s.ape,s.idprof4,s.code_compta,s.code_compta_fournisseur,s.tva_intra,f.rowid,f.ref,f.ref_client,f.type,f.datec,f.datef,f.date_lim_reglement,f.total_ht,f.total_ttc,f.total_tva,f.localtax1,f.localtax2,none.rest,f.paye,f.fk_statut,f.note_private,f.note_public,f.fk_user_author,uc.login,f.fk_user_valid,uv.login,pj.ref,pj.title,p.rowid,p.ref,p.amount,pf.amount,p.datep,p.num_paiement,pt.code,pt.libelle,p.note,p.fk_bank,ba.ref,f.multicurrency_code,f.multicurrency_tx,f.multicurrency_total_ht,f.multicurrency_total_tva,f.multicurrency_total_ttc,f.module_source,f.pos_source','',0),(2,11,'Export by joe','facture_2','s.rowid,s.nom,s.code_client,s.address,s.zip,s.town,c.code,cd.nom,s.phone,s.siren,s.siret,s.ape,s.idprof4,s.code_compta,s.code_compta_fournisseur,s.tva_intra,f.rowid,f.ref,f.ref_client,f.type,f.datec,f.datef,f.date_lim_reglement,f.total_ht,f.total_ttc,f.total_tva,f.localtax1,f.localtax2,none.rest,f.paye,f.fk_statut,f.note_private,f.note_public,f.fk_user_author,uc.login,f.fk_user_valid,uv.login,pj.ref,pj.title,p.rowid,p.ref,p.amount,pf.amount,p.datep,p.num_paiement,pt.code,pt.libelle,p.note,p.fk_bank,ba.ref,f.multicurrency_code,f.multicurrency_tx,f.multicurrency_total_ht,f.multicurrency_total_tva,f.multicurrency_total_ttc,f.module_source,f.pos_source','',0),(3,12,'test','societe_1','s.rowid,s.nom,s.name_alias,s.status,s.client,s.fournisseur,s.datec,s.tms,s.code_client,s.code_fournisseur,s.code_compta,s.code_compta_fournisseur,s.address,s.zip,s.town,d.nom,c.label,c.code,s.phone,s.fax,s.url,s.email,s.default_lang,s.siren,s.siret,s.ape,s.idprof4,s.idprof5,s.idprof6,s.tva_intra,s.capital,s.note_private,s.note_public,t.libelle,ce.code,cfj.libelle,s.fk_prospectlevel,st.code,payterm.libelle,paymode.libelle,s.price_level,extra.height,extra.weight,extra.prof,extra.birthdate,u.login,u.firstname,u.lastname','s.nom=%a%',0); /*!40000 ALTER TABLE `llx_export_model` ENABLE KEYS */; UNLOCK TABLES; @@ -7239,7 +6506,7 @@ CREATE TABLE `llx_facture` ( LOCK TABLES `llx_facture` WRITE; /*!40000 ALTER TABLE `llx_facture` DISABLE KEYS */; -INSERT INTO `llx_facture` VALUES (2,'FA1007-0002',1,NULL,NULL,0,NULL,NULL,2,'2012-07-10 18:20:13','2020-07-10',NULL,NULL,'2020-12-10 12:24:22',1,10.00000000,NULL,NULL,0,NULL,NULL,0.10000000,0.00000000,0.00000000,0.00000000,46.00000000,46.10000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-07-10',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(3,'FA1107-0006',1,NULL,NULL,0,NULL,NULL,10,'2013-07-18 20:33:35','2020-07-18',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,15.00000000,15.00000000,2,1,NULL,1,NULL,NULL,1,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(5,'FA1108-0003',1,NULL,NULL,0,NULL,NULL,7,'2013-08-01 03:34:11','2020-08-01',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,6,'2020-08-01',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(6,'FA1108-0004',1,NULL,NULL,0,NULL,NULL,7,'2013-08-06 20:33:53','2020-08-06',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.98000000,0.00000000,0.00000000,0.00000000,5.00000000,5.98000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,4,'2020-08-06','Cash\nReceived : 6 EUR\nRendu : 0.02 EUR\n\n--------------------------------------',NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(8,'FA1108-0005',1,NULL,NULL,3,NULL,NULL,2,'2013-08-08 02:41:44','2020-08-08',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(9,'FA1108-0007',1,NULL,NULL,3,NULL,NULL,10,'2013-08-08 02:55:14','2020-08-08',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(10,'AV1212-0001',1,NULL,NULL,2,NULL,NULL,10,'2014-12-08 17:45:20','2020-12-08','2020-12-08 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,-0.63000000,0.00000000,0.00000000,0.00000000,-11.00000000,-11.63000000,1,1,NULL,1,NULL,3,NULL,NULL,NULL,0,0,'2020-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(12,'AV1212-0002',1,NULL,NULL,2,NULL,NULL,10,'2014-12-08 18:20:14','2020-12-08','2020-12-08 00:00:00',NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,-5.00000000,2,1,NULL,1,NULL,3,NULL,NULL,NULL,0,0,'2020-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(13,'FA1212-0011',1,NULL,NULL,0,NULL,NULL,7,'2014-12-09 20:04:19','2020-12-09','2020-02-12 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,2.74000000,0.00000000,0.00000000,0.00000000,14.00000000,16.74000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-09',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(32,'FA1212-0021',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:34:23','2020-12-11','2021-03-24 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,90.00000000,0.00000000,0.00000000,0.60000000,520.00000000,610.60000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(33,'FA1212-0023',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:34:23','2020-12-11','2021-03-03 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,'abandon',NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,3,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(55,'FA1212-0009',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:35:51','2020-12-11','2020-12-12 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(148,'FS1301-0001',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:22:48','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,'facture/FS1301-0001/FS1301-0001.pdf',NULL,NULL),(149,'FA1601-0024',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:30:05','2021-01-19','2020-08-29 00:00:00','2020-01-02 20:49:34','2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,'other','test',1.80000000,0.90000000,0.90000000,0.00000000,20.00000000,23.60000000,2,1,NULL,12,12,NULL,NULL,NULL,NULL,0,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,20.00000000,1.80000000,23.60000000,NULL,'facture/FA1601-0024/FA1601-0024.pdf',NULL,NULL),(150,'FA6801-0010',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:31:10','2021-01-19','2020-10-04 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,12,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,5.00000000,0.63000000,5.63000000,NULL,'facture/FA6801-0010/FA6801-0010.pdf',NULL,NULL),(151,'FS1301-0002',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:31:58','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(160,'FA1507-0015',1,NULL,NULL,0,NULL,NULL,12,'2015-03-06 16:47:48','2020-07-18','2019-03-06 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.11000000,0.00000000,0.00000000,0.00000000,8.89000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(210,'FA1107-0019',1,NULL,NULL,0,NULL,NULL,10,'2015-03-20 14:30:11','2020-07-10','2020-03-20 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-07-10',NULL,NULL,'generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(211,'FA1303-0020',1,NULL,NULL,0,NULL,NULL,19,'2015-03-22 09:40:10','2021-03-22','2020-03-02 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,17.64000000,0.00000000,0.00000000,0.40000000,340.00000000,358.04000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,3,'2021-03-22',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(213,'AV1303-0003',1,NULL,NULL,2,NULL,NULL,1,'2016-03-03 19:22:03','2021-03-03','2020-03-03 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,-1000.00000000,1,1,NULL,1,NULL,32,NULL,NULL,NULL,0,0,'2021-03-03',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(216,'(PROV216)',1,NULL,NULL,0,NULL,NULL,26,'2017-02-12 23:21:27','2021-02-12',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-02-12',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,0,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(217,'(PROV217)',1,NULL,NULL,0,NULL,NULL,1,'2017-08-31 13:26:17','2020-08-31',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.13000000,0.00000000,0.00000000,0.00000000,21.00000000,22.13000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-31',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,1,'EUR',1.00000000,21.00000000,1.13000000,22.13000000,NULL,'facture/(PROV217)/(PROV217).pdf',NULL,NULL),(218,'FA1909-0025',1,NULL,NULL,0,NULL,NULL,12,'2019-09-26 17:30:14','2020-09-26','2020-09-26 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.08000000,0.00000000,0.00000000,0.00000000,42.50000000,43.58000000,1,12,NULL,12,NULL,NULL,NULL,NULL,NULL,0,0,'2020-09-26',NULL,NULL,'',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,0,'EUR',1.00000000,42.50000000,1.08000000,43.58000000,NULL,NULL,'takepos','1'),(219,'(PROV-POS1-0)',1,NULL,NULL,0,NULL,NULL,1,'2019-11-28 19:04:03','2020-11-28',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,5.00000000,6.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'2020-11-28',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,5.00000000,1.00000000,6.00000000,NULL,NULL,'takepos','1'),(220,'(PROV220)',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:03:17','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,100.00000000,100.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,100.00000000,0.00000000,100.00000000,NULL,NULL,NULL,NULL),(221,'AC2001-0001',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:21:05','2021-01-16','2021-01-16 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,123.00000000,123.00000000,0,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,123.00000000,0.00000000,123.00000000,NULL,'facture/AC2001-0001/AC2001-0001.pdf',NULL,NULL),(222,'(PROV222)',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:21:28','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,100.00000000,100.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,100.00000000,0.00000000,100.00000000,NULL,NULL,NULL,NULL),(223,'(PROV223)',1,NULL,NULL,0,NULL,NULL,19,'2020-01-16 02:32:04','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,'2021-02-15',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,410.00000000,0.00000000,410.00000000,NULL,NULL,NULL,NULL),(224,'AC2001-0002',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:33:19','2021-01-16','2021-01-16 00:00:00','2020-01-16 02:36:48','2021-04-15 10:22:31',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,20.50000000,20.50000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,20.50000000,0.00000000,20.50000000,NULL,'facture/AC2001-0002/AC2001-0002.pdf',NULL,NULL),(225,'(PROV225)',1,NULL,NULL,0,NULL,NULL,19,'2020-01-16 02:37:48','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,389.50000000,389.50000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,'2021-02-15',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,389.50000000,0.00000000,389.50000000,NULL,'facture/(PROV225)/(PROV225).pdf',NULL,NULL),(226,'(PROV226)',1,NULL,NULL,3,NULL,NULL,11,'2020-01-19 14:20:54','2021-01-19',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,12.50000000,0.00000000,0.00000000,0.00000000,120.00000000,132.50000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,120.00000000,12.50000000,132.50000000,NULL,'facture/(PROV226)/(PROV226).pdf',NULL,NULL),(227,'AC2001-0003',1,NULL,NULL,3,NULL,NULL,1,'2020-01-19 14:22:54','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,39.20000000,0.00000000,0.00000000,0.00000000,200.00000000,239.20000000,0,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,200.00000000,39.20000000,239.20000000,NULL,'facture/AC2001-0003/AC2001-0003.pdf',NULL,NULL),(228,'AC2001-0004',1,NULL,NULL,3,NULL,NULL,1,'2020-01-19 14:24:49','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,1.94000000,0.00000000,0.00000000,0.00000000,48.60000000,50.54000000,1,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,48.60000000,1.94000000,50.54000000,NULL,'facture/AC2001-0004/AC2001-0004.pdf',NULL,NULL),(229,'FA1707-0026',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:17','2020-07-18','2022-01-21 00:00:00','2020-01-21 10:23:17','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1707-0026/FA1707-0026.pdf',NULL,NULL),(230,'FA1807-0027',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:28','2020-07-18','2021-01-21 00:00:00','2020-01-21 10:23:28','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1807-0027/FA1807-0027.pdf',NULL,NULL),(231,'FA1907-0028',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:49','2020-07-18','2020-01-21 00:00:00','2020-01-21 10:23:49','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1907-0028/FA1907-0028.pdf',NULL,NULL); +INSERT INTO `llx_facture` VALUES (2,'FA1007-0002',1,NULL,NULL,0,NULL,NULL,2,'2012-07-10 18:20:13','2021-07-10',NULL,NULL,'2021-07-11 17:49:28',1,10.00000000,NULL,NULL,0,NULL,NULL,0.10000000,0.00000000,0.00000000,0.00000000,46.00000000,46.10000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2021-07-10',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(3,'FA1107-0006',1,NULL,NULL,0,NULL,NULL,10,'2013-07-18 20:33:35','2020-07-18',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,15.00000000,15.00000000,2,1,NULL,1,NULL,NULL,1,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(5,'FA1108-0003',1,NULL,NULL,0,NULL,NULL,7,'2013-08-01 03:34:11','2020-08-01',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,6,'2020-08-01',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(6,'FA1108-0004',1,NULL,NULL,0,NULL,NULL,7,'2013-08-06 20:33:53','2020-08-06',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.98000000,0.00000000,0.00000000,0.00000000,5.00000000,5.98000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,4,'2020-08-06','Cash\nReceived : 6 EUR\nRendu : 0.02 EUR\n\n--------------------------------------',NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(8,'FA1108-0005',1,NULL,NULL,3,NULL,NULL,2,'2013-08-08 02:41:44','2020-08-08',NULL,NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(9,'FA1108-0007',1,NULL,NULL,3,NULL,NULL,10,'2013-08-08 02:55:14','2020-08-08',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.96000000,0.00000000,0.00000000,0.00000000,10.00000000,11.96000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(10,'AV1212-0001',1,NULL,NULL,2,NULL,NULL,10,'2014-12-08 17:45:20','2020-12-08','2020-12-08 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,-0.63000000,0.00000000,0.00000000,0.00000000,-11.00000000,-11.63000000,1,1,NULL,1,NULL,3,NULL,NULL,NULL,0,0,'2020-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(12,'AV1212-0002',1,NULL,NULL,2,NULL,NULL,10,'2014-12-08 18:20:14','2020-12-08','2020-12-08 00:00:00',NULL,'2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-5.00000000,-5.00000000,2,1,NULL,1,NULL,3,NULL,NULL,NULL,0,0,'2020-12-08',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(13,'FA1212-0011',1,NULL,NULL,0,NULL,NULL,7,'2014-12-09 20:04:19','2020-12-09','2020-02-12 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,2.74000000,0.00000000,0.00000000,0.00000000,14.00000000,16.74000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-09',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(32,'FA1212-0021',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:34:23','2020-12-11','2021-03-24 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,90.00000000,0.00000000,0.00000000,0.60000000,520.00000000,610.60000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(33,'FA1212-0023',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:34:23','2020-12-11','2021-03-03 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,'abandon',NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,3,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(55,'FA1212-0009',1,NULL,NULL,0,NULL,NULL,1,'2014-12-11 09:35:51','2020-12-11','2020-12-12 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.24000000,0.00000000,0.00000000,0.00000000,2.48000000,2.72000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-12-11','This is a comment (private)','This is a comment (public)','generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(148,'FS1301-0001',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:22:48','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,'facture/FS1301-0001/FS1301-0001.pdf',NULL,NULL),(149,'FA1601-0024',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:30:05','2021-01-19','2020-08-29 00:00:00','2020-01-02 20:49:34','2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,'other','test',1.80000000,0.90000000,0.90000000,0.00000000,20.00000000,23.60000000,2,1,NULL,12,12,NULL,NULL,NULL,NULL,0,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,20.00000000,1.80000000,23.60000000,NULL,'facture/FA1601-0024/FA1601-0024.pdf',NULL,NULL),(150,'FA6801-0010',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:31:10','2021-01-19','2020-10-04 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.63000000,0.00000000,0.00000000,0.00000000,5.00000000,5.63000000,1,1,NULL,12,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,5.00000000,0.63000000,5.63000000,NULL,'facture/FA6801-0010/FA6801-0010.pdf',NULL,NULL),(151,'FS1301-0002',1,NULL,NULL,0,NULL,NULL,1,'2015-01-19 18:31:58','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,2,1,NULL,1,NULL,NULL,NULL,NULL,NULL,0,1,'2021-01-19',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(160,'FA1507-0015',1,NULL,NULL,0,NULL,NULL,12,'2015-03-06 16:47:48','2020-07-18','2019-03-06 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.11000000,0.00000000,0.00000000,0.00000000,8.89000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(210,'FA1107-0019',1,NULL,NULL,0,NULL,NULL,10,'2015-03-20 14:30:11','2021-07-10','2021-03-20 00:00:00',NULL,'2021-07-11 17:49:28',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,10.00000000,10.00000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,0,'2021-07-10',NULL,NULL,'generic_invoice_odt:/home/ldestailleur/git/dolibarr_3.8/documents/doctemplates/invoices/template_invoice.odt',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(211,'FA1303-0020',1,NULL,NULL,0,NULL,NULL,19,'2015-03-22 09:40:10','2021-03-22','2020-03-02 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,17.64000000,0.00000000,0.00000000,0.40000000,340.00000000,358.04000000,1,1,NULL,1,NULL,NULL,NULL,NULL,NULL,1,3,'2021-03-22',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(213,'AV1303-0003',1,NULL,NULL,2,NULL,NULL,1,'2016-03-03 19:22:03','2021-03-03','2020-03-03 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,-1000.00000000,-1000.00000000,1,1,NULL,1,NULL,32,NULL,NULL,NULL,0,0,'2021-03-03',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(216,'(PROV216)',1,NULL,NULL,0,NULL,NULL,26,'2017-02-12 23:21:27','2021-02-12',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-02-12',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,0,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL),(217,'(PROV217)',1,NULL,NULL,0,NULL,NULL,1,'2017-08-31 13:26:17','2020-08-31',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.13000000,0.00000000,0.00000000,0.00000000,21.00000000,22.13000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2020-08-31',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,1,'EUR',1.00000000,21.00000000,1.13000000,22.13000000,NULL,'facture/(PROV217)/(PROV217).pdf',NULL,NULL),(218,'FA1909-0025',1,NULL,NULL,0,NULL,NULL,12,'2019-09-26 17:30:14','2020-09-26','2020-09-26 00:00:00',NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.08000000,0.00000000,0.00000000,0.00000000,42.50000000,43.58000000,1,12,NULL,12,NULL,NULL,NULL,NULL,NULL,0,0,'2020-09-26',NULL,NULL,'',NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,0,'',NULL,NULL,0,'EUR',1.00000000,42.50000000,1.08000000,43.58000000,NULL,NULL,'takepos','1'),(219,'(PROV-POS1-0)',1,NULL,NULL,0,NULL,NULL,1,'2019-11-28 19:04:03','2020-11-28',NULL,NULL,'2020-12-10 12:24:22',0,0.00000000,NULL,NULL,0,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,5.00000000,6.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,'2020-11-28',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,5.00000000,1.00000000,6.00000000,NULL,NULL,'takepos','1'),(220,'(PROV220)',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:03:17','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,100.00000000,100.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,100.00000000,0.00000000,100.00000000,NULL,NULL,NULL,NULL),(221,'AC2001-0001',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:21:05','2021-01-16','2021-01-16 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,123.00000000,123.00000000,0,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,123.00000000,0.00000000,123.00000000,NULL,'facture/AC2001-0001/AC2001-0001.pdf',NULL,NULL),(222,'(PROV222)',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:21:28','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,100.00000000,100.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,100.00000000,0.00000000,100.00000000,NULL,NULL,NULL,NULL),(223,'(PROV223)',1,NULL,NULL,0,NULL,NULL,19,'2020-01-16 02:32:04','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,410.00000000,410.00000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,'2021-02-15',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,410.00000000,0.00000000,410.00000000,NULL,NULL,NULL,NULL),(224,'AC2001-0002',1,NULL,NULL,3,NULL,NULL,19,'2020-01-16 02:33:19','2021-01-16','2021-01-16 00:00:00','2020-01-16 02:36:48','2021-04-15 10:22:31',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,20.50000000,20.50000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2021-01-16',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,20.50000000,0.00000000,20.50000000,NULL,'facture/AC2001-0002/AC2001-0002.pdf',NULL,NULL),(225,'(PROV225)',1,NULL,NULL,0,NULL,NULL,19,'2020-01-16 02:37:48','2021-01-16',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,389.50000000,389.50000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,2,0,'2021-02-15',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,389.50000000,0.00000000,389.50000000,NULL,'facture/(PROV225)/(PROV225).pdf',NULL,NULL),(226,'(PROV226)',1,NULL,NULL,3,NULL,NULL,11,'2020-01-19 14:20:54','2021-01-19',NULL,NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,12.50000000,0.00000000,0.00000000,0.00000000,120.00000000,132.50000000,0,12,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,120.00000000,12.50000000,132.50000000,NULL,'facture/(PROV226)/(PROV226).pdf',NULL,NULL),(227,'AC2001-0003',1,NULL,NULL,3,NULL,NULL,1,'2020-01-19 14:22:54','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,39.20000000,0.00000000,0.00000000,0.00000000,200.00000000,239.20000000,0,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,200.00000000,39.20000000,239.20000000,NULL,'facture/AC2001-0003/AC2001-0003.pdf',NULL,NULL),(228,'AC2001-0004',1,NULL,NULL,3,NULL,NULL,1,'2020-01-19 14:24:49','2021-01-19','2021-01-19 00:00:00',NULL,'2021-04-15 10:22:31',0,0.00000000,NULL,NULL,0,NULL,NULL,1.94000000,0.00000000,0.00000000,0.00000000,48.60000000,50.54000000,1,12,NULL,12,NULL,NULL,NULL,NULL,NULL,1,0,'2021-01-19',NULL,NULL,'crabe',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,1,'EUR',1.00000000,48.60000000,1.94000000,50.54000000,NULL,'facture/AC2001-0004/AC2001-0004.pdf',NULL,NULL),(229,'FA1707-0026',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:17','2020-07-18','2022-01-21 00:00:00','2020-01-21 10:23:17','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1707-0026/FA1707-0026.pdf',NULL,NULL),(230,'FA1807-0027',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:28','2020-07-18','2021-01-21 00:00:00','2020-01-21 10:23:28','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1807-0027/FA1807-0027.pdf',NULL,NULL),(231,'FA1907-0028',1,NULL,NULL,0,NULL,NULL,12,'2020-01-21 10:23:49','2020-07-18','2020-01-21 00:00:00','2020-01-21 10:23:49','2020-12-10 12:24:22',1,0.00000000,NULL,NULL,0,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,50.00000000,50.00000000,2,12,NULL,12,12,NULL,NULL,NULL,NULL,1,0,'2020-07-18',NULL,NULL,'',NULL,NULL,NULL,NULL,0,0,NULL,0,0,'',NULL,NULL,0,'EUR',1.00000000,50.00000000,0.00000000,50.00000000,NULL,'facture/FA1907-0028/FA1907-0028.pdf',NULL,NULL); /*!40000 ALTER TABLE `llx_facture` ENABLE KEYS */; UNLOCK TABLES; @@ -7372,6 +6639,7 @@ CREATE TABLE `llx_facture_fourn_det` ( `pu_ttc` double(24,8) DEFAULT NULL, `qty` double DEFAULT NULL, `remise_percent` double DEFAULT 0, + `fk_remise_except` int(11) DEFAULT NULL, `tva_tx` double(6,3) DEFAULT NULL, `vat_src_code` varchar(10) COLLATE utf8_unicode_ci DEFAULT '', `localtax1_tx` double(6,3) DEFAULT 0.000, @@ -7399,6 +6667,7 @@ CREATE TABLE `llx_facture_fourn_det` ( `multicurrency_total_tva` double(24,8) DEFAULT 0.00000000, `multicurrency_total_ttc` double(24,8) DEFAULT 0.00000000, PRIMARY KEY (`rowid`), + UNIQUE KEY `uk_fk_remise_except` (`fk_remise_except`,`fk_facture_fourn`), KEY `idx_facture_fourn_det_fk_facture` (`fk_facture_fourn`), KEY `fk_facture_fourn_det_fk_unit` (`fk_unit`), KEY `idx_facture_fourn_det_fk_code_ventilation` (`fk_code_ventilation`), @@ -7414,7 +6683,7 @@ CREATE TABLE `llx_facture_fourn_det` ( LOCK TABLES `llx_facture_fourn_det` WRITE; /*!40000 ALTER TABLE `llx_facture_fourn_det` DISABLE KEYS */; -INSERT INTO `llx_facture_fourn_det` VALUES (44,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/04/2003 à 11/10/2003',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,105,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(45,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/10/2003 à 11/04/2004',414.00000000,495.14400000,1,0,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,104,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(46,16,NULL,NULL,NULL,NULL,'ref :sd.installation.annuel
Frais de mise en service d\'un serveur dédié pour un paiement annuel
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,105,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(47,17,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,106,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(48,17,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,103,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(49,18,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(50,18,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(51,19,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,19.600,'',0.000,'0',0.000,'0',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(52,19,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,19.600,'',0.000,'0',0.000,'0',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(53,20,NULL,NULL,NULL,NULL,'Chips',20.00000000,23.92000000,10,0,19.600,'',0.000,'0',0.000,'0',200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'EUR',20.00000000,200.00000000,39.20000000,239.20000000),(54,21,NULL,1,'aaa',NULL,'A beatifull pink dress',100.00000000,90.00000000,5,10,0.000,'',0.000,'0',0.000,'0',450.00000000,0.00000000,0.00000000,0.00000000,450.00000000,0,NULL,NULL,0,NULL,0,0,1,NULL,1,'EUR',100.00000000,450.00000000,0.00000000,450.00000000),(78,22,NULL,1,'BK01',NULL,'A beatifull pink dress',70.00000000,78.75000000,5,0,12.500,'',0.000,'0',0.000,'0',350.00000000,43.75000000,0.00000000,0.00000000,393.75000000,0,NULL,NULL,0,NULL,0,0,2,NULL,1,'EUR',70.00000000,350.00000000,43.75000000,393.75000000),(83,27,NULL,1,'BK01','Pink dress','A beatifull pink dress',-70.00000000,-78.75000000,5,0,12.500,'',0.000,'0',0.000,'0',-350.00000000,-43.75000000,0.00000000,0.00000000,-393.75000000,0,NULL,NULL,0,NULL,0,0,2,NULL,1,'EUR',70.00000000,350.00000000,43.75000000,393.75000000),(84,28,NULL,1,'BK01',NULL,'A beatifull pink dress',79.16667000,89.06000000,1,0,12.500,'',0.000,'0',0.000,'0',79.17000000,9.89000000,0.00000000,0.00000000,89.06000000,0,NULL,NULL,0,NULL,0,0,1,NULL,1,'EUR',79.16667000,79.17000000,9.89000000,89.06000000),(86,30,NULL,NULL,'',NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',-1.00000000,-1.20000000,1,0,19.600,'',0.000,'0',0.000,'0',-1.00000000,-0.20000000,0.00000000,0.00000000,-1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'',0.00000000,0.00000000,0.00000000,0.00000000),(87,30,NULL,NULL,'',NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',-25.00000000,-29.90000000,1,0,19.600,'',0.000,'0',0.000,'0',-25.00000000,-4.90000000,0.00000000,0.00000000,-29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'',0.00000000,0.00000000,0.00000000,0.00000000),(89,22,NULL,2,'BKPEARPIE',NULL,'',7.00000000,7.00000000,1,0,0.000,'',0.000,'0',0.000,'0',7.00000000,0.00000000,0.00000000,0.00000000,7.00000000,0,NULL,NULL,0,NULL,0,0,3,NULL,1,'EUR',7.00000000,7.00000000,0.00000000,7.00000000); +INSERT INTO `llx_facture_fourn_det` VALUES (44,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/04/2003 à 11/10/2003',414.00000000,495.14400000,1,0,NULL,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,105,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(45,16,NULL,NULL,NULL,NULL,'ref :sd.loc.sp.512.6
6 mois - Location de SuperPlan avec la connexion 512kbs
Du 11/10/2003 à 11/04/2004',414.00000000,495.14400000,1,0,NULL,19.600,'',0.000,'',0.000,'',414.00000000,81.14000000,0.00000000,0.00000000,495.14000000,0,NULL,NULL,0,NULL,104,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(46,16,NULL,NULL,NULL,NULL,'ref :sd.installation.annuel
Frais de mise en service d\'un serveur dédié pour un paiement annuel
',1.00000000,1.19600000,1,0,NULL,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,105,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(47,17,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,NULL,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,106,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(48,17,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,NULL,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,103,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(49,18,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,NULL,19.600,'',0.000,'',0.000,'',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(50,18,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,NULL,19.600,'',0.000,'',0.000,'',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(51,19,NULL,NULL,NULL,NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',1.00000000,1.19600000,1,0,NULL,19.600,'',0.000,'0',0.000,'0',1.00000000,0.20000000,0.00000000,0.00000000,1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(52,19,NULL,NULL,NULL,NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',25.00000000,29.90000000,1,0,NULL,19.600,'',0.000,'0',0.000,'0',25.00000000,4.90000000,0.00000000,0.00000000,29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000),(53,20,NULL,NULL,NULL,NULL,'Chips',20.00000000,23.92000000,10,0,NULL,19.600,'',0.000,'0',0.000,'0',200.00000000,39.20000000,0.00000000,0.00000000,239.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'EUR',20.00000000,200.00000000,39.20000000,239.20000000),(54,21,NULL,1,'aaa',NULL,'A beatifull pink dress',100.00000000,90.00000000,5,10,NULL,0.000,'',0.000,'0',0.000,'0',450.00000000,0.00000000,0.00000000,0.00000000,450.00000000,0,NULL,NULL,0,NULL,0,0,1,NULL,1,'EUR',100.00000000,450.00000000,0.00000000,450.00000000),(78,22,NULL,1,'BK01',NULL,'A beatifull pink dress',70.00000000,78.75000000,5,0,NULL,12.500,'',0.000,'0',0.000,'0',350.00000000,43.75000000,0.00000000,0.00000000,393.75000000,0,NULL,NULL,0,NULL,0,0,2,NULL,1,'EUR',70.00000000,350.00000000,43.75000000,393.75000000),(83,27,NULL,1,'BK01','Pink dress','A beatifull pink dress',-70.00000000,-78.75000000,5,0,NULL,12.500,'',0.000,'0',0.000,'0',-350.00000000,-43.75000000,0.00000000,0.00000000,-393.75000000,0,NULL,NULL,0,NULL,0,0,2,NULL,1,'EUR',70.00000000,350.00000000,43.75000000,393.75000000),(84,28,NULL,1,'BK01',NULL,'A beatifull pink dress',79.16667000,89.06000000,1,0,NULL,12.500,'',0.000,'0',0.000,'0',79.17000000,9.89000000,0.00000000,0.00000000,89.06000000,0,NULL,NULL,0,NULL,0,0,1,NULL,1,'EUR',79.16667000,79.17000000,9.89000000,89.06000000),(86,30,NULL,NULL,'',NULL,'ref :bk.full250.creation
Création du compte backup ftp 250Mo.
',-1.00000000,-1.20000000,1,0,NULL,19.600,'',0.000,'0',0.000,'0',-1.00000000,-0.20000000,0.00000000,0.00000000,-1.20000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'',0.00000000,0.00000000,0.00000000,0.00000000),(87,30,NULL,NULL,'',NULL,'ref :bk.full250.12
Redevance pour un backup de 250Mo sur 12 mois
',-25.00000000,-29.90000000,1,0,NULL,19.600,'',0.000,'0',0.000,'0',-25.00000000,-4.90000000,0.00000000,0.00000000,-29.90000000,0,NULL,NULL,0,NULL,0,0,0,NULL,0,'',0.00000000,0.00000000,0.00000000,0.00000000),(89,22,NULL,2,'BKPEARPIE',NULL,'',7.00000000,7.00000000,1,0,NULL,0.000,'',0.000,'0',0.000,'0',7.00000000,0.00000000,0.00000000,0.00000000,7.00000000,0,NULL,NULL,0,NULL,0,0,3,NULL,1,'EUR',7.00000000,7.00000000,0.00000000,7.00000000); /*!40000 ALTER TABLE `llx_facture_fourn_det` ENABLE KEYS */; UNLOCK TABLES; @@ -8175,8 +7444,9 @@ CREATE TABLE `llx_import_model` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `fk_user` int(11) NOT NULL DEFAULT 0, `label` varchar(50) COLLATE utf8_unicode_ci NOT NULL, - `type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, + `type` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, `field` text COLLATE utf8_unicode_ci NOT NULL, + `entity` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_import_model` (`label`,`type`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -8188,7 +7458,7 @@ CREATE TABLE `llx_import_model` ( LOCK TABLES `llx_import_model` WRITE; /*!40000 ALTER TABLE `llx_import_model` DISABLE KEYS */; -INSERT INTO `llx_import_model` VALUES (1,12,'Import profile 1','user_1','1=u.login,2=u.lastname,3=u.firstname,4=u.employee,5=u.job,6=u.gender,7=u.accountancy_code,8=u.pass_crypted,9=u.admin,10=u.fk_soc,11=u.address,12=u.zip,13=u.town,14=u.fk_state,15=u.fk_country,16=u.office_phone,17=u.user_mobile,18=u.office_fax,19=u.email,20=u.note,21=u.signature,22=u.fk_user,23=u.thm,24=u.tjm,25=u.weeklyhours,26=u.dateemployment,27=u.salary,28=u.color,29=u.api_key,30=u.birth,31=u.datec,32=u.statut'),(3,0,'Import profile 2','user_1','1=u.login,2=u.lastname,3=u.firstname,4=u.employee,5=u.job,6=u.gender,7=u.accountancy_code,8=u.pass_crypted,9=u.admin,10=u.fk_soc,11=u.address,12=u.zip,13=u.town,14=u.fk_state,15=u.fk_country,16=u.office_phone,17=u.user_mobile,18=u.office_fax,19=u.email,20=u.note,21=u.signature,22=u.fk_user,23=u.thm,24=u.tjm,25=u.weeklyhours,26=u.dateemployment,27=u.salary,28=u.color,29=u.api_key,30=u.birth,31=u.datec,32=u.statut'); +INSERT INTO `llx_import_model` VALUES (1,12,'Import profile 1','user_1','1=u.login,2=u.lastname,3=u.firstname,4=u.employee,5=u.job,6=u.gender,7=u.accountancy_code,8=u.pass_crypted,9=u.admin,10=u.fk_soc,11=u.address,12=u.zip,13=u.town,14=u.fk_state,15=u.fk_country,16=u.office_phone,17=u.user_mobile,18=u.office_fax,19=u.email,20=u.note,21=u.signature,22=u.fk_user,23=u.thm,24=u.tjm,25=u.weeklyhours,26=u.dateemployment,27=u.salary,28=u.color,29=u.api_key,30=u.birth,31=u.datec,32=u.statut',0),(3,0,'Import profile 2','user_1','1=u.login,2=u.lastname,3=u.firstname,4=u.employee,5=u.job,6=u.gender,7=u.accountancy_code,8=u.pass_crypted,9=u.admin,10=u.fk_soc,11=u.address,12=u.zip,13=u.town,14=u.fk_state,15=u.fk_country,16=u.office_phone,17=u.user_mobile,18=u.office_fax,19=u.email,20=u.note,21=u.signature,22=u.fk_user,23=u.thm,24=u.tjm,25=u.weeklyhours,26=u.dateemployment,27=u.salary,28=u.color,29=u.api_key,30=u.birth,31=u.datec,32=u.statut',0); /*!40000 ALTER TABLE `llx_import_model` ENABLE KEYS */; UNLOCK TABLES; @@ -8201,17 +7471,17 @@ DROP TABLE IF EXISTS `llx_intracommreport`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `llx_intracommreport` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, - `ref` varchar(30) NOT NULL, + `ref` varchar(30) CHARACTER SET utf8mb4 NOT NULL, `entity` int(11) NOT NULL DEFAULT 1, - `type_declaration` varchar(32) DEFAULT NULL, - `period` varchar(32) DEFAULT NULL, - `mode` varchar(32) DEFAULT NULL, - `content_xml` text DEFAULT NULL, - `type_export` varchar(10) DEFAULT NULL, + `type_declaration` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL, + `period` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL, + `mode` varchar(32) CHARACTER SET utf8mb4 DEFAULT NULL, + `content_xml` text CHARACTER SET utf8mb4 DEFAULT NULL, + `type_export` varchar(10) CHARACTER SET utf8mb4 DEFAULT NULL, `datec` datetime DEFAULT NULL, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -8270,31 +7540,6 @@ INSERT INTO `llx_inventory` VALUES (1,'aaa',1,NULL,NULL,'aa aaa',0,'2020-01-10 0 /*!40000 ALTER TABLE `llx_inventory` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_inventory_extrafields` --- - -DROP TABLE IF EXISTS `llx_inventory_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_inventory_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_inventory_extrafields` --- - -LOCK TABLES `llx_inventory_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_inventory_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_inventory_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_inventorydet` -- @@ -8330,6 +7575,68 @@ LOCK TABLES `llx_inventorydet` WRITE; /*!40000 ALTER TABLE `llx_inventorydet` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `llx_knowledgemanagement_knowledgerecord` +-- + +DROP TABLE IF EXISTS `llx_knowledgemanagement_knowledgerecord`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_knowledgemanagement_knowledgerecord` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `ref` varchar(128) COLLATE utf8_unicode_ci NOT NULL, + `date_creation` datetime NOT NULL, + `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `last_main_doc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_user_creat` int(11) NOT NULL, + `fk_user_modif` int(11) DEFAULT NULL, + `fk_user_valid` int(11) DEFAULT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + `model_pdf` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `question` text COLLATE utf8_unicode_ci NOT NULL, + `answer` text COLLATE utf8_unicode_ci DEFAULT NULL, + `url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `fk_ticket` int(11) DEFAULT NULL, + `fk_c_ticket_category` int(11) DEFAULT NULL, + `status` int(11) NOT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_knowledgemanagement_knowledgerecord` +-- + +LOCK TABLES `llx_knowledgemanagement_knowledgerecord` WRITE; +/*!40000 ALTER TABLE `llx_knowledgemanagement_knowledgerecord` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_knowledgemanagement_knowledgerecord` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `llx_knowledgemanagement_knowledgerecord_extrafields` +-- + +DROP TABLE IF EXISTS `llx_knowledgemanagement_knowledgerecord_extrafields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `llx_knowledgemanagement_knowledgerecord_extrafields` ( + `rowid` int(11) NOT NULL AUTO_INCREMENT, + `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `fk_object` int(11) NOT NULL, + `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (`rowid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `llx_knowledgemanagement_knowledgerecord_extrafields` +-- + +LOCK TABLES `llx_knowledgemanagement_knowledgerecord_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_knowledgemanagement_knowledgerecord_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_knowledgemanagement_knowledgerecord_extrafields` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `llx_links` -- @@ -8626,7 +7933,7 @@ CREATE TABLE `llx_menu` ( PRIMARY KEY (`rowid`), UNIQUE KEY `idx_menu_uk_menu` (`menu_handler`,`fk_menu`,`position`,`url`,`entity`), KEY `idx_menu_menuhandler_type` (`menu_handler`,`type`) -) ENGINE=InnoDB AUTO_INCREMENT=167087 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=167134 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -8635,7 +7942,7 @@ CREATE TABLE `llx_menu` ( LOCK TABLES `llx_menu` WRITE; /*!40000 ALTER TABLE `llx_menu` DISABLE KEYS */; -INSERT INTO `llx_menu` VALUES (103094,'all',2,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103095,'all',2,'agenda','left','agenda',103094,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103096,'all',2,'agenda','left','agenda',103095,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction',NULL,'commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103097,'all',2,'agenda','left','agenda',103095,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103098,'all',2,'agenda','left','agenda',103097,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103099,'all',2,'agenda','left','agenda',103097,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103100,'all',2,'agenda','left','agenda',103097,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103101,'all',2,'agenda','left','agenda',103097,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103102,'all',2,'agenda','left','agenda',103095,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103103,'all',2,'agenda','left','agenda',103102,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103104,'all',2,'agenda','left','agenda',103102,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103105,'all',2,'agenda','left','agenda',103102,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103106,'all',2,'agenda','left','agenda',103102,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103107,'all',2,'agenda','left','agenda',103095,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103134,'all',2,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys',NULL,'opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103135,'all',2,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey',NULL,'opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103136,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php','_blank','NewSurvey',NULL,'opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103137,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List',NULL,'opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(161088,'auguria',1,'','top','home',0,NULL,NULL,10,'/index.php?mainmenu=home&leftmenu=','','Home',NULL,'',-1,'','','1',2,'2017-08-30 15:14:30'),(161089,'auguria',1,'societe|fournisseur','top','companies',0,NULL,NULL,20,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties',NULL,'companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)',2,'2017-08-30 15:14:30'),(161090,'auguria',1,'product|service','top','products',0,NULL,NULL,30,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services',NULL,'products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2017-08-30 15:14:30'),(161092,'auguria',1,'propal|commande|fournisseur|contrat|ficheinter','top','commercial',0,NULL,NULL,40,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial',NULL,'commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(161093,'auguria',1,'comptabilite|accounting|facture|don|tax|salaries|loan','top','accountancy',0,NULL,NULL,50,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial',NULL,'compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled',2,'2017-08-30 15:14:30'),(161094,'auguria',1,'projet','top','project',0,NULL,NULL,70,'/projet/index.php?mainmenu=project&leftmenu=','','Projects',NULL,'projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(161095,'auguria',1,'mailing|export|import|opensurvey|resource','top','tools',0,NULL,NULL,90,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools',NULL,'other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled',2,'2017-08-30 15:14:30'),(161101,'auguria',1,'banque|prelevement','top','bank',0,NULL,NULL,60,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash',NULL,'banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',0,'2017-08-30 15:14:30'),(161102,'auguria',1,'hrm|holiday|deplacement|expensereport','top','hrm',0,NULL,NULL,80,'/hrm/index.php?mainmenu=hrm&leftmenu=','','HRM',NULL,'holiday',-1,'','$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire','$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(161177,'auguria',1,'','left','home',161088,NULL,NULL,0,'/index.php','','MyDashboard',NULL,'',0,'','','1',2,'2017-08-30 15:14:30'),(161187,'auguria',1,'','left','home',161088,NULL,NULL,1,'/admin/index.php?leftmenu=setup','','Setup',NULL,'admin',0,'setup','','$user->admin',2,'2017-08-30 15:14:30'),(161188,'auguria',1,'','left','home',161187,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161189,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161190,'auguria',1,'','left','home',161187,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161191,'auguria',1,'','left','home',161187,NULL,NULL,6,'/admin/boxes.php?leftmenu=setup','','Boxes',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161192,'auguria',1,'','left','home',161187,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus',NULL,'admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:47'),(161193,'auguria',1,'','left','home',161187,NULL,NULL,7,'/admin/delais.php?leftmenu=setup','','Alerts',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161194,'auguria',1,'','left','home',161187,NULL,NULL,10,'/admin/pdf.php?leftmenu=setup','','PDF',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161195,'auguria',1,'','left','home',161187,NULL,NULL,8,'/admin/security_other.php?leftmenu=setup','','Security',NULL,'admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:36'),(161196,'auguria',1,'','left','home',161187,NULL,NULL,11,'/admin/mails.php?leftmenu=setup','','Emails',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161197,'auguria',1,'','left','home',161187,NULL,NULL,9,'/admin/limits.php?leftmenu=setup','','MenuLimits',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161198,'auguria',1,'','left','home',161187,NULL,NULL,13,'/admin/dict.php?leftmenu=setup','','Dictionary',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161199,'auguria',1,'','left','home',161187,NULL,NULL,14,'/admin/const.php?leftmenu=setup','','OtherSetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161200,'auguria',1,'','left','home',161187,NULL,NULL,12,'/admin/sms.php?leftmenu=setup','','SMS',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161201,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/translation.php?leftmenu=setup','','Translation',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161288,'auguria',1,'','left','home',161387,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=admintools','','InfoDolibarr',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161289,'auguria',1,'','left','home',161288,NULL,NULL,2,'/admin/system/modules.php?leftmenu=admintools','','Modules',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161290,'auguria',1,'','left','home',161288,NULL,NULL,3,'/admin/triggers.php?leftmenu=admintools','','Triggers',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161291,'auguria',1,'','left','home',161288,NULL,NULL,4,'/admin/system/filecheck.php?leftmenu=admintools','','FileCheck',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161292,'auguria',1,'','left','home',161387,NULL,NULL,1,'/admin/system/browser.php?leftmenu=admintools','','InfoBrowser',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161293,'auguria',1,'','left','home',161387,NULL,NULL,2,'/admin/system/os.php?leftmenu=admintools','','InfoOS',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161294,'auguria',1,'','left','home',161387,NULL,NULL,3,'/admin/system/web.php?leftmenu=admintools','','InfoWebServer',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161295,'auguria',1,'','left','home',161387,NULL,NULL,4,'/admin/system/phpinfo.php?leftmenu=admintools','','InfoPHP',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161297,'auguria',1,'','left','home',161387,NULL,NULL,5,'/admin/system/database.php?leftmenu=admintools','','InfoDatabase',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161387,'auguria',1,'','left','home',161088,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','AdminTools',NULL,'admin',0,'admintools','','$user->admin',2,'2017-08-30 15:14:30'),(161388,'auguria',1,'','left','home',161387,NULL,NULL,6,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161389,'auguria',1,'','left','home',161387,NULL,NULL,7,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161392,'auguria',1,'','left','home',161387,NULL,NULL,8,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161393,'auguria',1,'','left','home',161387,NULL,NULL,9,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator',NULL,'admin',1,'','','$leftmenu==\"admintools\" && function_exists(\"eaccelerator_info\")',2,'2017-08-30 15:14:30'),(161394,'auguria',1,'','left','home',161387,NULL,NULL,10,'/admin/tools/listevents.php?leftmenu=admintools','','Audit',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161395,'auguria',1,'','left','home',161387,NULL,NULL,11,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161396,'auguria',1,'','left','home',161387,NULL,NULL,12,'/admin/tools/purge.php?leftmenu=admintools','','Purge',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161398,'auguria',1,'','left','home',161387,NULL,NULL,14,'/admin/system/about.php?leftmenu=admintools','','ExternalResources',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161407,'auguria',1,'','left','home',161387,NULL,NULL,15,'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools','','ProductVatMassChange',NULL,'products',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161487,'auguria',1,'','left','home',161088,NULL,NULL,4,'/user/home.php?leftmenu=users','','MenuUsersAndGroups',NULL,'users',0,'users','','1',2,'2017-08-30 15:14:30'),(161488,'auguria',1,'','left','home',161487,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users',NULL,'users',1,'','$user->rights->user->user->lire || $user->admin','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161489,'auguria',1,'','left','home',161488,NULL,NULL,0,'/user/card.php?leftmenu=users&action=create','','NewUser',NULL,'users',2,'','($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161490,'auguria',1,'','left','home',161487,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups',NULL,'users',1,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161491,'auguria',1,'','left','home',161490,NULL,NULL,0,'/user/group/card.php?leftmenu=users&action=create','','NewGroup',NULL,'users',2,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161587,'auguria',1,'','left','companies',161089,NULL,NULL,0,'/societe/index.php?leftmenu=thirdparties','','ThirdParty',NULL,'companies',0,'thirdparties','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161588,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/card.php?action=create','','MenuNewThirdParty',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161589,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/list.php?action=create','','List',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161590,'auguria',1,'','left','companies',161587,NULL,NULL,5,'/societe/list.php?type=f&leftmenu=suppliers','','ListSuppliersShort',NULL,'suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161591,'auguria',1,'','left','companies',161590,NULL,NULL,0,'/societe/card.php?leftmenu=supplier&action=create&type=f','','NewSupplier',NULL,'suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161593,'auguria',1,'','left','companies',161587,NULL,NULL,3,'/societe/list.php?type=p&leftmenu=prospects','','ListProspectsShort',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161594,'auguria',1,'','left','companies',161593,NULL,NULL,0,'/societe/card.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect',NULL,'companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161596,'auguria',1,'','left','companies',161587,NULL,NULL,4,'/societe/list.php?type=c&leftmenu=customers','','ListCustomersShort',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161597,'auguria',1,'','left','companies',161596,NULL,NULL,0,'/societe/card.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer',NULL,'companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161687,'auguria',1,'','left','companies',161089,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses',NULL,'companies',0,'contacts','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161688,'auguria',1,'','left','companies',161687,NULL,NULL,0,'/contact/card.php?leftmenu=contacts&action=create','','NewContactAddress',NULL,'companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161689,'auguria',1,'','left','companies',161687,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161691,'auguria',1,'','left','companies',161689,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','ThirdPartyProspects',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161692,'auguria',1,'','left','companies',161689,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','ThirdPartyCustomers',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161693,'auguria',1,'','left','companies',161689,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','ThirdPartySuppliers',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161694,'auguria',1,'','left','companies',161689,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161737,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161738,'auguria',1,'','left','companies',161737,NULL,NULL,0,'/categories/card.php?action=create&type=1','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161747,'auguria',1,'','left','companies',161089,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161748,'auguria',1,'','left','companies',161747,NULL,NULL,0,'/categories/card.php?action=create&type=2','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161757,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=4','','ContactCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161758,'auguria',1,'','left','companies',161757,NULL,NULL,0,'/categories/card.php?action=create&type=4','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(162187,'auguria',1,'','left','commercial',161092,NULL,NULL,4,'/comm/propal/index.php?leftmenu=propals','','Prop',NULL,'propal',0,'propals','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162188,'auguria',1,'','left','commercial',162187,NULL,NULL,0,'/comm/propal/card.php?action=create&leftmenu=propals','','NewPropal',NULL,'propal',1,'','$user->rights->propale->creer','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162189,'auguria',1,'','left','commercial',162187,NULL,NULL,1,'/comm/propal/list.php?leftmenu=propals','','List',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162190,'auguria',1,'','left','commercial',162189,NULL,NULL,2,'/comm/propal/list.php?leftmenu=propals&search_status=0','','PropalsDraft',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162191,'auguria',1,'','left','commercial',162189,NULL,NULL,3,'/comm/propal/list.php?leftmenu=propals&search_status=1','','PropalsOpened',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162192,'auguria',1,'','left','commercial',162189,NULL,NULL,4,'/comm/propal/list.php?leftmenu=propals&search_status=2','','PropalStatusSigned',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162193,'auguria',1,'','left','commercial',162189,NULL,NULL,5,'/comm/propal/list.php?leftmenu=propals&search_status=3','','PropalStatusNotSigned',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162194,'auguria',1,'','left','commercial',162189,NULL,NULL,6,'/comm/propal/list.php?leftmenu=propals&search_status=4','','PropalStatusBilled',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162197,'auguria',1,'','left','commercial',162187,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162287,'auguria',1,'','left','commercial',161092,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders',NULL,'orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162288,'auguria',1,'','left','commercial',162287,NULL,NULL,0,'/commande/card.php?action=create&leftmenu=orders','','NewOrder',NULL,'orders',1,'','$user->rights->commande->creer','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162289,'auguria',1,'','left','commercial',162287,NULL,NULL,1,'/commande/list.php?leftmenu=orders','','List',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162290,'auguria',1,'','left','commercial',162289,NULL,NULL,2,'/commande/list.php?leftmenu=orders&search_status=0','','StatusOrderDraftShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162291,'auguria',1,'','left','commercial',162289,NULL,NULL,3,'/commande/list.php?leftmenu=orders&search_status=1','','StatusOrderValidated',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162292,'auguria',1,'','left','commercial',162289,NULL,NULL,4,'/commande/list.php?leftmenu=orders&search_status=2','','StatusOrderOnProcessShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162293,'auguria',1,'','left','commercial',162289,NULL,NULL,5,'/commande/list.php?leftmenu=orders&search_status=3','','StatusOrderToBill',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162294,'auguria',1,'','left','commercial',162289,NULL,NULL,6,'/commande/list.php?leftmenu=orders&search_status=4','','StatusOrderProcessed',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162295,'auguria',1,'','left','commercial',162289,NULL,NULL,7,'/commande/list.php?leftmenu=orders&search_status=-1','','StatusOrderCanceledShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162296,'auguria',1,'','left','commercial',162287,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162387,'auguria',1,'','left','commercial',161090,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments',NULL,'sendings',0,'sendings','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2017-08-30 15:14:30'),(162388,'auguria',1,'','left','commercial',162387,NULL,NULL,0,'/expedition/card.php?action=create2&leftmenu=sendings','','NewSending',NULL,'sendings',1,'','$user->rights->expedition->creer','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162389,'auguria',1,'','left','commercial',162387,NULL,NULL,1,'/expedition/list.php?leftmenu=sendings','','List',NULL,'sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162390,'auguria',1,'','left','commercial',162387,NULL,NULL,2,'/expedition/stats/index.php?leftmenu=sendings','','Statistics',NULL,'sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162487,'auguria',1,'','left','commercial',161092,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts',NULL,'contracts',0,'contracts','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162488,'auguria',1,'','left','commercial',162487,NULL,NULL,0,'/contrat/card.php?&action=create&leftmenu=contracts','','NewContract',NULL,'contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162489,'auguria',1,'','left','commercial',162487,NULL,NULL,1,'/contrat/list.php?leftmenu=contracts','','List',NULL,'contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162490,'auguria',1,'','left','commercial',162487,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices',NULL,'contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162491,'auguria',1,'','left','commercial',162490,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162492,'auguria',1,'','left','commercial',162490,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162493,'auguria',1,'','left','commercial',162490,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162494,'auguria',1,'','left','commercial',162490,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162587,'auguria',1,'','left','commercial',161092,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions',NULL,'interventions',0,'ficheinter','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162588,'auguria',1,'','left','commercial',162587,NULL,NULL,0,'/fichinter/card.php?action=create&leftmenu=ficheinter','','NewIntervention',NULL,'interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162589,'auguria',1,'','left','commercial',162587,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List',NULL,'interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162590,'auguria',1,'','left','commercial',162587,NULL,NULL,2,'/fichinter/stats/index.php?leftmenu=ficheinter','','Statistics',NULL,'interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162687,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/fourn/facture/list.php?leftmenu=suppliers_bills','','BillsSuppliers',NULL,'bills',0,'supplier_bills','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162688,'auguria',1,'','left','accountancy',162687,NULL,NULL,0,'/fourn/facture/card.php?action=create&leftmenu=suppliers_bills','','NewBill',NULL,'bills',1,'','$user->rights->fournisseur->facture->creer','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162689,'auguria',1,'','left','accountancy',162687,NULL,NULL,1,'/fourn/facture/list.php?leftmenu=suppliers_bills','','List',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162690,'auguria',1,'','left','accountancy',162687,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162691,'auguria',1,'','left','accountancy',162687,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier','','Statistics',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162692,'auguria',1,'','left','accountancy',162690,NULL,NULL,1,'/fourn/facture/rapport.php?leftmenu=suppliers_bills','','Reporting',NULL,'bills',2,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162787,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers',NULL,'bills',0,'customer_bills','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162788,'auguria',1,'','left','accountancy',162787,NULL,NULL,3,'/compta/facture/card.php?action=create&leftmenu=customers_bills','','NewBill',NULL,'bills',1,'','$user->rights->facture->creer','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162789,'auguria',1,'','left','accountancy',162787,NULL,NULL,5,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','ListOfTemplates',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162791,'auguria',1,'','left','accountancy',162787,NULL,NULL,6,'/compta/paiement/list.php?leftmenu=customers_bills','','Payments',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162792,'auguria',1,'','left','accountancy',162787,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills','','List',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162797,'auguria',1,'','left','accountancy',162791,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162798,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits',NULL,'bills',0,'checks','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162799,'auguria',1,'','left','accountancy',162798,NULL,NULL,0,'/compta/paiement/cheque/card.php?leftmenu=checks&action=new','','NewCheckDeposit',NULL,'compta',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162800,'auguria',1,'','left','accountancy',162798,NULL,NULL,1,'/compta/paiement/cheque/list.php?leftmenu=checks','','List',NULL,'bills',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162801,'auguria',1,'','left','accountancy',162787,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162807,'auguria',1,'','left','accountancy',162792,NULL,NULL,1,'/compta/facture/list.php?leftmenu=customers_bills&search_status=0','','BillShortStatusDraft',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162808,'auguria',1,'','left','accountancy',162792,NULL,NULL,2,'/compta/facture/list.php?leftmenu=customers_bills&search_status=1','','BillShortStatusNotPaid',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162809,'auguria',1,'','left','accountancy',162792,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills&search_status=2','','BillShortStatusPaid',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162810,'auguria',1,'','left','accountancy',162792,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills&search_status=3','','BillShortStatusCanceled',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162987,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/commande/list.php?leftmenu=orders&search_status=3','','MenuOrdersToBill',NULL,'orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',0,'2017-08-30 15:14:30'),(163087,'auguria',1,'','left','accountancy',161093,NULL,NULL,4,'/don/index.php?leftmenu=donations&mainmenu=accountancy','','Donations',NULL,'donations',0,'donations','$user->rights->don->lire','$conf->don->enabled',2,'2017-08-30 15:14:30'),(163088,'auguria',1,'','left','accountancy',163087,NULL,NULL,0,'/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation',NULL,'donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163089,'auguria',1,'','left','accountancy',163087,NULL,NULL,1,'/don/list.php?leftmenu=donations&mainmenu=accountancy','','List',NULL,'donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163187,'auguria',1,'','left','accountancy',161102,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses',NULL,'trips',0,'tripsandexpenses','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163188,'auguria',1,'','left','accountancy',163187,NULL,NULL,1,'/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses','','New',NULL,'trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163189,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/list.php?leftmenu=tripsandexpenses','','List',NULL,'trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163190,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics',NULL,'trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163287,'auguria',1,'','left','accountancy',161093,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuSpecialExpenses',NULL,'compta',0,'tax','(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)','$conf->tax->enabled || $conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163297,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy','','Salaries',NULL,'salaries',1,'tax_sal','$user->rights->salaries->payment->read','$conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163298,'auguria',1,'','left','accountancy',163297,NULL,NULL,2,'/compta/salaries/card.php?leftmenu=tax_salary&action=create','','NewPayment',NULL,'companies',2,'','$user->rights->salaries->payment->write','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163299,'auguria',1,'','left','accountancy',163297,NULL,NULL,3,'/compta/salaries/index.php?leftmenu=tax_salary','','Payments',NULL,'companies',2,'','$user->rights->salaries->payment->read','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163307,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy','','Loans',NULL,'loan',1,'tax_loan','$user->rights->loan->read','$conf->loan->enabled',0,'2017-08-30 15:14:30'),(163308,'auguria',1,'','left','accountancy',163307,NULL,NULL,2,'/loan/card.php?leftmenu=tax_loan&action=create','','NewLoan',NULL,'loan',2,'','$user->rights->loan->write','$conf->loan->enabled && $leftmenu==\"tax_loan\"',0,'2017-08-30 15:14:30'),(163310,'auguria',1,'','left','accountancy',163307,NULL,NULL,4,'/loan/calc.php?leftmenu=tax_loan','','Calculator',NULL,'companies',2,'','$user->rights->loan->calc','$conf->loan->enabled && $leftmenu==\"tax_loan\" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)',0,'2017-08-30 15:14:30'),(163337,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions',NULL,'',1,'tax_social','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2017-08-30 15:14:30'),(163338,'auguria',1,'','left','accountancy',163337,NULL,NULL,2,'/compta/sociales/card.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution',NULL,'',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163339,'auguria',1,'','left','accountancy',163337,NULL,NULL,3,'/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments',NULL,'',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163387,'auguria',1,'','left','accountancy',163287,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT',NULL,'companies',1,'tax_vat','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2017-08-30 15:14:30'),(163388,'auguria',1,'','left','accountancy',163387,NULL,NULL,0,'/compta/tva/card.php?leftmenu=tax_vat&action=create','','New',NULL,'companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163389,'auguria',1,'','left','accountancy',163387,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','List',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163390,'auguria',1,'','left','accountancy',163387,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163391,'auguria',1,'','left','accountancy',163387,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163487,'auguria',1,'','left','accountancy',161093,NULL,NULL,7,'/accountancy/index.php?leftmenu=accountancy','','MenuAccountancy',NULL,'accountancy',0,'accounting','! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163488,'auguria',1,'','left','accountancy',163487,NULL,NULL,2,'/accountancy/customer/index.php?leftmenu=dispatch_customer','','CustomersVentilation',NULL,'accountancy',1,'dispatch_customer','$user->rights->accounting->bind->write','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163489,'auguria',1,'','left','accountancy',163488,NULL,NULL,3,'/accountancy/customer/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163490,'auguria',1,'','left','accountancy',163488,NULL,NULL,4,'/accountancy/customer/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163497,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/supplier/index.php?leftmenu=dispatch_supplier','','SuppliersVentilation',NULL,'accountancy',1,'ventil_supplier','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled',0,'2017-08-30 15:14:30'),(163498,'auguria',1,'','left','accountancy',163497,NULL,NULL,6,'/accountancy/supplier/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163499,'auguria',1,'','left','accountancy',163497,NULL,NULL,7,'/accountancy/supplier/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163507,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/expensereport/index.php?leftmenu=dispatch_expensereport','','ExpenseReportsVentilation',NULL,'accountancy',1,'ventil_expensereport','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(163508,'auguria',1,'','left','accountancy',163507,NULL,NULL,6,'/accountancy/expensereport/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163509,'auguria',1,'','left','accountancy',163507,NULL,NULL,7,'/accountancy/expensereport/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163517,'auguria',1,'','left','accountancy',163487,NULL,NULL,15,'/accountancy/bookkeeping/list.php','','Bookkeeping',NULL,'accountancy',1,'bookkeeping','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163522,'auguria',1,'','left','accountancy',163487,NULL,NULL,16,'/accountancy/bookkeeping/balance.php','','AccountBalance',NULL,'accountancy',1,'balance','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163527,'auguria',1,'','left','accountancy',163487,NULL,NULL,17,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','Reportings',NULL,'main',1,'report','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163528,'auguria',1,'','left','accountancy',163527,NULL,NULL,19,'/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportInOut',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163529,'auguria',1,'','left','accountancy',163528,NULL,NULL,18,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','ByAccounts',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163530,'auguria',1,'','left','accountancy',163528,NULL,NULL,20,'/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163531,'auguria',1,'','left','accountancy',163527,NULL,NULL,21,'/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportTurnover',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163532,'auguria',1,'','left','accountancy',163531,NULL,NULL,22,'/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163533,'auguria',1,'','left','accountancy',163531,NULL,NULL,23,'/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy','','ByUsers',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163534,'auguria',1,'','left','accountancy',163531,NULL,NULL,24,'/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy','','ByProductsAndServices',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163537,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin','','FiscalPeriod',NULL,'admin',1,'accountancy_admin_period','','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\" && $conf->global->MAIN_FEATURES_LEVEL > 0',2,'2017-08-30 15:14:30'),(163538,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Setup',NULL,'accountancy',1,'accountancy_admin','$user->rights->accounting->chartofaccount','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163541,'auguria',1,'','left','accountancy',163538,NULL,NULL,10,'/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingJournals',NULL,'accountancy',2,'accountancy_admin_journal','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163542,'auguria',1,'','left','accountancy',163538,NULL,NULL,20,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Pcg_version',NULL,'accountancy',2,'accountancy_admin_chartmodel','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163543,'auguria',1,'','left','accountancy',163538,NULL,NULL,30,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Chartofaccounts',NULL,'accountancy',2,'accountancy_admin_chart','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163544,'auguria',1,'','left','accountancy',163538,NULL,NULL,40,'/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingCategory',NULL,'accountancy',2,'accountancy_admin_chart_group','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163545,'auguria',1,'','left','accountancy',163538,NULL,NULL,50,'/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuDefaultAccounts',NULL,'accountancy',2,'accountancy_admin_default','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163546,'auguria',1,'','left','accountancy',163538,NULL,NULL,60,'/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuVatAccounts',NULL,'accountancy',2,'accountancy_admin_vat','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163547,'auguria',1,'','left','accountancy',163538,NULL,NULL,70,'/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuTaxAccounts',NULL,'accountancy',2,'accountancy_admin_tax','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163548,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuExpenseReportAccounts',NULL,'accountancy',2,'accountancy_admin_expensereport','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163549,'auguria',1,'','left','accountancy',163538,NULL,NULL,90,'/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuProductsAccounts',NULL,'accountancy',2,'accountancy_admin_product','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163587,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders',NULL,'withdrawals',0,'withdraw','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2017-08-30 15:14:30'),(163589,'auguria',1,'','left','accountancy',163587,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163590,'auguria',1,'','left','accountancy',163587,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163591,'auguria',1,'','left','accountancy',163587,NULL,NULL,3,'/compta/prelevement/list.php?leftmenu=withdraw','','WithdrawalsLines',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163593,'auguria',1,'','left','accountancy',163587,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163594,'auguria',1,'','left','accountancy',163587,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163687,'auguria',1,'','left','accountancy',161101,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash',NULL,'banks',0,'bank','$user->rights->banque->lire','$conf->banque->enabled',0,'2017-08-30 15:14:30'),(163688,'auguria',1,'','left','accountancy',163687,NULL,NULL,0,'/compta/bank/card.php?action=create&leftmenu=bank','','MenuNewFinancialAccount',NULL,'banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163690,'auguria',1,'','left','accountancy',163687,NULL,NULL,2,'/compta/bank/bankentries.php?leftmenu=bank','','ListTransactions',NULL,'banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163691,'auguria',1,'','left','accountancy',163687,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory',NULL,'banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163693,'auguria',1,'','left','accountancy',163687,NULL,NULL,5,'/compta/bank/transfer.php?leftmenu=bank','','BankTransfers',NULL,'banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163737,'auguria',1,'','left','accountancy',161101,NULL,NULL,4,'/categories/index.php?leftmenu=bank&type=5','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163738,'auguria',1,'','left','accountancy',163737,NULL,NULL,0,'/categories/card.php?leftmenu=bank&action=create&type=5','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163787,'auguria',1,'','left','accountancy',161093,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings',NULL,'main',0,'ca','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled',0,'2017-08-30 15:14:30'),(163792,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'','','Journalization',NULL,'main',1,'','$user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163793,'auguria',1,'','left','accountancy',163792,NULL,NULL,4,'/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1','','SellsJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163794,'auguria',1,'','left','accountancy',163792,NULL,NULL,1,'/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3','','BankJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163795,'auguria',1,'','left','accountancy',163792,NULL,NULL,2,'/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6','','ExpenseReportJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163796,'auguria',1,'','left','accountancy',163792,NULL,NULL,3,'/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2','','PurchasesJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163798,'auguria',1,'','left','accountancy',163787,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut',NULL,'main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163799,'auguria',1,'','left','accountancy',163788,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163800,'auguria',1,'','left','accountancy',163787,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover',NULL,'main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163801,'auguria',1,'','left','accountancy',163790,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163802,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163803,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyprodserv.php?leftmenu=ca','','ByProductsAndServices',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163887,'auguria',1,'','left','products',161090,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products',NULL,'products',0,'product','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163888,'auguria',1,'','left','products',163887,NULL,NULL,0,'/product/card.php?leftmenu=product&action=create&type=0','','NewProduct',NULL,'products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163889,'auguria',1,'','left','products',163887,NULL,NULL,1,'/product/list.php?leftmenu=product&type=0','','List',NULL,'products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163890,'auguria',1,'','left','products',163887,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163891,'auguria',1,'','left','products',163887,NULL,NULL,7,'/product/stats/card.php?id=all&leftmenu=stats&type=0','','Statistics',NULL,'main',1,'','$user->rights->produit->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(163892,'auguria',1,'','left','products',163887,NULL,NULL,5,'/product/reassortlot.php?type=0','','StocksByLotSerial',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163893,'auguria',1,'','left','products',163887,NULL,NULL,6,'/product/stock/productlot_list.php','','LotSerial',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163987,'auguria',1,'','left','products',161090,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services',NULL,'products',0,'service','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163988,'auguria',1,'','left','products',163987,NULL,NULL,0,'/product/card.php?leftmenu=service&action=create&type=1','','NewService',NULL,'products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163989,'auguria',1,'','left','products',163987,NULL,NULL,1,'/product/list.php?leftmenu=service&type=1','','List',NULL,'products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163990,'auguria',1,'','left','products',163987,NULL,NULL,5,'/product/stats/card.php?id=all&leftmenu=stats&type=1','','Statistics',NULL,'main',1,'','$user->rights->service->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(164187,'auguria',1,'','left','products',161090,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock',NULL,'stocks',0,'stock','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164188,'auguria',1,'','left','products',164187,NULL,NULL,0,'/product/stock/card.php?action=create','','MenuNewWarehouse',NULL,'stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164189,'auguria',1,'','left','products',164187,NULL,NULL,1,'/product/stock/list.php','','List',NULL,'stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164191,'auguria',1,'','left','products',164187,NULL,NULL,3,'/product/stock/mouvement.php','','Movements',NULL,'stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164192,'auguria',1,'','left','products',164187,NULL,NULL,4,'/product/stock/replenish.php','','Replenishments',NULL,'stocks',1,'','$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire','$conf->stock->enabled && $conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(164193,'auguria',1,'','left','products',164187,NULL,NULL,5,'/product/stock/massstockmove.php','','MassStockTransferShort',NULL,'stocks',1,'','$user->rights->stock->mouvement->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164287,'auguria',1,'','left','products',161090,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164288,'auguria',1,'','left','products',164287,NULL,NULL,0,'/categories/card.php?action=create&type=0','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164487,'auguria',1,'','left','project',161094,NULL,NULL,3,'/projet/activity/perweek.php?leftmenu=projects','','NewTimeSpent',NULL,'projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164687,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects',NULL,'projects',0,'projects','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164688,'auguria',1,'','left','project',164687,NULL,NULL,1,'/projet/card.php?leftmenu=projects&action=create','','NewProject',NULL,'projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164689,'auguria',1,'','left','project',164687,NULL,NULL,2,'/projet/list.php?leftmenu=projects','','List',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164690,'auguria',1,'','left','project',164687,NULL,NULL,3,'/projet/stats/index.php?leftmenu=projects','','Statistics',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164787,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities',NULL,'projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164788,'auguria',1,'','left','project',164787,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask',NULL,'projects',1,'','$user->rights->projet->creer','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164789,'auguria',1,'','left','project',164787,NULL,NULL,2,'/projet/tasks/list.php?leftmenu=projects','','List',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164791,'auguria',1,'','left','project',164787,NULL,NULL,4,'/projet/tasks/stats/index.php?leftmenu=projects','','Statistics',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164891,'auguria',1,'','left','project',161094,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=6','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164892,'auguria',1,'','left','project',164891,NULL,NULL,0,'/categories/card.php?action=create&type=6','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164987,'auguria',1,'','left','tools',161095,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings',NULL,'mails',0,'mailing','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164988,'auguria',1,'','left','tools',164987,NULL,NULL,0,'/comm/mailing/card.php?leftmenu=mailing&action=create','','NewMailing',NULL,'mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164989,'auguria',1,'','left','tools',164987,NULL,NULL,1,'/comm/mailing/list.php?leftmenu=mailing','','List',NULL,'mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(165187,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport',NULL,'exports',0,'export','$user->rights->export->lire','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165188,'auguria',1,'','left','tools',165187,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport',NULL,'exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165217,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport',NULL,'exports',0,'import','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165218,'auguria',1,'','left','tools',165217,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport',NULL,'exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165287,'auguria',1,'','left','members',161100,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members',NULL,'members',0,'members','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165288,'auguria',1,'','left','members',165287,NULL,NULL,0,'/adherents/card.php?leftmenu=members&action=create','','NewMember',NULL,'members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165289,'auguria',1,'','left','members',165287,NULL,NULL,1,'/adherents/list.php','','List',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165290,'auguria',1,'','left','members',165289,NULL,NULL,2,'/adherents/list.php?leftmenu=members&statut=-1','','MenuMembersToValidate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165291,'auguria',1,'','left','members',165289,NULL,NULL,3,'/adherents/list.php?leftmenu=members&statut=1','','MenuMembersValidated',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165292,'auguria',1,'','left','members',165289,NULL,NULL,4,'/adherents/list.php?leftmenu=members&statut=1&filter=outofdate','','MenuMembersNotUpToDate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165293,'auguria',1,'','left','members',165289,NULL,NULL,5,'/adherents/list.php?leftmenu=members&statut=1&filter=uptodate','','MenuMembersUpToDate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165294,'auguria',1,'','left','members',165289,NULL,NULL,6,'/adherents/list.php?leftmenu=members&statut=0','','MenuMembersResiliated',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165295,'auguria',1,'','left','members',165287,NULL,NULL,7,'/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry','','MenuMembersStats',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165387,'auguria',1,'','left','members',161100,NULL,NULL,1,'/adherents/index.php?leftmenu=members&mainmenu=members','','Subscriptions',NULL,'compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165388,'auguria',1,'','left','members',165387,NULL,NULL,0,'/adherents/list.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription',NULL,'compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165389,'auguria',1,'','left','members',165387,NULL,NULL,1,'/adherents/subscription/list.php?leftmenu=members','','List',NULL,'compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165390,'auguria',1,'','left','members',165387,NULL,NULL,7,'/adherents/stats/index.php?leftmenu=members','','MenuMembersStats',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165589,'auguria',1,'','left','members',165287,NULL,NULL,9,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd',NULL,'members',1,'','$user->rights->adherent->export','! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165590,'auguria',1,'','left','members',165287,NULL,NULL,10,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards',NULL,'members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165687,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/user/index.php?leftmenu=hrm&mode=employee','','Employees',NULL,'hrm',0,'hrm','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165688,'auguria',1,'','left','hrm',165687,NULL,NULL,1,'/user/card.php?action=create&employee=1','','NewEmployee',NULL,'hrm',1,'','$user->rights->hrm->employee->write','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165689,'auguria',1,'','left','hrm',165687,NULL,NULL,2,'/user/index.php?$leftmenu=hrm&mode=employee&contextpage=employeelist','','List',NULL,'hrm',1,'','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165787,'auguria',1,'','left','members',161100,NULL,NULL,5,'/adherents/type.php?leftmenu=setup&mainmenu=members','','MembersTypes',NULL,'members',0,'setup','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165788,'auguria',1,'','left','members',165787,NULL,NULL,0,'/adherents/type.php?leftmenu=setup&mainmenu=members&action=create','','New',NULL,'members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165789,'auguria',1,'','left','members',165787,NULL,NULL,1,'/adherents/type.php?leftmenu=setup&mainmenu=members','','List',NULL,'members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(166087,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','CPTitreMenu',NULL,'holiday',0,'hrm','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166088,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/card.php?&action=request','','MenuAddCP',NULL,'holiday',1,'','$user->rights->holiday->write','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166089,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','List',NULL,'holiday',1,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166090,'auguria',1,'','left','hrm',166089,NULL,NULL,1,'/holiday/list.php?select_statut=2&leftmenu=hrm','','ListToApprove',NULL,'trips',2,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166091,'auguria',1,'','left','hrm',166087,NULL,NULL,2,'/holiday/define_holiday.php?&action=request','','MenuConfCP',NULL,'holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166092,'auguria',1,'','left','hrm',166087,NULL,NULL,3,'/holiday/view_log.php?&action=request','','MenuLogCP',NULL,'holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166187,'auguria',1,'','left','commercial',161092,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders',NULL,'orders',0,'orders_suppliers','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166188,'auguria',1,'','left','commercial',166187,NULL,NULL,0,'/fourn/commande/card.php?action=create&leftmenu=orders_suppliers','','NewOrder',NULL,'orders',1,'','$user->rights->fournisseur->commande->creer','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166189,'auguria',1,'','left','commercial',166187,NULL,NULL,1,'/fourn/commande/list.php?leftmenu=orders_suppliers&search_status=0','','List',NULL,'orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166195,'auguria',1,'','left','commercial',166187,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics',NULL,'orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166287,'auguria',1,'','left','members',161100,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166288,'auguria',1,'','left','members',166287,NULL,NULL,0,'/categories/card.php?action=create&type=3','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166387,'auguria',1,'','left','hrm',161102,NULL,NULL,5,'/expensereport/index.php?leftmenu=expensereport','','TripsAndExpenses',NULL,'trips',0,'expensereport','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166388,'auguria',1,'','left','hrm',166387,NULL,NULL,1,'/expensereport/card.php?action=create&leftmenu=expensereport','','New',NULL,'trips',1,'','$user->rights->expensereport->creer','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166389,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/list.php?leftmenu=expensereport','','List',NULL,'trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166390,'auguria',1,'','left','hrm',166389,NULL,NULL,2,'/expensereport/list.php?search_status=2&leftmenu=expensereport','','ListToApprove',NULL,'trips',2,'','$user->rights->expensereport->approve','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166391,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/stats/index.php?leftmenu=expensereport','','Statistics',NULL,'trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(167038,'all',1,'agenda','top','agenda',0,NULL,NULL,86,'/comm/action/index.php','','TMenuAgenda','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167039,'all',1,'agenda','left','agenda',167038,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167040,'all',1,'agenda','left','agenda',167039,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167041,'all',1,'agenda','left','agenda',167039,NULL,NULL,140,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda','','Calendar','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167042,'all',1,'agenda','left','agenda',167041,NULL,NULL,141,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167043,'all',1,'agenda','left','agenda',167041,NULL,NULL,142,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167044,'all',1,'agenda','left','agenda',167041,NULL,NULL,143,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-04-15 10:22:58'),(167045,'all',1,'agenda','left','agenda',167041,NULL,NULL,144,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-04-15 10:22:58'),(167046,'all',1,'agenda','left','agenda',167039,NULL,NULL,110,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda','','List','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167047,'all',1,'agenda','left','agenda',167046,NULL,NULL,111,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167048,'all',1,'agenda','left','agenda',167046,NULL,NULL,112,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167049,'all',1,'agenda','left','agenda',167046,NULL,NULL,113,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-04-15 10:22:58'),(167050,'all',1,'agenda','left','agenda',167046,NULL,NULL,114,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-04-15 10:22:58'),(167051,'all',1,'agenda','left','agenda',167039,NULL,NULL,160,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2021-04-15 10:22:58'),(167052,'all',1,'agenda','left','agenda',167039,NULL,NULL,170,'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10','','Categories','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->categorie->enabled&&$conf->categorie->enabled',2,'2021-04-15 10:22:58'),(167053,'all',1,'barcode','left','tools',-1,NULL,'tools',200,'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint','','BarCodePrintsheet','','products',NULL,'barcodeprint','($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled',2,'2021-04-15 10:22:58'),(167054,'all',1,'barcode','left','home',-1,'admintools','home',300,'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools','','MassBarcodeInit','','products',NULL,NULL,'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)',0,'2021-04-15 10:22:58'),(167055,'all',1,'cron','left','home',-1,'admintools','home',200,'/cron/list.php?leftmenu=admintools','','CronList','','cron',NULL,NULL,'$user->rights->cron->read','$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',2,'2021-04-15 10:22:58'),(167056,'all',1,'blockedlog','left','tools',-1,NULL,'tools',200,'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser','','BrowseBlockedLog','','blockedlog',NULL,'blockedlogbrowser','$user->rights->blockedlog->read','$conf->blockedlog->enabled',2,'2021-04-15 10:22:58'),(167057,'all',1,'ecm','top','ecm',0,NULL,NULL,82,'/ecm/index.php','','MenuECM','','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup','$conf->ecm->enabled',2,'2021-04-15 10:22:59'),(167058,'all',1,'ecm','left','ecm',-1,NULL,'ecm',101,'/ecm/index.php?mainmenu=ecm&leftmenu=ecm','','ECMArea','','ecm',NULL,'ecm','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2021-04-15 10:22:59'),(167059,'all',1,'ecm','left','ecm',-1,'ecm','ecm',102,'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsManual','','ecm',NULL,'ecm_manual','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2021-04-15 10:22:59'),(167060,'all',1,'ecm','left','ecm',-1,'ecm','ecm',103,'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsAuto','','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',2,'2021-04-15 10:22:59'),(167061,'all',1,'margins','left','billing',-1,NULL,'billing',100,'/margin/index.php','','Margins','','margins',NULL,'margins','$user->rights->margins->liretous','$conf->margin->enabled',2,'2021-04-15 10:23:00'),(167062,'all',1,'opensurvey','left','tools',-1,NULL,'tools',200,'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey','','Survey','','opensurvey',NULL,'opensurvey','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2021-04-15 10:23:00'),(167063,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',210,'/opensurvey/wizard/index.php','','NewSurvey','','opensurvey',NULL,'opensurvey_new','$user->rights->opensurvey->write','$conf->opensurvey->enabled',0,'2021-04-15 10:23:00'),(167064,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',220,'/opensurvey/list.php','','List','','opensurvey',NULL,'opensurvey_list','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2021-04-15 10:23:00'),(167065,'all',1,'printing','left','home',-1,'admintools','home',300,'/printing/index.php?mainmenu=home&leftmenu=admintools','','MenuDirectPrinting','','printing',NULL,NULL,'$user->rights->printing->read','$conf->printing->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',0,'2021-04-15 10:23:00'),(167066,'all',1,'recruitment','left','hrm',-1,NULL,'hrm',1001,'/recruitment/recruitmentindex.php','','Recruitment','','recruitment',NULL,'recruitmentjobposition','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-04-15 10:23:00'),(167067,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1002,'/recruitment/recruitmentjobposition_card.php?action=create','','NewPositionToBeFilled','','recruitment',NULL,'recruitment_recruitmentjobposition_new','$user->rights->recruitment->recruitmentjobposition->write','$conf->recruitment->enabled',2,'2021-04-15 10:23:00'),(167068,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1003,'/recruitment/recruitmentjobposition_list.php','','ListOfPositionsToBeFilled','','recruitment',NULL,'recruitment_recruitmentjobposition_list','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-04-15 10:23:00'),(167069,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1004,'/recruitment/recruitmentcandidature_card.php?action=create','','NewCandidature','','recruitment',NULL,'recruitment_recruitmentcandidature_new','$user->rights->recruitment->recruitmentjobposition->write','$conf->recruitment->enabled',2,'2021-04-15 10:23:00'),(167070,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1005,'/recruitment/recruitmentcandidature_list.php','','ListOfCandidatures','','recruitment',NULL,'recruitment_recruitmentcandidature_list','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-04-15 10:23:00'),(167071,'all',1,'resource','left','tools',-1,NULL,'tools',100,'/resource/list.php','','MenuResourceIndex','','resource',NULL,'resource','$user->rights->resource->read','1',0,'2021-04-15 10:23:00'),(167072,'all',1,'resource','left','tools',-1,'resource','tools',101,'/resource/card.php?action=create','','MenuResourceAdd','','resource',NULL,'resource_add','$user->rights->resource->write','1',0,'2021-04-15 10:23:00'),(167073,'all',1,'resource','left','tools',-1,'resource','tools',102,'/resource/list.php','','List','','resource',NULL,'resource_list','$user->rights->resource->read','1',0,'2021-04-15 10:23:00'),(167074,'all',1,'stripe','left','bank',-1,NULL,'bank',100,'','','StripeAccount','','stripe',NULL,'stripe','$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-04-15 10:23:01'),(167075,'all',1,'stripe','left','bank',-1,'stripe','bank',102,'/stripe/charge.php','','StripeChargeList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-04-15 10:23:01'),(167076,'all',1,'stripe','left','bank',-1,'stripe','bank',102,'/stripe/transaction.php','','StripeTransactionList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-04-15 10:23:01'),(167077,'all',1,'stripe','left','bank',-1,'stripe','bank',103,'/stripe/payout.php','','StripePayoutList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-04-15 10:23:01'),(167078,'all',1,'ticket','top','ticket',0,NULL,NULL,88,'/ticket/index.php','','Ticket','','ticket',NULL,'1','$user->rights->ticket->read','$conf->ticket->enabled',2,'2021-04-15 10:23:01'),(167079,'all',1,'ticket','left','ticket',-1,NULL,'ticket',101,'/ticket/index.php','','Ticket','','ticket',NULL,'ticket','$user->rights->ticket->read','$conf->ticket->enabled',2,'2021-04-15 10:23:01'),(167080,'all',1,'ticket','left','ticket',-1,'ticket','ticket',102,'/ticket/card.php?action=create','','NewTicket','','ticket',NULL,NULL,'$user->rights->ticket->write','$conf->ticket->enabled',2,'2021-04-15 10:23:01'),(167081,'all',1,'ticket','left','ticket',-1,'ticket','ticket',103,'/ticket/list.php?search_fk_status=non_closed','','List','','ticket',NULL,'ticketlist','$user->rights->ticket->read','$conf->ticket->enabled',2,'2021-04-15 10:23:01'),(167082,'all',1,'ticket','left','ticket',-1,'ticket','ticket',105,'/ticket/list.php?mode=mine&search_fk_status=non_closed','','MenuTicketMyAssign','','ticket',NULL,'ticketmy','$user->rights->ticket->read','$conf->ticket->enabled',0,'2021-04-15 10:23:01'),(167083,'all',1,'ticket','left','ticket',-1,'ticket','ticket',107,'/ticket/stats/index.php','','Statistics','','ticket',NULL,NULL,'$user->rights->ticket->read','$conf->ticket->enabled',0,'2021-04-15 10:23:01'),(167084,'all',1,'takepos','top','takepos',0,NULL,NULL,1001,'/takepos/index.php','takepos','PointOfSaleShort','','cashdesk',NULL,NULL,'$user->rights->takepos->run','$conf->takepos->enabled',2,'2021-04-15 10:23:01'),(167085,'all',1,'website','top','website',0,NULL,NULL,100,'/website/index.php','','WebSites','','website',NULL,NULL,'$user->rights->website->read','$conf->website->enabled',2,'2021-04-15 10:23:02'); +INSERT INTO `llx_menu` VALUES (103094,'all',2,'agenda','top','agenda',0,NULL,NULL,100,'/comm/action/index.php','','Agenda',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103095,'all',2,'agenda','left','agenda',103094,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103096,'all',2,'agenda','left','agenda',103095,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction',NULL,'commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103097,'all',2,'agenda','left','agenda',103095,NULL,NULL,102,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Calendar',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103098,'all',2,'agenda','left','agenda',103097,NULL,NULL,103,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103099,'all',2,'agenda','left','agenda',103097,NULL,NULL,104,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103100,'all',2,'agenda','left','agenda',103097,NULL,NULL,105,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103101,'all',2,'agenda','left','agenda',103097,NULL,NULL,106,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103102,'all',2,'agenda','left','agenda',103095,NULL,NULL,112,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda','','List',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103103,'all',2,'agenda','left','agenda',103102,NULL,NULL,113,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103104,'all',2,'agenda','left','agenda',103102,NULL,NULL,114,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103105,'all',2,'agenda','left','agenda',103102,NULL,NULL,115,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=todo','','MenuToDoActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103106,'all',2,'agenda','left','agenda',103102,NULL,NULL,116,'/comm/action/listactions.php?mainmenu=agenda&leftmenu=agenda&status=done','','MenuDoneActions',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2015-03-13 15:29:19'),(103107,'all',2,'agenda','left','agenda',103095,NULL,NULL,120,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings',NULL,'agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2015-03-13 15:29:19'),(103134,'all',2,'opensurvey','top','opensurvey',0,NULL,NULL,200,'/opensurvey/index.php','','Surveys',NULL,'opensurvey',NULL,NULL,'$user->rights->opensurvey->survey->read','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103135,'all',2,'opensurvey','left','opensurvey',-1,NULL,'opensurvey',200,'/opensurvey/index.php?mainmenu=opensurvey&leftmenu=opensurvey','','Survey',NULL,'opensurvey@opensurvey',NULL,'opensurvey','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103136,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',210,'/opensurvey/public/index.php','_blank','NewSurvey',NULL,'opensurvey@opensurvey',NULL,'opensurvey_new','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(103137,'all',2,'opensurvey','left','opensurvey',-1,'opensurvey','opensurvey',220,'/opensurvey/list.php','','List',NULL,'opensurvey@opensurvey',NULL,'opensurvey_list','','$conf->opensurvey->enabled',0,'2015-03-13 20:33:42'),(161088,'auguria',1,'','top','home',0,NULL,NULL,10,'/index.php?mainmenu=home&leftmenu=','','Home',NULL,'',-1,'','','1',2,'2017-08-30 15:14:30'),(161089,'auguria',1,'societe|fournisseur','top','companies',0,NULL,NULL,20,'/societe/index.php?mainmenu=companies&leftmenu=','','ThirdParties',NULL,'companies',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)',2,'2017-08-30 15:14:30'),(161090,'auguria',1,'product|service','top','products',0,NULL,NULL,30,'/product/index.php?mainmenu=products&leftmenu=','','Products/Services',NULL,'products',-1,'','$user->rights->produit->lire||$user->rights->service->lire','$conf->product->enabled || $conf->service->enabled',0,'2017-08-30 15:14:30'),(161092,'auguria',1,'propal|commande|fournisseur|contrat|ficheinter','top','commercial',0,NULL,NULL,40,'/comm/index.php?mainmenu=commercial&leftmenu=','','Commercial',NULL,'commercial',-1,'','$user->rights->societe->lire || $user->rights->societe->contact->lire','$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(161093,'auguria',1,'comptabilite|accounting|facture|don|tax|salaries|loan','top','accountancy',0,NULL,NULL,50,'/compta/index.php?mainmenu=accountancy&leftmenu=','','MenuFinancial',NULL,'compta',-1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->plancompte->lire || $user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read','$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled',2,'2017-08-30 15:14:30'),(161094,'auguria',1,'projet','top','project',0,NULL,NULL,70,'/projet/index.php?mainmenu=project&leftmenu=','','Projects',NULL,'projects',-1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(161095,'auguria',1,'mailing|export|import|opensurvey|resource','top','tools',0,NULL,NULL,90,'/core/tools.php?mainmenu=tools&leftmenu=','','Tools',NULL,'other',-1,'','$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read','$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled',2,'2017-08-30 15:14:30'),(161101,'auguria',1,'banque|prelevement','top','bank',0,NULL,NULL,60,'/compta/bank/index.php?mainmenu=bank&leftmenu=bank','','MenuBankCash',NULL,'banks',-1,'','$user->rights->banque->lire || $user->rights->prelevement->bons->lire','$conf->banque->enabled || $conf->prelevement->enabled',0,'2017-08-30 15:14:30'),(161102,'auguria',1,'hrm|holiday|deplacement|expensereport','top','hrm',0,NULL,NULL,80,'/hrm/index.php?mainmenu=hrm&leftmenu=','','HRM',NULL,'holiday',-1,'','$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire','$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(161177,'auguria',1,'','left','home',161088,NULL,NULL,0,'/index.php','','MyDashboard',NULL,'',0,'','','1',2,'2017-08-30 15:14:30'),(161187,'auguria',1,'','left','home',161088,NULL,NULL,1,'/admin/index.php?leftmenu=setup','','Setup',NULL,'admin',0,'setup','','$user->admin',2,'2017-08-30 15:14:30'),(161188,'auguria',1,'','left','home',161187,NULL,NULL,1,'/admin/company.php?leftmenu=setup','','MenuCompanySetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161189,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/ihm.php?leftmenu=setup','','GUISetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161190,'auguria',1,'','left','home',161187,NULL,NULL,2,'/admin/modules.php?leftmenu=setup','','Modules',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161191,'auguria',1,'','left','home',161187,NULL,NULL,6,'/admin/boxes.php?leftmenu=setup','','Boxes',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161192,'auguria',1,'','left','home',161187,NULL,NULL,3,'/admin/menus.php?leftmenu=setup','','Menus',NULL,'admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:47'),(161193,'auguria',1,'','left','home',161187,NULL,NULL,7,'/admin/delais.php?leftmenu=setup','','Alerts',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161194,'auguria',1,'','left','home',161187,NULL,NULL,10,'/admin/pdf.php?leftmenu=setup','','PDF',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161195,'auguria',1,'','left','home',161187,NULL,NULL,8,'/admin/security_other.php?leftmenu=setup','','Security',NULL,'admin',1,'','','$leftmenu==\'setup\'',2,'2017-09-06 08:29:36'),(161196,'auguria',1,'','left','home',161187,NULL,NULL,11,'/admin/mails.php?leftmenu=setup','','Emails',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161197,'auguria',1,'','left','home',161187,NULL,NULL,9,'/admin/limits.php?leftmenu=setup','','MenuLimits',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161198,'auguria',1,'','left','home',161187,NULL,NULL,13,'/admin/dict.php?leftmenu=setup','','Dictionary',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161199,'auguria',1,'','left','home',161187,NULL,NULL,14,'/admin/const.php?leftmenu=setup','','OtherSetup',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161200,'auguria',1,'','left','home',161187,NULL,NULL,12,'/admin/sms.php?leftmenu=setup','','SMS',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161201,'auguria',1,'','left','home',161187,NULL,NULL,4,'/admin/translation.php?leftmenu=setup','','Translation',NULL,'admin',1,'','','$leftmenu==\"setup\"',2,'2017-08-30 15:14:30'),(161288,'auguria',1,'','left','home',161387,NULL,NULL,0,'/admin/system/dolibarr.php?leftmenu=admintools','','InfoDolibarr',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161289,'auguria',1,'','left','home',161288,NULL,NULL,2,'/admin/system/modules.php?leftmenu=admintools','','Modules',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161290,'auguria',1,'','left','home',161288,NULL,NULL,3,'/admin/triggers.php?leftmenu=admintools','','Triggers',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161291,'auguria',1,'','left','home',161288,NULL,NULL,4,'/admin/system/filecheck.php?leftmenu=admintools','','FileCheck',NULL,'admin',2,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161292,'auguria',1,'','left','home',161387,NULL,NULL,1,'/admin/system/browser.php?leftmenu=admintools','','InfoBrowser',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161293,'auguria',1,'','left','home',161387,NULL,NULL,2,'/admin/system/os.php?leftmenu=admintools','','InfoOS',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161294,'auguria',1,'','left','home',161387,NULL,NULL,3,'/admin/system/web.php?leftmenu=admintools','','InfoWebServer',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161295,'auguria',1,'','left','home',161387,NULL,NULL,4,'/admin/system/phpinfo.php?leftmenu=admintools','','InfoPHP',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161297,'auguria',1,'','left','home',161387,NULL,NULL,5,'/admin/system/database.php?leftmenu=admintools','','InfoDatabase',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161387,'auguria',1,'','left','home',161088,NULL,NULL,2,'/admin/tools/index.php?leftmenu=admintools','','AdminTools',NULL,'admin',0,'admintools','','$user->admin',2,'2017-08-30 15:14:30'),(161388,'auguria',1,'','left','home',161387,NULL,NULL,6,'/admin/tools/dolibarr_export.php?leftmenu=admintools','','Backup',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161389,'auguria',1,'','left','home',161387,NULL,NULL,7,'/admin/tools/dolibarr_import.php?leftmenu=admintools','','Restore',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161392,'auguria',1,'','left','home',161387,NULL,NULL,8,'/admin/tools/update.php?leftmenu=admintools','','MenuUpgrade',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161393,'auguria',1,'','left','home',161387,NULL,NULL,9,'/admin/tools/eaccelerator.php?leftmenu=admintools','','EAccelerator',NULL,'admin',1,'','','$leftmenu==\"admintools\" && function_exists(\"eaccelerator_info\")',2,'2017-08-30 15:14:30'),(161394,'auguria',1,'','left','home',161387,NULL,NULL,10,'/admin/tools/listevents.php?leftmenu=admintools','','Audit',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161395,'auguria',1,'','left','home',161387,NULL,NULL,11,'/admin/tools/listsessions.php?leftmenu=admintools','','Sessions',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161396,'auguria',1,'','left','home',161387,NULL,NULL,12,'/admin/tools/purge.php?leftmenu=admintools','','Purge',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161398,'auguria',1,'','left','home',161387,NULL,NULL,14,'/admin/system/about.php?leftmenu=admintools','','ExternalResources',NULL,'admin',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161407,'auguria',1,'','left','home',161387,NULL,NULL,15,'/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools','','ProductVatMassChange',NULL,'products',1,'','','$leftmenu==\"admintools\"',2,'2017-08-30 15:14:30'),(161487,'auguria',1,'','left','home',161088,NULL,NULL,4,'/user/home.php?leftmenu=users','','MenuUsersAndGroups',NULL,'users',0,'users','','1',2,'2017-08-30 15:14:30'),(161488,'auguria',1,'','left','home',161487,NULL,NULL,0,'/user/index.php?leftmenu=users','','Users',NULL,'users',1,'','$user->rights->user->user->lire || $user->admin','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161489,'auguria',1,'','left','home',161488,NULL,NULL,0,'/user/card.php?leftmenu=users&action=create','','NewUser',NULL,'users',2,'','($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161490,'auguria',1,'','left','home',161487,NULL,NULL,1,'/user/group/index.php?leftmenu=users','','Groups',NULL,'users',1,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161491,'auguria',1,'','left','home',161490,NULL,NULL,0,'/user/group/card.php?leftmenu=users&action=create','','NewGroup',NULL,'users',2,'','(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)','$leftmenu==\"users\"',2,'2017-08-30 15:14:30'),(161587,'auguria',1,'','left','companies',161089,NULL,NULL,0,'/societe/index.php?leftmenu=thirdparties','','ThirdParty',NULL,'companies',0,'thirdparties','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161588,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/card.php?action=create','','MenuNewThirdParty',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161589,'auguria',1,'','left','companies',161587,NULL,NULL,0,'/societe/list.php?action=create','','List',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161590,'auguria',1,'','left','companies',161587,NULL,NULL,5,'/societe/list.php?type=f&leftmenu=suppliers','','ListSuppliersShort',NULL,'suppliers',1,'','$user->rights->societe->lire && $user->rights->fournisseur->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161591,'auguria',1,'','left','companies',161590,NULL,NULL,0,'/societe/card.php?leftmenu=supplier&action=create&type=f','','NewSupplier',NULL,'suppliers',2,'','$user->rights->societe->creer','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161593,'auguria',1,'','left','companies',161587,NULL,NULL,3,'/societe/list.php?type=p&leftmenu=prospects','','ListProspectsShort',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161594,'auguria',1,'','left','companies',161593,NULL,NULL,0,'/societe/card.php?leftmenu=prospects&action=create&type=p','','MenuNewProspect',NULL,'companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161596,'auguria',1,'','left','companies',161587,NULL,NULL,4,'/societe/list.php?type=c&leftmenu=customers','','ListCustomersShort',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161597,'auguria',1,'','left','companies',161596,NULL,NULL,0,'/societe/card.php?leftmenu=customers&action=create&type=c','','MenuNewCustomer',NULL,'companies',2,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161687,'auguria',1,'','left','companies',161089,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','ContactsAddresses',NULL,'companies',0,'contacts','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161688,'auguria',1,'','left','companies',161687,NULL,NULL,0,'/contact/card.php?leftmenu=contacts&action=create','','NewContactAddress',NULL,'companies',1,'','$user->rights->societe->creer','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161689,'auguria',1,'','left','companies',161687,NULL,NULL,1,'/contact/list.php?leftmenu=contacts','','List',NULL,'companies',1,'','$user->rights->societe->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161691,'auguria',1,'','left','companies',161689,NULL,NULL,1,'/contact/list.php?leftmenu=contacts&type=p','','ThirdPartyProspects',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161692,'auguria',1,'','left','companies',161689,NULL,NULL,2,'/contact/list.php?leftmenu=contacts&type=c','','ThirdPartyCustomers',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161693,'auguria',1,'','left','companies',161689,NULL,NULL,3,'/contact/list.php?leftmenu=contacts&type=f','','ThirdPartySuppliers',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled && $conf->fournisseur->enabled',2,'2017-08-30 15:14:30'),(161694,'auguria',1,'','left','companies',161689,NULL,NULL,4,'/contact/list.php?leftmenu=contacts&type=o','','Others',NULL,'companies',2,'','$user->rights->societe->contact->lire','$conf->societe->enabled',2,'2017-08-30 15:14:30'),(161737,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=1','','SuppliersCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161738,'auguria',1,'','left','companies',161737,NULL,NULL,0,'/categories/card.php?action=create&type=1','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161747,'auguria',1,'','left','companies',161089,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=2','','CustomersProspectsCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161748,'auguria',1,'','left','companies',161747,NULL,NULL,0,'/categories/card.php?action=create&type=2','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->fournisseur->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161757,'auguria',1,'','left','companies',161089,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=4','','ContactCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(161758,'auguria',1,'','left','companies',161757,NULL,NULL,0,'/categories/card.php?action=create&type=4','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->societe->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(162187,'auguria',1,'','left','commercial',161092,NULL,NULL,4,'/comm/propal/index.php?leftmenu=propals','','Prop',NULL,'propal',0,'propals','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162188,'auguria',1,'','left','commercial',162187,NULL,NULL,0,'/comm/propal/card.php?action=create&leftmenu=propals','','NewPropal',NULL,'propal',1,'','$user->rights->propale->creer','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162189,'auguria',1,'','left','commercial',162187,NULL,NULL,1,'/comm/propal/list.php?leftmenu=propals','','List',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162190,'auguria',1,'','left','commercial',162189,NULL,NULL,2,'/comm/propal/list.php?leftmenu=propals&search_status=0','','PropalsDraft',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162191,'auguria',1,'','left','commercial',162189,NULL,NULL,3,'/comm/propal/list.php?leftmenu=propals&search_status=1','','PropalsOpened',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162192,'auguria',1,'','left','commercial',162189,NULL,NULL,4,'/comm/propal/list.php?leftmenu=propals&search_status=2','','PropalStatusSigned',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162193,'auguria',1,'','left','commercial',162189,NULL,NULL,5,'/comm/propal/list.php?leftmenu=propals&search_status=3','','PropalStatusNotSigned',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162194,'auguria',1,'','left','commercial',162189,NULL,NULL,6,'/comm/propal/list.php?leftmenu=propals&search_status=4','','PropalStatusBilled',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled && $leftmenu==\"propals\"',2,'2017-08-30 15:14:30'),(162197,'auguria',1,'','left','commercial',162187,NULL,NULL,4,'/comm/propal/stats/index.php?leftmenu=propals','','Statistics',NULL,'propal',1,'','$user->rights->propale->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(162287,'auguria',1,'','left','commercial',161092,NULL,NULL,5,'/commande/index.php?leftmenu=orders','','CustomersOrders',NULL,'orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162288,'auguria',1,'','left','commercial',162287,NULL,NULL,0,'/commande/card.php?action=create&leftmenu=orders','','NewOrder',NULL,'orders',1,'','$user->rights->commande->creer','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162289,'auguria',1,'','left','commercial',162287,NULL,NULL,1,'/commande/list.php?leftmenu=orders','','List',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162290,'auguria',1,'','left','commercial',162289,NULL,NULL,2,'/commande/list.php?leftmenu=orders&search_status=0','','StatusOrderDraftShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162291,'auguria',1,'','left','commercial',162289,NULL,NULL,3,'/commande/list.php?leftmenu=orders&search_status=1','','StatusOrderValidated',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162292,'auguria',1,'','left','commercial',162289,NULL,NULL,4,'/commande/list.php?leftmenu=orders&search_status=2','','StatusOrderOnProcessShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162293,'auguria',1,'','left','commercial',162289,NULL,NULL,5,'/commande/list.php?leftmenu=orders&search_status=3','','StatusOrderToBill',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162294,'auguria',1,'','left','commercial',162289,NULL,NULL,6,'/commande/list.php?leftmenu=orders&search_status=4','','StatusOrderProcessed',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162295,'auguria',1,'','left','commercial',162289,NULL,NULL,7,'/commande/list.php?leftmenu=orders&search_status=-1','','StatusOrderCanceledShort',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled && $leftmenu==\"orders\"',2,'2017-08-30 15:14:30'),(162296,'auguria',1,'','left','commercial',162287,NULL,NULL,4,'/commande/stats/index.php?leftmenu=orders','','Statistics',NULL,'orders',1,'','$user->rights->commande->lire','$conf->commande->enabled',2,'2017-08-30 15:14:30'),(162387,'auguria',1,'','left','commercial',161090,NULL,NULL,6,'/expedition/index.php?leftmenu=sendings','','Shipments',NULL,'sendings',0,'sendings','$user->rights->expedition->lire','$conf->expedition->enabled',2,'2017-08-30 15:14:30'),(162388,'auguria',1,'','left','commercial',162387,NULL,NULL,0,'/expedition/card.php?action=create2&leftmenu=sendings','','NewSending',NULL,'sendings',1,'','$user->rights->expedition->creer','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162389,'auguria',1,'','left','commercial',162387,NULL,NULL,1,'/expedition/list.php?leftmenu=sendings','','List',NULL,'sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162390,'auguria',1,'','left','commercial',162387,NULL,NULL,2,'/expedition/stats/index.php?leftmenu=sendings','','Statistics',NULL,'sendings',1,'','$user->rights->expedition->lire','$conf->expedition->enabled && $leftmenu==\"sendings\"',2,'2017-08-30 15:14:30'),(162487,'auguria',1,'','left','commercial',161092,NULL,NULL,7,'/contrat/index.php?leftmenu=contracts','','Contracts',NULL,'contracts',0,'contracts','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162488,'auguria',1,'','left','commercial',162487,NULL,NULL,0,'/contrat/card.php?&action=create&leftmenu=contracts','','NewContract',NULL,'contracts',1,'','$user->rights->contrat->creer','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162489,'auguria',1,'','left','commercial',162487,NULL,NULL,1,'/contrat/list.php?leftmenu=contracts','','List',NULL,'contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162490,'auguria',1,'','left','commercial',162487,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts','','MenuServices',NULL,'contracts',1,'','$user->rights->contrat->lire','$conf->contrat->enabled',2,'2017-08-30 15:14:30'),(162491,'auguria',1,'','left','commercial',162490,NULL,NULL,0,'/contrat/services.php?leftmenu=contracts&mode=0','','MenuInactiveServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162492,'auguria',1,'','left','commercial',162490,NULL,NULL,1,'/contrat/services.php?leftmenu=contracts&mode=4','','MenuRunningServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162493,'auguria',1,'','left','commercial',162490,NULL,NULL,2,'/contrat/services.php?leftmenu=contracts&mode=4&filter=expired','','MenuExpiredServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162494,'auguria',1,'','left','commercial',162490,NULL,NULL,3,'/contrat/services.php?leftmenu=contracts&mode=5','','MenuClosedServices',NULL,'contracts',2,'','$user->rights->contrat->lire','$conf->contrat->enabled && $leftmenu==\"contracts\"',2,'2017-08-30 15:14:30'),(162587,'auguria',1,'','left','commercial',161092,NULL,NULL,8,'/fichinter/list.php?leftmenu=ficheinter','','Interventions',NULL,'interventions',0,'ficheinter','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162588,'auguria',1,'','left','commercial',162587,NULL,NULL,0,'/fichinter/card.php?action=create&leftmenu=ficheinter','','NewIntervention',NULL,'interventions',1,'','$user->rights->ficheinter->creer','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162589,'auguria',1,'','left','commercial',162587,NULL,NULL,1,'/fichinter/list.php?leftmenu=ficheinter','','List',NULL,'interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162590,'auguria',1,'','left','commercial',162587,NULL,NULL,2,'/fichinter/stats/index.php?leftmenu=ficheinter','','Statistics',NULL,'interventions',1,'','$user->rights->ficheinter->lire','$conf->ficheinter->enabled',2,'2017-08-30 15:14:30'),(162687,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/fourn/facture/list.php?leftmenu=suppliers_bills','','BillsSuppliers',NULL,'bills',0,'supplier_bills','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162688,'auguria',1,'','left','accountancy',162687,NULL,NULL,0,'/fourn/facture/card.php?action=create&leftmenu=suppliers_bills','','NewBill',NULL,'bills',1,'','$user->rights->fournisseur->facture->creer','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162689,'auguria',1,'','left','accountancy',162687,NULL,NULL,1,'/fourn/facture/list.php?leftmenu=suppliers_bills','','List',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162690,'auguria',1,'','left','accountancy',162687,NULL,NULL,2,'/fourn/facture/paiement.php?leftmenu=suppliers_bills','','Payments',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162691,'auguria',1,'','left','accountancy',162687,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills&mode=supplier','','Statistics',NULL,'bills',1,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162692,'auguria',1,'','left','accountancy',162690,NULL,NULL,1,'/fourn/facture/rapport.php?leftmenu=suppliers_bills','','Reporting',NULL,'bills',2,'','$user->rights->fournisseur->facture->lire','$conf->supplier_invoice->enabled',2,'2017-08-30 15:14:30'),(162787,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills','','BillsCustomers',NULL,'bills',0,'customer_bills','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162788,'auguria',1,'','left','accountancy',162787,NULL,NULL,3,'/compta/facture/card.php?action=create&leftmenu=customers_bills','','NewBill',NULL,'bills',1,'','$user->rights->facture->creer','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162789,'auguria',1,'','left','accountancy',162787,NULL,NULL,5,'/compta/facture/fiche-rec.php?leftmenu=customers_bills','','ListOfTemplates',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162791,'auguria',1,'','left','accountancy',162787,NULL,NULL,6,'/compta/paiement/list.php?leftmenu=customers_bills','','Payments',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162792,'auguria',1,'','left','accountancy',162787,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills','','List',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162797,'auguria',1,'','left','accountancy',162791,NULL,NULL,1,'/compta/paiement/rapport.php?leftmenu=customers_bills','','Reportings',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162798,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank','','MenuChequeDeposits',NULL,'bills',0,'checks','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162799,'auguria',1,'','left','accountancy',162798,NULL,NULL,0,'/compta/paiement/cheque/card.php?leftmenu=checks&action=new','','NewCheckDeposit',NULL,'compta',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162800,'auguria',1,'','left','accountancy',162798,NULL,NULL,1,'/compta/paiement/cheque/list.php?leftmenu=checks','','List',NULL,'bills',1,'','$user->rights->banque->lire','empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))',2,'2017-08-30 15:14:30'),(162801,'auguria',1,'','left','accountancy',162787,NULL,NULL,8,'/compta/facture/stats/index.php?leftmenu=customers_bills','','Statistics',NULL,'bills',1,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162807,'auguria',1,'','left','accountancy',162792,NULL,NULL,1,'/compta/facture/list.php?leftmenu=customers_bills&search_status=0','','BillShortStatusDraft',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162808,'auguria',1,'','left','accountancy',162792,NULL,NULL,2,'/compta/facture/list.php?leftmenu=customers_bills&search_status=1','','BillShortStatusNotPaid',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162809,'auguria',1,'','left','accountancy',162792,NULL,NULL,3,'/compta/facture/list.php?leftmenu=customers_bills&search_status=2','','BillShortStatusPaid',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162810,'auguria',1,'','left','accountancy',162792,NULL,NULL,4,'/compta/facture/list.php?leftmenu=customers_bills&search_status=3','','BillShortStatusCanceled',NULL,'bills',2,'','$user->rights->facture->lire','$conf->facture->enabled',2,'2017-08-30 15:14:30'),(162987,'auguria',1,'','left','accountancy',161093,NULL,NULL,3,'/commande/list.php?leftmenu=orders&search_status=3','','MenuOrdersToBill',NULL,'orders',0,'orders','$user->rights->commande->lire','$conf->commande->enabled',0,'2017-08-30 15:14:30'),(163087,'auguria',1,'','left','accountancy',161093,NULL,NULL,4,'/don/index.php?leftmenu=donations&mainmenu=accountancy','','Donations',NULL,'donations',0,'donations','$user->rights->don->lire','$conf->don->enabled',2,'2017-08-30 15:14:30'),(163088,'auguria',1,'','left','accountancy',163087,NULL,NULL,0,'/don/card.php?leftmenu=donations&mainmenu=accountancy&action=create','','NewDonation',NULL,'donations',1,'','$user->rights->don->creer','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163089,'auguria',1,'','left','accountancy',163087,NULL,NULL,1,'/don/list.php?leftmenu=donations&mainmenu=accountancy','','List',NULL,'donations',1,'','$user->rights->don->lire','$conf->don->enabled && $leftmenu==\"donations\"',2,'2017-08-30 15:14:30'),(163187,'auguria',1,'','left','accountancy',161102,NULL,NULL,5,'/compta/deplacement/index.php?leftmenu=tripsandexpenses','','TripsAndExpenses',NULL,'trips',0,'tripsandexpenses','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163188,'auguria',1,'','left','accountancy',163187,NULL,NULL,1,'/compta/deplacement/card.php?action=create&leftmenu=tripsandexpenses','','New',NULL,'trips',1,'','$user->rights->deplacement->creer','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163189,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/list.php?leftmenu=tripsandexpenses','','List',NULL,'trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163190,'auguria',1,'','left','accountancy',163187,NULL,NULL,2,'/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses','','Statistics',NULL,'trips',1,'','$user->rights->deplacement->lire','$conf->deplacement->enabled',0,'2017-08-30 15:14:30'),(163287,'auguria',1,'','left','accountancy',161093,NULL,NULL,6,'/compta/charges/index.php?leftmenu=tax&mainmenu=accountancy','','MenuSpecialExpenses',NULL,'compta',0,'tax','(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) || (! empty($conf->salaries->enabled) && $user->rights->salaries->read)','$conf->tax->enabled || $conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163297,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/salaries/index.php?leftmenu=tax_salary&mainmenu=accountancy','','Salaries',NULL,'salaries',1,'tax_sal','$user->rights->salaries->payment->read','$conf->salaries->enabled',0,'2017-08-30 15:14:30'),(163298,'auguria',1,'','left','accountancy',163297,NULL,NULL,2,'/compta/salaries/card.php?leftmenu=tax_salary&action=create','','NewPayment',NULL,'companies',2,'','$user->rights->salaries->payment->write','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163299,'auguria',1,'','left','accountancy',163297,NULL,NULL,3,'/compta/salaries/index.php?leftmenu=tax_salary','','Payments',NULL,'companies',2,'','$user->rights->salaries->payment->read','$conf->salaries->enabled && $leftmenu==\"tax_salary\"',0,'2017-08-30 15:14:30'),(163307,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/loan/index.php?leftmenu=tax_loan&mainmenu=accountancy','','Loans',NULL,'loan',1,'tax_loan','$user->rights->loan->read','$conf->loan->enabled',0,'2017-08-30 15:14:30'),(163308,'auguria',1,'','left','accountancy',163307,NULL,NULL,2,'/loan/card.php?leftmenu=tax_loan&action=create','','NewLoan',NULL,'loan',2,'','$user->rights->loan->write','$conf->loan->enabled && $leftmenu==\"tax_loan\"',0,'2017-08-30 15:14:30'),(163310,'auguria',1,'','left','accountancy',163307,NULL,NULL,4,'/loan/calc.php?leftmenu=tax_loan','','Calculator',NULL,'companies',2,'','$user->rights->loan->calc','$conf->loan->enabled && $leftmenu==\"tax_loan\" && ! empty($conf->global->LOAN_SHOW_CALCULATOR)',0,'2017-08-30 15:14:30'),(163337,'auguria',1,'','left','accountancy',163287,NULL,NULL,1,'/compta/sociales/index.php?leftmenu=tax_social','','SocialContributions',NULL,'',1,'tax_social','$user->rights->tax->charges->lire','$conf->tax->enabled',0,'2017-08-30 15:14:30'),(163338,'auguria',1,'','left','accountancy',163337,NULL,NULL,2,'/compta/sociales/card.php?leftmenu=tax_social&action=create','','MenuNewSocialContribution',NULL,'',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163339,'auguria',1,'','left','accountancy',163337,NULL,NULL,3,'/compta/sociales/payments.php?leftmenu=tax_social&mainmenu=accountancy&mode=sconly','','Payments',NULL,'',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && $leftmenu==\"tax_social\"',0,'2017-08-30 15:14:30'),(163387,'auguria',1,'','left','accountancy',163287,NULL,NULL,7,'/compta/tva/index.php?leftmenu=tax_vat&mainmenu=accountancy','','VAT',NULL,'companies',1,'tax_vat','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS)',0,'2017-08-30 15:14:30'),(163388,'auguria',1,'','left','accountancy',163387,NULL,NULL,0,'/compta/tva/card.php?leftmenu=tax_vat&action=create','','New',NULL,'companies',2,'','$user->rights->tax->charges->creer','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163389,'auguria',1,'','left','accountancy',163387,NULL,NULL,1,'/compta/tva/reglement.php?leftmenu=tax_vat','','List',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163390,'auguria',1,'','left','accountancy',163387,NULL,NULL,2,'/compta/tva/clients.php?leftmenu=tax_vat','','ReportByCustomers',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163391,'auguria',1,'','left','accountancy',163387,NULL,NULL,3,'/compta/tva/quadri_detail.php?leftmenu=tax_vat','','ReportByQuarter',NULL,'companies',2,'','$user->rights->tax->charges->lire','$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu==\"tax_vat\"',0,'2017-08-30 15:14:30'),(163487,'auguria',1,'','left','accountancy',161093,NULL,NULL,7,'/accountancy/index.php?leftmenu=accountancy','','MenuAccountancy',NULL,'accountancy',0,'accounting','! empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163488,'auguria',1,'','left','accountancy',163487,NULL,NULL,2,'/accountancy/customer/index.php?leftmenu=dispatch_customer','','CustomersVentilation',NULL,'accountancy',1,'dispatch_customer','$user->rights->accounting->bind->write','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163489,'auguria',1,'','left','accountancy',163488,NULL,NULL,3,'/accountancy/customer/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163490,'auguria',1,'','left','accountancy',163488,NULL,NULL,4,'/accountancy/customer/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $leftmenu==\"dispatch_customer\"',0,'2017-08-30 15:14:30'),(163497,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/supplier/index.php?leftmenu=dispatch_supplier','','SuppliersVentilation',NULL,'accountancy',1,'ventil_supplier','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled',0,'2017-08-30 15:14:30'),(163498,'auguria',1,'','left','accountancy',163497,NULL,NULL,6,'/accountancy/supplier/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163499,'auguria',1,'','left','accountancy',163497,NULL,NULL,7,'/accountancy/supplier/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu==\"dispatch_supplier\"',0,'2017-08-30 15:14:30'),(163507,'auguria',1,'','left','accountancy',163487,NULL,NULL,5,'/accountancy/expensereport/index.php?leftmenu=dispatch_expensereport','','ExpenseReportsVentilation',NULL,'accountancy',1,'ventil_expensereport','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(163508,'auguria',1,'','left','accountancy',163507,NULL,NULL,6,'/accountancy/expensereport/list.php','','ToDispatch',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163509,'auguria',1,'','left','accountancy',163507,NULL,NULL,7,'/accountancy/expensereport/lines.php','','Dispatched',NULL,'accountancy',2,'','$user->rights->accounting->bind->write','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"dispatch_expensereport\"',0,'2017-08-30 15:14:30'),(163517,'auguria',1,'','left','accountancy',163487,NULL,NULL,15,'/accountancy/bookkeeping/list.php','','Bookkeeping',NULL,'accountancy',1,'bookkeeping','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163522,'auguria',1,'','left','accountancy',163487,NULL,NULL,16,'/accountancy/bookkeeping/balance.php','','AccountBalance',NULL,'accountancy',1,'balance','$user->rights->accounting->mouvements->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163527,'auguria',1,'','left','accountancy',163487,NULL,NULL,17,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','Reportings',NULL,'main',1,'report','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163528,'auguria',1,'','left','accountancy',163527,NULL,NULL,19,'/compta/resultat/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportInOut',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163529,'auguria',1,'','left','accountancy',163528,NULL,NULL,18,'/accountancy/report/result.php?mainmenu=accountancy&leftmenu=accountancy','','ByAccounts',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163530,'auguria',1,'','left','accountancy',163528,NULL,NULL,20,'/compta/resultat/clientfourn.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163531,'auguria',1,'','left','accountancy',163527,NULL,NULL,21,'/compta/stats/index.php?mainmenu=accountancy&leftmenu=accountancy','','ReportTurnover',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163532,'auguria',1,'','left','accountancy',163531,NULL,NULL,22,'/compta/stats/casoc.php?mainmenu=accountancy&leftmenu=accountancy','','ByCompanies',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163533,'auguria',1,'','left','accountancy',163531,NULL,NULL,23,'/compta/stats/cabyuser.php?mainmenu=accountancy&leftmenu=accountancy','','ByUsers',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163534,'auguria',1,'','left','accountancy',163531,NULL,NULL,24,'/compta/stats/cabyprodserv.php?mainmenu=accountancy&leftmenu=accountancy','','ByProductsAndServices',NULL,'main',3,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled && $leftmenu==\"accountancy\"',0,'2017-08-30 15:14:30'),(163537,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin','','FiscalPeriod',NULL,'admin',1,'accountancy_admin_period','','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\" && $conf->global->MAIN_FEATURES_LEVEL > 0',2,'2017-08-30 15:14:30'),(163538,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Setup',NULL,'accountancy',1,'accountancy_admin','$user->rights->accounting->chartofaccount','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163541,'auguria',1,'','left','accountancy',163538,NULL,NULL,10,'/accountancy/admin/journals_list.php?id=35&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingJournals',NULL,'accountancy',2,'accountancy_admin_journal','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163542,'auguria',1,'','left','accountancy',163538,NULL,NULL,20,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Pcg_version',NULL,'accountancy',2,'accountancy_admin_chartmodel','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163543,'auguria',1,'','left','accountancy',163538,NULL,NULL,30,'/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin','','Chartofaccounts',NULL,'accountancy',2,'accountancy_admin_chart','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163544,'auguria',1,'','left','accountancy',163538,NULL,NULL,40,'/accountancy/admin/categories_list.php?id=32&mainmenu=accountancy&leftmenu=accountancy_admin','','AccountingCategory',NULL,'accountancy',2,'accountancy_admin_chart_group','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163545,'auguria',1,'','left','accountancy',163538,NULL,NULL,50,'/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuDefaultAccounts',NULL,'accountancy',2,'accountancy_admin_default','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163546,'auguria',1,'','left','accountancy',163538,NULL,NULL,60,'/admin/dict.php?id=10&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuVatAccounts',NULL,'accountancy',2,'accountancy_admin_vat','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163547,'auguria',1,'','left','accountancy',163538,NULL,NULL,70,'/admin/dict.php?id=7&from=accountancy&search_country_id=__MYCOUNTRYID__&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuTaxAccounts',NULL,'accountancy',2,'accountancy_admin_tax','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163548,'auguria',1,'','left','accountancy',163538,NULL,NULL,80,'/admin/dict.php?id=17&from=accountancy&mainmenu=accountancy&leftmenu=accountancy_admin','','MenuExpenseReportAccounts',NULL,'accountancy',2,'accountancy_admin_expensereport','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $conf->expensereport->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163549,'auguria',1,'','left','accountancy',163538,NULL,NULL,90,'/accountancy/admin/productaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin','','MenuProductsAccounts',NULL,'accountancy',2,'accountancy_admin_product','$user->rights->accounting->chartofaccount','$conf->accounting->enabled && $leftmenu==\"accountancy_admin\"',0,'2017-08-30 15:14:30'),(163587,'auguria',1,'','left','accountancy',161101,NULL,NULL,9,'/compta/prelevement/index.php?leftmenu=withdraw&mainmenu=bank','','StandingOrders',NULL,'withdrawals',0,'withdraw','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled',2,'2017-08-30 15:14:30'),(163589,'auguria',1,'','left','accountancy',163587,NULL,NULL,0,'/compta/prelevement/create.php?leftmenu=withdraw','','NewStandingOrder',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163590,'auguria',1,'','left','accountancy',163587,NULL,NULL,2,'/compta/prelevement/bons.php?leftmenu=withdraw','','WithdrawalsReceipts',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163591,'auguria',1,'','left','accountancy',163587,NULL,NULL,3,'/compta/prelevement/list.php?leftmenu=withdraw','','WithdrawalsLines',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163593,'auguria',1,'','left','accountancy',163587,NULL,NULL,5,'/compta/prelevement/rejets.php?leftmenu=withdraw','','Rejects',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163594,'auguria',1,'','left','accountancy',163587,NULL,NULL,6,'/compta/prelevement/stats.php?leftmenu=withdraw','','Statistics',NULL,'withdrawals',1,'','$user->rights->prelevement->bons->lire','$conf->prelevement->enabled && $leftmenu==\"withdraw\"',2,'2017-08-30 15:14:30'),(163687,'auguria',1,'','left','accountancy',161101,NULL,NULL,1,'/compta/bank/index.php?leftmenu=bank&mainmenu=bank','','MenuBankCash',NULL,'banks',0,'bank','$user->rights->banque->lire','$conf->banque->enabled',0,'2017-08-30 15:14:30'),(163688,'auguria',1,'','left','accountancy',163687,NULL,NULL,0,'/compta/bank/card.php?action=create&leftmenu=bank','','MenuNewFinancialAccount',NULL,'banks',1,'','$user->rights->banque->configurer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163690,'auguria',1,'','left','accountancy',163687,NULL,NULL,2,'/compta/bank/bankentries.php?leftmenu=bank','','ListTransactions',NULL,'banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163691,'auguria',1,'','left','accountancy',163687,NULL,NULL,3,'/compta/bank/budget.php?leftmenu=bank','','ListTransactionsByCategory',NULL,'banks',1,'','$user->rights->banque->lire','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163693,'auguria',1,'','left','accountancy',163687,NULL,NULL,5,'/compta/bank/transfer.php?leftmenu=bank','','BankTransfers',NULL,'banks',1,'','$user->rights->banque->transfer','$conf->banque->enabled && ($leftmenu==\"bank\" || $leftmenu==\"checks\" || $leftmenu==\"withdraw\")',0,'2017-08-30 15:14:30'),(163737,'auguria',1,'','left','accountancy',161101,NULL,NULL,4,'/categories/index.php?leftmenu=bank&type=5','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163738,'auguria',1,'','left','accountancy',163737,NULL,NULL,0,'/categories/card.php?leftmenu=bank&action=create&type=5','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(163787,'auguria',1,'','left','accountancy',161093,NULL,NULL,11,'/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy','','Reportings',NULL,'main',0,'ca','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled',0,'2017-08-30 15:14:30'),(163792,'auguria',1,'','left','accountancy',163487,NULL,NULL,1,'','','Journalization',NULL,'main',1,'','$user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163793,'auguria',1,'','left','accountancy',163792,NULL,NULL,4,'/accountancy/journal/sellsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=1','','SellsJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163794,'auguria',1,'','left','accountancy',163792,NULL,NULL,1,'/accountancy/journal/bankjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=3','','BankJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163795,'auguria',1,'','left','accountancy',163792,NULL,NULL,2,'/accountancy/journal/expensereportsjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=6','','ExpenseReportJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163796,'auguria',1,'','left','accountancy',163792,NULL,NULL,3,'/accountancy/journal/purchasesjournal.php?mainmenu=accountancy&leftmenu=accountancy_journal&id_journal=2','','PurchasesJournal',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->accounting->enabled',0,'2017-08-30 15:14:30'),(163798,'auguria',1,'','left','accountancy',163787,NULL,NULL,0,'/compta/resultat/index.php?leftmenu=ca','','ReportInOut',NULL,'main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163799,'auguria',1,'','left','accountancy',163788,NULL,NULL,0,'/compta/resultat/clientfourn.php?leftmenu=ca','','ByCompanies',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163800,'auguria',1,'','left','accountancy',163787,NULL,NULL,1,'/compta/stats/index.php?leftmenu=ca','','ReportTurnover',NULL,'main',1,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163801,'auguria',1,'','left','accountancy',163790,NULL,NULL,0,'/compta/stats/casoc.php?leftmenu=ca','','ByCompanies',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163802,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyuser.php?leftmenu=ca','','ByUsers',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163803,'auguria',1,'','left','accountancy',163790,NULL,NULL,1,'/compta/stats/cabyprodserv.php?leftmenu=ca','','ByProductsAndServices',NULL,'main',2,'','$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire','$conf->comptabilite->enabled && $leftmenu==\"ca\"',0,'2017-08-30 15:14:30'),(163887,'auguria',1,'','left','products',161090,NULL,NULL,0,'/product/index.php?leftmenu=product&type=0','','Products',NULL,'products',0,'product','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163888,'auguria',1,'','left','products',163887,NULL,NULL,0,'/product/card.php?leftmenu=product&action=create&type=0','','NewProduct',NULL,'products',1,'','$user->rights->produit->creer','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163889,'auguria',1,'','left','products',163887,NULL,NULL,1,'/product/list.php?leftmenu=product&type=0','','List',NULL,'products',1,'','$user->rights->produit->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163890,'auguria',1,'','left','products',163887,NULL,NULL,4,'/product/reassort.php?type=0','','Stocks',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->product->enabled',2,'2017-08-30 15:14:30'),(163891,'auguria',1,'','left','products',163887,NULL,NULL,7,'/product/stats/card.php?id=all&leftmenu=stats&type=0','','Statistics',NULL,'main',1,'','$user->rights->produit->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(163892,'auguria',1,'','left','products',163887,NULL,NULL,5,'/product/reassortlot.php?type=0','','StocksByLotSerial',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163893,'auguria',1,'','left','products',163887,NULL,NULL,6,'/product/stock/productlot_list.php','','LotSerial',NULL,'products',1,'','$user->rights->produit->lire && $user->rights->stock->lire','$conf->productbatch->enabled',2,'2017-08-30 15:14:30'),(163987,'auguria',1,'','left','products',161090,NULL,NULL,1,'/product/index.php?leftmenu=service&type=1','','Services',NULL,'products',0,'service','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163988,'auguria',1,'','left','products',163987,NULL,NULL,0,'/product/card.php?leftmenu=service&action=create&type=1','','NewService',NULL,'products',1,'','$user->rights->service->creer','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163989,'auguria',1,'','left','products',163987,NULL,NULL,1,'/product/list.php?leftmenu=service&type=1','','List',NULL,'products',1,'','$user->rights->service->lire','$conf->service->enabled',2,'2017-08-30 15:14:30'),(163990,'auguria',1,'','left','products',163987,NULL,NULL,5,'/product/stats/card.php?id=all&leftmenu=stats&type=1','','Statistics',NULL,'main',1,'','$user->rights->service->lire','$conf->propal->enabled',2,'2017-08-30 15:14:30'),(164187,'auguria',1,'','left','products',161090,NULL,NULL,3,'/product/stock/index.php?leftmenu=stock','','Stock',NULL,'stocks',0,'stock','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164188,'auguria',1,'','left','products',164187,NULL,NULL,0,'/product/stock/card.php?action=create','','MenuNewWarehouse',NULL,'stocks',1,'','$user->rights->stock->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164189,'auguria',1,'','left','products',164187,NULL,NULL,1,'/product/stock/list.php','','List',NULL,'stocks',1,'','$user->rights->stock->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164191,'auguria',1,'','left','products',164187,NULL,NULL,3,'/product/stock/mouvement.php','','Movements',NULL,'stocks',1,'','$user->rights->stock->mouvement->lire','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164192,'auguria',1,'','left','products',164187,NULL,NULL,4,'/product/stock/replenish.php','','Replenishments',NULL,'stocks',1,'','$user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire','$conf->stock->enabled && $conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(164193,'auguria',1,'','left','products',164187,NULL,NULL,5,'/product/stock/massstockmove.php','','MassStockTransferShort',NULL,'stocks',1,'','$user->rights->stock->mouvement->creer','$conf->stock->enabled',2,'2017-08-30 15:14:30'),(164287,'auguria',1,'','left','products',161090,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=0','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164288,'auguria',1,'','left','products',164287,NULL,NULL,0,'/categories/card.php?action=create&type=0','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164487,'auguria',1,'','left','project',161094,NULL,NULL,3,'/projet/activity/perweek.php?leftmenu=projects','','NewTimeSpent',NULL,'projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164687,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/index.php?leftmenu=projects','','Projects',NULL,'projects',0,'projects','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164688,'auguria',1,'','left','project',164687,NULL,NULL,1,'/projet/card.php?leftmenu=projects&action=create','','NewProject',NULL,'projects',1,'','$user->rights->projet->creer','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164689,'auguria',1,'','left','project',164687,NULL,NULL,2,'/projet/list.php?leftmenu=projects','','List',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164690,'auguria',1,'','left','project',164687,NULL,NULL,3,'/projet/stats/index.php?leftmenu=projects','','Statistics',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled',2,'2017-08-30 15:14:30'),(164787,'auguria',1,'','left','project',161094,NULL,NULL,0,'/projet/activity/index.php?leftmenu=projects','','Activities',NULL,'projects',0,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164788,'auguria',1,'','left','project',164787,NULL,NULL,1,'/projet/tasks.php?leftmenu=projects&action=create','','NewTask',NULL,'projects',1,'','$user->rights->projet->creer','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164789,'auguria',1,'','left','project',164787,NULL,NULL,2,'/projet/tasks/list.php?leftmenu=projects','','List',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164791,'auguria',1,'','left','project',164787,NULL,NULL,4,'/projet/tasks/stats/index.php?leftmenu=projects','','Statistics',NULL,'projects',1,'','$user->rights->projet->lire','$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS',2,'2017-08-30 15:14:30'),(164891,'auguria',1,'','left','project',161094,NULL,NULL,4,'/categories/index.php?leftmenu=cat&type=6','','Categories',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164892,'auguria',1,'','left','project',164891,NULL,NULL,0,'/categories/card.php?action=create&type=6','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->categorie->enabled',2,'2017-08-30 15:14:30'),(164987,'auguria',1,'','left','tools',161095,NULL,NULL,0,'/comm/mailing/index.php?leftmenu=mailing','','EMailings',NULL,'mails',0,'mailing','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164988,'auguria',1,'','left','tools',164987,NULL,NULL,0,'/comm/mailing/card.php?leftmenu=mailing&action=create','','NewMailing',NULL,'mails',1,'','$user->rights->mailing->creer','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(164989,'auguria',1,'','left','tools',164987,NULL,NULL,1,'/comm/mailing/list.php?leftmenu=mailing','','List',NULL,'mails',1,'','$user->rights->mailing->lire','$conf->mailing->enabled',0,'2017-08-30 15:14:30'),(165187,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/exports/index.php?leftmenu=export','','FormatedExport',NULL,'exports',0,'export','$user->rights->export->lire','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165188,'auguria',1,'','left','tools',165187,NULL,NULL,0,'/exports/export.php?leftmenu=export','','NewExport',NULL,'exports',1,'','$user->rights->export->creer','$conf->export->enabled',2,'2017-08-30 15:14:30'),(165217,'auguria',1,'','left','tools',161095,NULL,NULL,2,'/imports/index.php?leftmenu=import','','FormatedImport',NULL,'exports',0,'import','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165218,'auguria',1,'','left','tools',165217,NULL,NULL,0,'/imports/import.php?leftmenu=import','','NewImport',NULL,'exports',1,'','$user->rights->import->run','$conf->import->enabled',2,'2017-08-30 15:14:30'),(165287,'auguria',1,'','left','members',161100,NULL,NULL,0,'/adherents/index.php?leftmenu=members&mainmenu=members','','Members',NULL,'members',0,'members','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165288,'auguria',1,'','left','members',165287,NULL,NULL,0,'/adherents/card.php?leftmenu=members&action=create','','NewMember',NULL,'members',1,'','$user->rights->adherent->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165289,'auguria',1,'','left','members',165287,NULL,NULL,1,'/adherents/list.php','','List',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165290,'auguria',1,'','left','members',165289,NULL,NULL,2,'/adherents/list.php?leftmenu=members&statut=-1','','MenuMembersToValidate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165291,'auguria',1,'','left','members',165289,NULL,NULL,3,'/adherents/list.php?leftmenu=members&statut=1','','MenuMembersValidated',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165292,'auguria',1,'','left','members',165289,NULL,NULL,4,'/adherents/list.php?leftmenu=members&statut=1&filter=outofdate','','MenuMembersNotUpToDate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165293,'auguria',1,'','left','members',165289,NULL,NULL,5,'/adherents/list.php?leftmenu=members&statut=1&filter=uptodate','','MenuMembersUpToDate',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165294,'auguria',1,'','left','members',165289,NULL,NULL,6,'/adherents/list.php?leftmenu=members&statut=0','','MenuMembersResiliated',NULL,'members',2,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165295,'auguria',1,'','left','members',165287,NULL,NULL,7,'/adherents/stats/geo.php?leftmenu=members&mode=memberbycountry','','MenuMembersStats',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165387,'auguria',1,'','left','members',161100,NULL,NULL,1,'/adherents/index.php?leftmenu=members&mainmenu=members','','Subscriptions',NULL,'compta',0,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165388,'auguria',1,'','left','members',165387,NULL,NULL,0,'/adherents/list.php?statut=-1&leftmenu=accountancy&mainmenu=members','','NewSubscription',NULL,'compta',1,'','$user->rights->adherent->cotisation->creer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165389,'auguria',1,'','left','members',165387,NULL,NULL,1,'/adherents/subscription/list.php?leftmenu=members','','List',NULL,'compta',1,'','$user->rights->adherent->cotisation->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165390,'auguria',1,'','left','members',165387,NULL,NULL,7,'/adherents/stats/index.php?leftmenu=members','','MenuMembersStats',NULL,'members',1,'','$user->rights->adherent->lire','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165589,'auguria',1,'','left','members',165287,NULL,NULL,9,'/adherents/htpasswd.php?leftmenu=export','','Filehtpasswd',NULL,'members',1,'','$user->rights->adherent->export','! empty($conf->global->MEMBER_LINK_TO_HTPASSWDFILE) && $conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165590,'auguria',1,'','left','members',165287,NULL,NULL,10,'/adherents/cartes/carte.php?leftmenu=export','','MembersCards',NULL,'members',1,'','$user->rights->adherent->export','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165687,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/user/index.php?leftmenu=hrm&mode=employee','','Employees',NULL,'hrm',0,'hrm','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165688,'auguria',1,'','left','hrm',165687,NULL,NULL,1,'/user/card.php?action=create&employee=1','','NewEmployee',NULL,'hrm',1,'','$user->rights->hrm->employee->write','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165689,'auguria',1,'','left','hrm',165687,NULL,NULL,2,'/user/index.php?$leftmenu=hrm&mode=employee&contextpage=employeelist','','List',NULL,'hrm',1,'','$user->rights->hrm->employee->read','$conf->hrm->enabled',0,'2017-08-30 15:14:30'),(165787,'auguria',1,'','left','members',161100,NULL,NULL,5,'/adherents/type.php?leftmenu=setup&mainmenu=members','','MembersTypes',NULL,'members',0,'setup','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165788,'auguria',1,'','left','members',165787,NULL,NULL,0,'/adherents/type.php?leftmenu=setup&mainmenu=members&action=create','','New',NULL,'members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(165789,'auguria',1,'','left','members',165787,NULL,NULL,1,'/adherents/type.php?leftmenu=setup&mainmenu=members','','List',NULL,'members',1,'','$user->rights->adherent->configurer','$conf->adherent->enabled',2,'2017-08-30 15:14:30'),(166087,'auguria',1,'','left','hrm',161102,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','CPTitreMenu',NULL,'holiday',0,'hrm','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166088,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/card.php?&action=request','','MenuAddCP',NULL,'holiday',1,'','$user->rights->holiday->write','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166089,'auguria',1,'','left','hrm',166087,NULL,NULL,1,'/holiday/list.php?&leftmenu=hrm','','List',NULL,'holiday',1,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166090,'auguria',1,'','left','hrm',166089,NULL,NULL,1,'/holiday/list.php?select_statut=2&leftmenu=hrm','','ListToApprove',NULL,'trips',2,'','$user->rights->holiday->read','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166091,'auguria',1,'','left','hrm',166087,NULL,NULL,2,'/holiday/define_holiday.php?&action=request','','MenuConfCP',NULL,'holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166092,'auguria',1,'','left','hrm',166087,NULL,NULL,3,'/holiday/view_log.php?&action=request','','MenuLogCP',NULL,'holiday',1,'','$user->rights->holiday->define_holiday','$conf->holiday->enabled',0,'2017-08-30 15:14:30'),(166187,'auguria',1,'','left','commercial',161092,NULL,NULL,6,'/fourn/commande/index.php?leftmenu=orders_suppliers','','SuppliersOrders',NULL,'orders',0,'orders_suppliers','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166188,'auguria',1,'','left','commercial',166187,NULL,NULL,0,'/fourn/commande/card.php?action=create&leftmenu=orders_suppliers','','NewOrder',NULL,'orders',1,'','$user->rights->fournisseur->commande->creer','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166189,'auguria',1,'','left','commercial',166187,NULL,NULL,1,'/fourn/commande/list.php?leftmenu=orders_suppliers&search_status=0','','List',NULL,'orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166195,'auguria',1,'','left','commercial',166187,NULL,NULL,7,'/commande/stats/index.php?leftmenu=orders_suppliers&mode=supplier','','Statistics',NULL,'orders',1,'','$user->rights->fournisseur->commande->lire','$conf->supplier_order->enabled',2,'2017-08-30 15:14:30'),(166287,'auguria',1,'','left','members',161100,NULL,NULL,3,'/categories/index.php?leftmenu=cat&type=3','','MembersCategoriesShort',NULL,'categories',0,'cat','$user->rights->categorie->lire','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166288,'auguria',1,'','left','members',166287,NULL,NULL,0,'/categories/card.php?action=create&type=3','','NewCategory',NULL,'categories',1,'','$user->rights->categorie->creer','$conf->adherent->enabled && $conf->categorie->enabled',2,'2017-08-30 15:14:30'),(166387,'auguria',1,'','left','hrm',161102,NULL,NULL,5,'/expensereport/index.php?leftmenu=expensereport','','TripsAndExpenses',NULL,'trips',0,'expensereport','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166388,'auguria',1,'','left','hrm',166387,NULL,NULL,1,'/expensereport/card.php?action=create&leftmenu=expensereport','','New',NULL,'trips',1,'','$user->rights->expensereport->creer','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166389,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/list.php?leftmenu=expensereport','','List',NULL,'trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166390,'auguria',1,'','left','hrm',166389,NULL,NULL,2,'/expensereport/list.php?search_status=2&leftmenu=expensereport','','ListToApprove',NULL,'trips',2,'','$user->rights->expensereport->approve','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(166391,'auguria',1,'','left','hrm',166387,NULL,NULL,2,'/expensereport/stats/index.php?leftmenu=expensereport','','Statistics',NULL,'trips',1,'','$user->rights->expensereport->lire','$conf->expensereport->enabled',0,'2017-08-30 15:14:30'),(167087,'all',1,'agenda','top','agenda',0,NULL,NULL,86,'/comm/action/index.php','','TMenuAgenda','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167088,'all',1,'agenda','left','agenda',167087,NULL,NULL,100,'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda','','Actions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167089,'all',1,'agenda','left','agenda',167088,NULL,NULL,101,'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create','','NewAction','','commercial',NULL,NULL,'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167090,'all',1,'agenda','left','agenda',167088,NULL,NULL,140,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda','','Calendar','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167091,'all',1,'agenda','left','agenda',167090,NULL,NULL,141,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167092,'all',1,'agenda','left','agenda',167090,NULL,NULL,142,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167093,'all',1,'agenda','left','agenda',167090,NULL,NULL,143,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-07-11 17:49:45'),(167094,'all',1,'agenda','left','agenda',167090,NULL,NULL,144,'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-07-11 17:49:45'),(167095,'all',1,'agenda','left','agenda',167088,NULL,NULL,110,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda','','List','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167096,'all',1,'agenda','left','agenda',167095,NULL,NULL,111,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine','','MenuToDoMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167097,'all',1,'agenda','left','agenda',167095,NULL,NULL,112,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine','','MenuDoneMyActions','','agenda',NULL,NULL,'$user->rights->agenda->myactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167098,'all',1,'agenda','left','agenda',167095,NULL,NULL,113,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1','','MenuToDoActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-07-11 17:49:45'),(167099,'all',1,'agenda','left','agenda',167095,NULL,NULL,114,'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1','','MenuDoneActions','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$user->rights->agenda->allactions->read',2,'2021-07-11 17:49:45'),(167100,'all',1,'agenda','left','agenda',167088,NULL,NULL,160,'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda','','Reportings','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->agenda->enabled',2,'2021-07-11 17:49:45'),(167101,'all',1,'agenda','left','agenda',167088,NULL,NULL,170,'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10','','Categories','','agenda',NULL,NULL,'$user->rights->agenda->allactions->read','$conf->categorie->enabled',2,'2021-07-11 17:49:45'),(167102,'all',1,'barcode','left','tools',-1,NULL,'tools',200,'/barcode/printsheet.php?mainmenu=tools&leftmenu=barcodeprint','','BarCodePrintsheet','','products',NULL,'barcodeprint','($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled',2,'2021-07-11 17:49:46'),(167103,'all',1,'barcode','left','home',-1,'admintools','home',300,'/barcode/codeinit.php?mainmenu=home&leftmenu=admintools','','MassBarcodeInit','','products',NULL,NULL,'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->creer_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)','$conf->barcode->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu)',0,'2021-07-11 17:49:46'),(167104,'all',1,'cron','left','home',-1,'admintools','home',200,'/cron/list.php?leftmenu=admintools','','CronList','','cron',NULL,NULL,'$user->rights->cron->read','$conf->cron->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',2,'2021-07-11 17:49:46'),(167105,'all',1,'blockedlog','left','tools',-1,NULL,'tools',200,'/blockedlog/admin/blockedlog_list.php?mainmenu=tools&leftmenu=blockedlogbrowser','','BrowseBlockedLog','','blockedlog',NULL,'blockedlogbrowser','$user->rights->blockedlog->read','$conf->blockedlog->enabled',2,'2021-07-11 17:49:46'),(167106,'all',1,'ecm','top','ecm',0,NULL,NULL,82,'/ecm/index.php','','MenuECM','','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload || $user->rights->ecm->setup','$conf->ecm->enabled',2,'2021-07-11 17:49:46'),(167107,'all',1,'ecm','left','ecm',-1,NULL,'ecm',101,'/ecm/index.php?mainmenu=ecm&leftmenu=ecm','','ECMArea','','ecm',NULL,'ecm','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2021-07-11 17:49:46'),(167108,'all',1,'ecm','left','ecm',-1,'ecm','ecm',102,'/ecm/index.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsManual','','ecm',NULL,'ecm_manual','$user->rights->ecm->read || $user->rights->ecm->upload','$user->rights->ecm->read || $user->rights->ecm->upload',2,'2021-07-11 17:49:46'),(167109,'all',1,'ecm','left','ecm',-1,'ecm','ecm',103,'/ecm/index_auto.php?action=file_manager&mainmenu=ecm&leftmenu=ecm','','ECMSectionsAuto','','ecm',NULL,NULL,'$user->rights->ecm->read || $user->rights->ecm->upload','($user->rights->ecm->read || $user->rights->ecm->upload) && ! empty($conf->global->ECM_AUTO_TREE_ENABLED)',2,'2021-07-11 17:49:46'),(167110,'all',1,'margins','left','billing',-1,NULL,'billing',100,'/margin/index.php','','Margins','','margins',NULL,'margins','$user->rights->margins->liretous','$conf->margin->enabled',2,'2021-07-11 17:49:47'),(167111,'all',1,'opensurvey','left','tools',-1,NULL,'tools',200,'/opensurvey/index.php?mainmenu=tools&leftmenu=opensurvey','','Survey','','opensurvey',NULL,'opensurvey','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2021-07-11 17:49:47'),(167112,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',210,'/opensurvey/wizard/index.php','','NewSurvey','','opensurvey',NULL,'opensurvey_new','$user->rights->opensurvey->write','$conf->opensurvey->enabled',0,'2021-07-11 17:49:47'),(167113,'all',1,'opensurvey','left','tools',-1,'opensurvey','tools',220,'/opensurvey/list.php','','List','','opensurvey',NULL,'opensurvey_list','$user->rights->opensurvey->read','$conf->opensurvey->enabled',0,'2021-07-11 17:49:47'),(167114,'all',1,'printing','left','home',-1,'admintools','home',300,'/printing/index.php?mainmenu=home&leftmenu=admintools','','MenuDirectPrinting','','printing',NULL,NULL,'$user->rights->printing->read','$conf->printing->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)',0,'2021-07-11 17:49:47'),(167115,'all',1,'recruitment','left','hrm',-1,NULL,'hrm',1001,'/recruitment/recruitmentindex.php','','Recruitment','','recruitment',NULL,'recruitmentjobposition','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-07-11 17:49:47'),(167116,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1002,'/recruitment/recruitmentjobposition_card.php?action=create','','NewPositionToBeFilled','','recruitment',NULL,'recruitment_recruitmentjobposition_new','$user->rights->recruitment->recruitmentjobposition->write','$conf->recruitment->enabled',2,'2021-07-11 17:49:47'),(167117,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1003,'/recruitment/recruitmentjobposition_list.php','','ListOfPositionsToBeFilled','','recruitment',NULL,'recruitment_recruitmentjobposition_list','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-07-11 17:49:47'),(167118,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1004,'/recruitment/recruitmentcandidature_card.php?action=create','','NewCandidature','','recruitment',NULL,'recruitment_recruitmentcandidature_new','$user->rights->recruitment->recruitmentjobposition->write','$conf->recruitment->enabled',2,'2021-07-11 17:49:47'),(167119,'all',1,'recruitment','left','hrm',-1,'recruitmentjobposition','hrm',1005,'/recruitment/recruitmentcandidature_list.php','','ListOfCandidatures','','recruitment',NULL,'recruitment_recruitmentcandidature_list','$user->rights->recruitment->recruitmentjobposition->read','$conf->recruitment->enabled',2,'2021-07-11 17:49:47'),(167120,'all',1,'resource','left','tools',-1,NULL,'tools',100,'/resource/list.php','','MenuResourceIndex','','resource',NULL,'resource','$user->rights->resource->read','1',0,'2021-07-11 17:49:47'),(167121,'all',1,'resource','left','tools',-1,'resource','tools',101,'/resource/card.php?action=create','','MenuResourceAdd','','resource',NULL,'resource_add','$user->rights->resource->write','1',0,'2021-07-11 17:49:47'),(167122,'all',1,'resource','left','tools',-1,'resource','tools',102,'/resource/list.php','','List','','resource',NULL,'resource_list','$user->rights->resource->read','1',0,'2021-07-11 17:49:47'),(167123,'all',1,'stripe','left','bank',-1,NULL,'bank',100,'','','StripeAccount','','stripe',NULL,'stripe','$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-07-11 17:49:47'),(167124,'all',1,'stripe','left','bank',-1,'stripe','bank',102,'/stripe/charge.php','','StripeChargeList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-07-11 17:49:47'),(167125,'all',1,'stripe','left','bank',-1,'stripe','bank',102,'/stripe/transaction.php','','StripeTransactionList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-07-11 17:49:47'),(167126,'all',1,'stripe','left','bank',-1,'stripe','bank',103,'/stripe/payout.php','','StripePayoutList','','stripe',NULL,NULL,'$user->rights->banque->lire','$conf->stripe->enabled && $conf->banque->enabled && $conf->global->MAIN_FEATURES_LEVEL >= 1',0,'2021-07-11 17:49:47'),(167127,'all',1,'ticket','left','ticket',-1,NULL,'ticket',101,'/ticket/index.php','','Ticket','','ticket',NULL,'ticket','$user->rights->ticket->read','$conf->ticket->enabled',2,'2021-07-11 17:49:47'),(167128,'all',1,'ticket','left','ticket',-1,'ticket','ticket',102,'/ticket/card.php?action=create','','NewTicket','','ticket',NULL,NULL,'$user->rights->ticket->write','$conf->ticket->enabled',2,'2021-07-11 17:49:47'),(167129,'all',1,'ticket','left','ticket',-1,'ticket','ticket',103,'/ticket/list.php?search_fk_status=non_closed','','List','','ticket',NULL,'ticketlist','$user->rights->ticket->read','$conf->ticket->enabled',2,'2021-07-11 17:49:47'),(167130,'all',1,'ticket','left','ticket',-1,'ticket','ticket',105,'/ticket/list.php?mode=mine&search_fk_status=non_closed','','MenuTicketMyAssign','','ticket',NULL,'ticketmy','$user->rights->ticket->read','$conf->ticket->enabled',0,'2021-07-11 17:49:47'),(167131,'all',1,'ticket','left','ticket',-1,'ticket','ticket',107,'/ticket/stats/index.php','','Statistics','','ticket',NULL,NULL,'$user->rights->ticket->read','$conf->ticket->enabled',0,'2021-07-11 17:49:47'),(167132,'all',1,'takepos','top','takepos',0,NULL,NULL,1001,'/takepos/index.php','takepos','PointOfSaleShort','','cashdesk',NULL,NULL,'$user->rights->takepos->run','$conf->takepos->enabled',2,'2021-07-11 17:49:48'),(167133,'all',1,'website','top','website',0,NULL,NULL,100,'/website/index.php','','WebSites','','website',NULL,NULL,'$user->rights->website->read','$conf->website->enabled',2,'2021-07-11 17:49:48'); /*!40000 ALTER TABLE `llx_menu` ENABLE KEYS */; UNLOCK TABLES; @@ -8721,32 +8028,6 @@ LOCK TABLES `llx_mrp_mo_extrafields` WRITE; /*!40000 ALTER TABLE `llx_mrp_mo_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_mrp_myobject_extrafields` --- - -DROP TABLE IF EXISTS `llx_mrp_myobject_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_mrp_myobject_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_fk_object` (`fk_object`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_mrp_myobject_extrafields` --- - -LOCK TABLES `llx_mrp_myobject_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_mrp_myobject_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_mrp_myobject_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_mrp_production` -- @@ -9204,29 +8485,6 @@ INSERT INTO `llx_opensurvey_user_studs` VALUES (1,'gfdgdf','om4e7azfiurnjtqe','0 /*!40000 ALTER TABLE `llx_opensurvey_user_studs` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_origines` --- - -DROP TABLE IF EXISTS `llx_origines`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_origines` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `source` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_origines` --- - -LOCK TABLES `llx_origines` WRITE; -/*!40000 ALTER TABLE `llx_origines` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_origines` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_overwrite_trans` -- @@ -9317,7 +8575,7 @@ CREATE TABLE `llx_paiement` ( LOCK TABLES `llx_paiement` WRITE; /*!40000 ALTER TABLE `llx_paiement` DISABLE KEYS */; -INSERT INTO `llx_paiement` VALUES (3,'',NULL,1,'2013-07-18 20:50:47','2020-12-10 12:24:22','2020-07-08 12:00:00',10.00000000,4,'','',6,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(5,'',NULL,1,'2013-08-01 03:34:11','2020-12-10 12:24:22','2020-08-01 03:34:11',5.63000000,6,'','Payment Invoice FA1108-0003',8,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(6,'',NULL,1,'2013-08-06 20:33:54','2020-12-10 12:24:22','2020-08-06 20:33:53',5.98000000,4,'','Payment Invoice FA1108-0004',13,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(8,'',NULL,1,'2013-08-08 02:53:40','2020-12-10 12:24:22','2020-08-08 12:00:00',26.10000000,4,'','',14,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(9,'',NULL,1,'2013-08-08 02:55:58','2020-12-10 12:24:23','2020-08-08 12:00:00',26.96000000,1,'','',15,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(17,'',NULL,1,'2014-12-09 15:28:44','2020-12-10 12:24:23','2020-12-09 12:00:00',2.00000000,4,'','',16,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(18,'',NULL,1,'2014-12-09 15:28:53','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',17,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(19,'',NULL,1,'2014-12-09 17:35:55','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',18,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(20,'',NULL,1,'2014-12-09 17:37:02','2020-12-10 12:24:23','2020-12-09 12:00:00',2.00000000,4,'','',19,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(21,'',NULL,1,'2014-12-09 18:35:07','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',20,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(23,'',NULL,1,'2014-12-12 18:54:33','2021-04-15 10:22:31','2020-12-12 12:00:00',1.00000000,1,'','',21,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(24,'',NULL,1,'2015-03-06 16:48:16','2021-04-15 10:22:31','2021-03-06 00:00:00',20.00000000,4,'','Adhésion/cotisation 2016',22,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(25,'',NULL,1,'2015-03-20 14:30:11','2021-04-15 10:22:31','2021-03-20 00:00:00',10.00000000,2,'','Adhésion/cotisation 2011',23,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(26,'',NULL,1,'2016-03-02 19:57:58','2020-12-10 12:24:23','2020-07-09 12:00:00',605.00000000,2,'','',24,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(29,'',NULL,1,'2016-03-02 20:01:39','2021-04-15 10:22:31','2021-03-19 12:00:00',500.00000000,4,'','',26,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(30,'',NULL,1,'2016-03-02 20:02:06','2021-04-15 10:22:31','2021-03-21 12:00:00',400.00000000,2,'','',27,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(32,'',NULL,1,'2016-03-03 19:22:32','2020-12-10 12:24:23','2020-10-03 12:00:00',-400.00000000,4,'','',28,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(33,'',NULL,1,'2016-03-03 19:23:16','2021-04-15 10:22:31','2021-03-10 12:00:00',-300.00000000,4,'','',29,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(34,'PAY1603-0001',NULL,1,'2017-02-06 08:10:24','2021-04-15 10:22:31','2021-03-22 12:00:00',150.00000000,7,'','',33,12,NULL,0,0,0.00000000,150.00000000,NULL,NULL),(35,'PAY1603-0002',NULL,1,'2017-02-06 08:10:50','2021-04-15 10:22:31','2021-03-25 12:00:00',140.00000000,3,'','',34,12,NULL,0,0,0.00000000,140.00000000,NULL,NULL),(36,'PAY1702-0003',NULL,1,'2017-02-21 16:07:43','2021-04-15 10:22:31','2021-02-21 12:00:00',50.00000000,3,'T170201','',37,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(38,'PAY1803-0004',NULL,1,'2018-03-16 13:59:31','2021-04-15 10:22:31','2021-03-16 12:00:00',10.00000000,7,'','',39,12,NULL,0,0,0.00000000,10.00000000,NULL,NULL),(39,'PAY1801-0005',NULL,1,'2019-10-04 10:28:14','2021-04-15 10:22:31','2021-01-19 12:00:00',5.63000000,4,'','',41,12,NULL,0,0,0.00000000,5.63000000,NULL,NULL),(40,'PAY2001-0006',NULL,1,'2020-01-16 02:36:48','2021-04-15 10:22:31','2021-01-16 12:00:00',20.50000000,2,'','',50,12,NULL,0,0,0.00000000,20.50000000,NULL,NULL),(41,'PAY2001-0007',NULL,1,'2020-01-21 10:23:17','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,7,'','Subscription 2017',53,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(42,'PAY2001-0008',NULL,1,'2020-01-21 10:23:28','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,7,'','Subscription 2018',54,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(43,'PAY2001-0009',NULL,1,'2020-01-21 10:23:49','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,6,'','Subscription 2019',55,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL); +INSERT INTO `llx_paiement` VALUES (3,'',NULL,1,'2013-07-18 20:50:47','2021-07-11 17:49:28','2021-07-08 12:00:00',10.00000000,4,'','',6,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(5,'',NULL,1,'2013-08-01 03:34:11','2020-12-10 12:24:22','2020-08-01 03:34:11',5.63000000,6,'','Payment Invoice FA1108-0003',8,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(6,'',NULL,1,'2013-08-06 20:33:54','2020-12-10 12:24:22','2020-08-06 20:33:53',5.98000000,4,'','Payment Invoice FA1108-0004',13,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(8,'',NULL,1,'2013-08-08 02:53:40','2020-12-10 12:24:22','2020-08-08 12:00:00',26.10000000,4,'','',14,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(9,'',NULL,1,'2013-08-08 02:55:58','2020-12-10 12:24:23','2020-08-08 12:00:00',26.96000000,1,'','',15,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(17,'',NULL,1,'2014-12-09 15:28:44','2020-12-10 12:24:23','2020-12-09 12:00:00',2.00000000,4,'','',16,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(18,'',NULL,1,'2014-12-09 15:28:53','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',17,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(19,'',NULL,1,'2014-12-09 17:35:55','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',18,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(20,'',NULL,1,'2014-12-09 17:37:02','2020-12-10 12:24:23','2020-12-09 12:00:00',2.00000000,4,'','',19,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(21,'',NULL,1,'2014-12-09 18:35:07','2020-12-10 12:24:23','2020-12-09 12:00:00',-2.00000000,4,'','',20,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(23,'',NULL,1,'2014-12-12 18:54:33','2021-04-15 10:22:31','2020-12-12 12:00:00',1.00000000,1,'','',21,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(24,'',NULL,1,'2015-03-06 16:48:16','2021-04-15 10:22:31','2021-03-06 00:00:00',20.00000000,4,'','Adhésion/cotisation 2016',22,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(25,'',NULL,1,'2015-03-20 14:30:11','2021-04-15 10:22:31','2021-03-20 00:00:00',10.00000000,2,'','Adhésion/cotisation 2011',23,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(26,'',NULL,1,'2016-03-02 19:57:58','2021-07-11 17:49:28','2021-07-09 12:00:00',605.00000000,2,'','',24,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(29,'',NULL,1,'2016-03-02 20:01:39','2021-04-15 10:22:31','2021-03-19 12:00:00',500.00000000,4,'','',26,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(30,'',NULL,1,'2016-03-02 20:02:06','2021-04-15 10:22:31','2021-03-21 12:00:00',400.00000000,2,'','',27,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(32,'',NULL,1,'2016-03-03 19:22:32','2020-12-10 12:24:23','2020-10-03 12:00:00',-400.00000000,4,'','',28,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(33,'',NULL,1,'2016-03-03 19:23:16','2021-04-15 10:22:31','2021-03-10 12:00:00',-300.00000000,4,'','',29,1,NULL,0,0,0.00000000,0.00000000,NULL,NULL),(34,'PAY1603-0001',NULL,1,'2017-02-06 08:10:24','2021-04-15 10:22:31','2021-03-22 12:00:00',150.00000000,7,'','',33,12,NULL,0,0,0.00000000,150.00000000,NULL,NULL),(35,'PAY1603-0002',NULL,1,'2017-02-06 08:10:50','2021-04-15 10:22:31','2021-03-25 12:00:00',140.00000000,3,'','',34,12,NULL,0,0,0.00000000,140.00000000,NULL,NULL),(36,'PAY1702-0003',NULL,1,'2017-02-21 16:07:43','2021-04-15 10:22:31','2021-02-21 12:00:00',50.00000000,3,'T170201','',37,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(38,'PAY1803-0004',NULL,1,'2018-03-16 13:59:31','2021-04-15 10:22:31','2021-03-16 12:00:00',10.00000000,7,'','',39,12,NULL,0,0,0.00000000,10.00000000,NULL,NULL),(39,'PAY1801-0005',NULL,1,'2019-10-04 10:28:14','2021-04-15 10:22:31','2021-01-19 12:00:00',5.63000000,4,'','',41,12,NULL,0,0,0.00000000,5.63000000,NULL,NULL),(40,'PAY2001-0006',NULL,1,'2020-01-16 02:36:48','2021-04-15 10:22:31','2021-01-16 12:00:00',20.50000000,2,'','',50,12,NULL,0,0,0.00000000,20.50000000,NULL,NULL),(41,'PAY2001-0007',NULL,1,'2020-01-21 10:23:17','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,7,'','Subscription 2017',53,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(42,'PAY2001-0008',NULL,1,'2020-01-21 10:23:28','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,7,'','Subscription 2018',54,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL),(43,'PAY2001-0009',NULL,1,'2020-01-21 10:23:49','2021-04-15 10:22:31','2021-01-21 00:00:00',50.00000000,6,'','Subscription 2019',55,12,NULL,0,0,0.00000000,50.00000000,NULL,NULL); /*!40000 ALTER TABLE `llx_paiement` ENABLE KEYS */; UNLOCK TABLES; @@ -9482,6 +8740,7 @@ CREATE TABLE `llx_partnership` ( `count_last_url_check_error` int(11) DEFAULT 0, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `model_pdf` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `last_check_backlink` datetime DEFAULT NULL, PRIMARY KEY (`rowid`), KEY `idx_partnership_rowid` (`rowid`), KEY `idx_partnership_ref` (`ref`), @@ -9545,6 +8804,8 @@ CREATE TABLE `llx_payment_donation` ( `fk_typepayment` int(11) NOT NULL, `num_payment` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `note` text COLLATE utf8_unicode_ci DEFAULT NULL, + `ext_payment_id` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, + `ext_payment_site` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, `fk_bank` int(11) NOT NULL, `fk_user_creat` int(11) DEFAULT NULL, `fk_user_modif` int(11) DEFAULT NULL, @@ -9558,7 +8819,7 @@ CREATE TABLE `llx_payment_donation` ( LOCK TABLES `llx_payment_donation` WRITE; /*!40000 ALTER TABLE `llx_payment_donation` DISABLE KEYS */; -INSERT INTO `llx_payment_donation` VALUES (1,3,'2017-09-06 20:08:36','2017-09-06 16:08:36','2017-09-06 12:00:00',10.00000000,4,'','',38,12,NULL); +INSERT INTO `llx_payment_donation` VALUES (1,3,'2017-09-06 20:08:36','2017-09-06 16:08:36','2017-09-06 12:00:00',10.00000000,4,'','',NULL,NULL,38,12,NULL); /*!40000 ALTER TABLE `llx_payment_donation` ENABLE KEYS */; UNLOCK TABLES; @@ -9781,41 +9042,6 @@ LOCK TABLES `llx_payment_vat` WRITE; /*!40000 ALTER TABLE `llx_payment_vat` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_pointage` --- - -DROP TABLE IF EXISTS `llx_pointage`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_pointage` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_user` int(11) DEFAULT NULL, - `datedeb` datetime DEFAULT NULL, - `datefin` datetime DEFAULT NULL, - `commentaire_in` text COLLATE utf8_unicode_ci DEFAULT NULL, - `commentaire_out` text COLLATE utf8_unicode_ci DEFAULT NULL, - `statut` int(11) DEFAULT NULL, - `fk_user_modify_by` int(11) NOT NULL DEFAULT 0, - `datemodif` datetime DEFAULT NULL, - `ip_deb` text COLLATE utf8_unicode_ci DEFAULT NULL, - `ip_fin` text COLLATE utf8_unicode_ci DEFAULT NULL, - `created` datetime DEFAULT NULL, - `fk_user_created_by` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_pointage` --- - -LOCK TABLES `llx_pointage` WRITE; -/*!40000 ALTER TABLE `llx_pointage` DISABLE KEYS */; -INSERT INTO `llx_pointage` VALUES (1,12,'2019-06-19 11:51:00','2019-06-19 11:51:00','','',2,0,NULL,'127.0.0.1','127.0.0.1','2019-06-19 11:51:00',0); -/*!40000 ALTER TABLE `llx_pointage` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_pos_cash_fence` -- @@ -10029,112 +9255,6 @@ LOCK TABLES `llx_prelevement_rejet` WRITE; /*!40000 ALTER TABLE `llx_prelevement_rejet` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_prestashopget_myobject` --- - -DROP TABLE IF EXISTS `llx_prestashopget_myobject`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_prestashopget_myobject` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `label` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, - `qty` int(11) DEFAULT NULL, - `status` int(11) DEFAULT NULL, - `date_creation` datetime NOT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_prestashopget_myobject` --- - -LOCK TABLES `llx_prestashopget_myobject` WRITE; -/*!40000 ALTER TABLE `llx_prestashopget_myobject` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_prestashopget_myobject` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_prestashopget_myobject_extrafields` --- - -DROP TABLE IF EXISTS `llx_prestashopget_myobject_extrafields`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_prestashopget_myobject_extrafields` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_object` int(11) NOT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_prestashopget_myobject_extrafields` --- - -LOCK TABLES `llx_prestashopget_myobject_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_prestashopget_myobject_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_prestashopget_myobject_extrafields` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_printer_receipt` --- - -DROP TABLE IF EXISTS `llx_printer_receipt`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_printer_receipt` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, - `fk_type` int(11) DEFAULT NULL, - `fk_profile` int(11) DEFAULT NULL, - `parameter` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, - `entity` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_printer_receipt` --- - -LOCK TABLES `llx_printer_receipt` WRITE; -/*!40000 ALTER TABLE `llx_printer_receipt` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_printer_receipt` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_printer_receipt_template` --- - -DROP TABLE IF EXISTS `llx_printer_receipt_template`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_printer_receipt_template` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, - `template` text COLLATE utf8_unicode_ci DEFAULT NULL, - `entity` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_printer_receipt_template` --- - -LOCK TABLES `llx_printer_receipt_template` WRITE; -/*!40000 ALTER TABLE `llx_printer_receipt_template` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_printer_receipt_template` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_printing` -- @@ -10251,6 +9371,8 @@ CREATE TABLE `llx_product` ( `net_measure_units` tinyint(4) DEFAULT NULL, `fk_state` int(11) DEFAULT NULL, `batch_mask` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, + `lifetime` int(11) DEFAULT NULL, + `qc_frequency` int(11) DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_product_ref` (`ref`,`entity`), UNIQUE KEY `uk_product_barcode` (`barcode`,`fk_barcode_type`,`entity`), @@ -10279,7 +9401,7 @@ CREATE TABLE `llx_product` ( LOCK TABLES `llx_product` WRITE; /*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; -INSERT INTO `llx_product` VALUES (1,'2012-07-08 14:33:17','2020-01-18 19:17:03',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','','',NULL,9.00000000,10.12500000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,12,1,1,0,1,0,'',NULL,NULL,'123456789066',2,'','','','',NULL,NULL,NULL,670,-3,NULL,0,NULL,0,NULL,0,2.8,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2012-07-09 00:30:01','2019-11-28 15:09:50',0,0,'PEARPIE',1,NULL,'Pear Pie','','','',NULL,10.00000000,12.00000000,8.33333000,10.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',1,12,1,1,0,0,0,'',NULL,NULL,'123456789077',2,'','','','',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2012-07-09 00:30:25','2018-01-16 16:40:03',0,0,'CAKECONTRIB',1,NULL,'Cake making contribution','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,1,'1m',NULL,NULL,'123456789088',2,'701CAKEM',NULL,NULL,'601CAKEM',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'2012-07-10 14:44:06','2021-04-15 11:40:18',0,0,'APPLEPIE',1,NULL,'Apple Pie','Nice Bio Apple Pie.
\r\n ','','',NULL,9.00000000,9.00000000,6.00000000,6.00000000,'HT',0.000,0,9.000,'1',9.000,'1',1,12,1,1,0,1,0,'',NULL,NULL,'123456789034',2,'701','','','601',NULL,NULL,NULL,500,-3,NULL,0,NULL,0,NULL,0,1021.2,10.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,'CGST+SGST',0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'2013-07-20 23:11:38','2018-01-16 16:18:24',0,0,'DOLIDROID',1,NULL,'DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

','','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,'https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','123456789023',2,'701',NULL,NULL,'601',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,'2011-12-31 00:00:00','2017-02-16 00:12:09',0,0,'COMP-XP4523',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',NULL,12,1,1,0,1,0,'',150,NULL,'123456789055',2,'701OLDC',NULL,NULL,'601OLDC',NULL,NULL,NULL,1.7,0,NULL,0,NULL,0,NULL,0,110,0.00000000,NULL,NULL,NULL,NULL,0,'20110729232310',200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,'2015-01-13 20:24:42','2019-10-08 17:21:07',0,0,'ROLLUPABC',1,NULL,'Rollup Dolibarr','A nice rollup','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,'0',0.000,'0',1,12,1,1,0,0,0,'',NULL,NULL,'123456789044',2,'','','','',NULL,NULL,NULL,95,-3,NULL,0,2.34,-4,NULL,0,-1,0.00000000,NULL,NULL,'',1,0,NULL,NULL,NULL,NULL,12.00000000,NULL,0,NULL,'',NULL,8,NULL,8,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2018-07-30 17:31:29','2018-07-30 13:35:02',0,0,'DOLICLOUD',1,NULL,'SaaS service of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','','',NULL,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,1,'',NULL,'http://www.dolicloud.com','123456789013',2,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,8.50000000,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'2017-02-16 03:49:00','2017-02-15 23:49:27',0,0,'COMP-XP4548',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,12,1,1,0,1,0,'',150,NULL,NULL,2,'',NULL,NULL,'',NULL,NULL,NULL,1.7,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'2019-10-07 00:00:00','2019-11-28 13:51:35',0,0,'PREF123456',1,NULL,'Product name in default language','Product description in default language','a private note (free text)','customs code',1,100.00000000,110.00000000,100.00000000,110.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,NULL,0,1,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-3,1,-1,4,-4,5,-3,NULL,0.00000000,NULL,NULL,NULL,0,0,'20191007122224',NULL,NULL,NULL,NULL,NULL,0,'a public note (free text)','',2,-1,3,-1,NULL,NULL,NULL,NULL,NULL,NULL),(24,'2019-11-28 16:33:35','2019-11-28 15:02:01',0,0,'POS-CARROT',1,NULL,'Carrot','','','',NULL,0.83333000,1.00000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,'2019-11-28 16:37:36','2020-01-13 11:13:19',0,0,'POS-APPLE',1,NULL,'Apple','','','',NULL,1.25000000,1.50000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,15.599999999999994,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,'2019-11-28 16:38:44','2019-11-28 12:38:44',0,0,'POS-KIWI',1,NULL,'Kiwi','','','',NULL,1.08333000,1.30000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'2019-11-28 16:39:21','2019-11-28 14:57:44',0,0,'POS-PEACH',1,NULL,'Peach','','','',NULL,1.08333000,1.30000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,'2019-11-28 16:39:58','2019-11-28 12:39:58',0,0,'POS-ORANGE',1,NULL,'Orange','','','',NULL,2.00000000,2.40000000,0.00000000,0.00000000,'HT',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'2019-11-28 17:03:14','2019-11-28 13:03:14',0,0,'POS-Eggs',1,NULL,'Eggs','','','',NULL,1.66667000,2.00000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,'2019-11-28 17:09:14','2019-11-28 13:09:14',0,0,'POS-Chips',1,NULL,'Chips','','','',NULL,0.41667000,0.50000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,30,-3,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,'2021-04-15 08:38:02','2021-04-15 11:38:02',0,0,'PRODSER',1,NULL,'Product NFC - Unique','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',12,12,1,1,0,2,0,'',0,NULL,NULL,2,'','','','','','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,0,NULL,NULL,NULL,NULL,0,NULL,'',NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO `llx_product` VALUES (1,'2012-07-08 14:33:17','2020-01-18 19:17:03',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','','',NULL,9.00000000,10.12500000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,12,1,1,0,1,0,'',NULL,NULL,'123456789066',2,'','','','',NULL,NULL,NULL,670,-3,NULL,0,NULL,0,NULL,0,2.8,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(2,'2012-07-09 00:30:01','2019-11-28 15:09:50',0,0,'PEARPIE',1,NULL,'Pear Pie','','','',NULL,10.00000000,12.00000000,8.33333000,10.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',1,12,1,1,0,0,0,'',NULL,NULL,'123456789077',2,'','','','',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(3,'2012-07-09 00:30:25','2018-01-16 16:40:03',0,0,'CAKECONTRIB',1,NULL,'Cake making contribution','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,1,'1m',NULL,NULL,'123456789088',2,'701CAKEM',NULL,NULL,'601CAKEM',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(4,'2012-07-10 14:44:06','2021-04-15 11:40:18',0,0,'APPLEPIE',1,NULL,'Apple Pie','Nice Bio Apple Pie.
\r\n ','','',NULL,9.00000000,9.00000000,6.00000000,6.00000000,'HT',0.000,0,9.000,'1',9.000,'1',1,12,1,1,0,1,0,'',NULL,NULL,'123456789034',2,'701','','','601',NULL,NULL,NULL,500,-3,NULL,0,NULL,0,NULL,0,1021.2,10.00000000,NULL,NULL,NULL,1,0,NULL,NULL,NULL,NULL,NULL,'CGST+SGST',0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(5,'2013-07-20 23:11:38','2018-01-16 16:18:24',0,0,'DOLIDROID',1,NULL,'DoliDroid, Android app for Dolibarr','DoliDroid is the Android front-end client for Dolibarr ERP & CRM web software.
\r\nThis application is not a standalone program. It is a front end to use a online hosted Dolibarr ERP & CRM software (an Open-source web software to manage your business).
\r\n

The advantage of DoliDroid are :
\r\n- DoliDroid is not a duplicate code of Dolibarr, but a front-end of a Dolibarr web installation, so all your online existing features are supported by this application. This is also true for external modules features.
\r\n- Upgrading Dolibarr will not break DoliDroid.
\r\n- DoliDroid use embedded image resources to reduce bandwidth usage.
\r\n- DoliDroid use internal cache for pages that should not change (like menu page)
\r\n- Connections parameters are saved. No need to enter them each time you use DoliDroid.
\r\n- Integration with your phone or other applications (Clicking on PDF open PDF reader, clicking onto email or phone launch your email application or launch Android dialer, ...)

\r\n\r\n

WARNING ! 

\r\n\r\n

This application need Android 4.0+ and a hosted Dolibarr ERP & CRM version 3.5 or newer accessible by internet
\r\n(For example, when hosted on any SaaS solution like DoliCloud - http://www.dolicloud.com).

','','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',1,NULL,1,1,0,0,0,'',NULL,'https://play.google.com/store/apps/details?id=com.nltechno.dolidroidpro','123456789023',2,'701',NULL,NULL,'601',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(10,'2011-12-31 00:00:00','2017-02-16 00:12:09',0,0,'COMP-XP4523',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',NULL,12,1,1,0,1,0,'',150,NULL,'123456789055',2,'701OLDC',NULL,NULL,'601OLDC',NULL,NULL,NULL,1.7,0,NULL,0,NULL,0,NULL,0,110,0.00000000,NULL,NULL,NULL,NULL,0,'20110729232310',200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(11,'2015-01-13 20:24:42','2019-10-08 17:21:07',0,0,'ROLLUPABC',1,NULL,'Rollup Dolibarr','A nice rollup','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,'0',0.000,'0',1,12,1,1,0,0,0,'',NULL,NULL,'123456789044',2,'','','','',NULL,NULL,NULL,95,-3,NULL,0,2.34,-4,NULL,0,-1,0.00000000,NULL,NULL,'',1,0,NULL,NULL,NULL,NULL,12.00000000,NULL,0,NULL,'',NULL,8,NULL,8,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(12,'2018-07-30 17:31:29','2018-07-30 13:35:02',0,0,'DOLICLOUD',1,NULL,'SaaS service of Dolibarr ERP CRM','Cloud hosting of Dolibarr ERP and CRM software','','',NULL,9.00000000,9.00000000,9.00000000,9.00000000,'HT',0.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,1,'',NULL,'http://www.dolicloud.com','123456789013',2,'',NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,8.50000000,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(13,'2017-02-16 03:49:00','2017-02-15 23:49:27',0,0,'COMP-XP4548',1,NULL,'Computer XP4523','A powerfull computer XP4523 ','This product is imported.
\r\nWarning: Delay to get it are not reliable.','USXP765',11,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,12,1,1,0,1,0,'',150,NULL,NULL,2,'',NULL,NULL,'',NULL,NULL,NULL,1.7,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,200,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(23,'2019-10-07 00:00:00','2019-11-28 13:51:35',0,0,'PREF123456',1,NULL,'Product name in default language','Product description in default language','a private note (free text)','customs code',1,100.00000000,110.00000000,100.00000000,110.00000000,'HT',10.000,0,0.000,'0',0.000,'0',12,NULL,0,1,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-3,1,-1,4,-4,5,-3,NULL,0.00000000,NULL,NULL,NULL,0,0,'20191007122224',NULL,NULL,NULL,NULL,NULL,0,'a public note (free text)','',2,-1,3,-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(24,'2019-11-28 16:33:35','2019-11-28 15:02:01',0,0,'POS-CARROT',1,NULL,'Carrot','','','',NULL,0.83333000,1.00000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(25,'2019-11-28 16:37:36','2020-01-13 11:13:19',0,0,'POS-APPLE',1,NULL,'Apple','','','',NULL,1.25000000,1.50000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,15.599999999999994,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(26,'2019-11-28 16:38:44','2019-11-28 12:38:44',0,0,'POS-KIWI',1,NULL,'Kiwi','','','',NULL,1.08333000,1.30000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(27,'2019-11-28 16:39:21','2019-11-28 14:57:44',0,0,'POS-PEACH',1,NULL,'Peach','','','',NULL,1.08333000,1.30000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,'',0,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(28,'2019-11-28 16:39:58','2019-11-28 12:39:58',0,0,'POS-ORANGE',1,NULL,'Orange','','','',NULL,2.00000000,2.40000000,0.00000000,0.00000000,'HT',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,1,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(29,'2019-11-28 17:03:14','2019-11-28 13:03:14',0,0,'POS-Eggs',1,NULL,'Eggs','','','',NULL,1.66667000,2.00000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(30,'2019-11-28 17:09:14','2019-11-28 13:09:14',0,0,'POS-Chips',1,NULL,'Chips','','','',NULL,0.41667000,0.50000000,0.00000000,0.00000000,'TTC',20.000,0,0.000,'0',0.000,'0',12,12,1,1,0,0,0,'',NULL,NULL,NULL,2,'','','','',NULL,NULL,NULL,30,-3,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),(31,'2021-04-15 08:38:02','2021-04-15 11:38:02',0,0,'PRODSER',1,NULL,'Product NFC - Unique','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',19.600,0,0.000,'0',0.000,'0',12,12,1,1,0,2,0,'',0,NULL,NULL,2,'','','','','','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,NULL,NULL,'',NULL,0,NULL,0,NULL,NULL,NULL,NULL,0,NULL,'',NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; UNLOCK TABLES; @@ -10656,36 +9778,6 @@ LOCK TABLES `llx_product_extrafields` WRITE; /*!40000 ALTER TABLE `llx_product_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_product_factory` --- - -DROP TABLE IF EXISTS `llx_product_factory`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_product_factory` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_product_father` int(11) NOT NULL DEFAULT 0, - `fk_product_children` int(11) NOT NULL DEFAULT 0, - `pmp` double(24,8) DEFAULT 0.00000000, - `price` double(24,8) DEFAULT 0.00000000, - `qty` double DEFAULT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_product_factory` (`fk_product_father`,`fk_product_children`), - KEY `idx_product_factory_fils` (`fk_product_children`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_product_factory` --- - -LOCK TABLES `llx_product_factory` WRITE; -/*!40000 ALTER TABLE `llx_product_factory` DISABLE KEYS */; -INSERT INTO `llx_product_factory` VALUES (2,26,25,0.00000000,0.00000000,3),(3,27,26,0.00000000,0.00000000,2); -/*!40000 ALTER TABLE `llx_product_factory` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_product_fournisseur_price` -- @@ -10864,6 +9956,9 @@ CREATE TABLE `llx_product_lot` ( `fk_user_creat` int(11) DEFAULT NULL, `fk_user_modif` int(11) DEFAULT NULL, `import_key` int(11) DEFAULT NULL, + `eol_date` datetime DEFAULT NULL, + `manufacturing_date` datetime DEFAULT NULL, + `scrapping_date` datetime DEFAULT NULL, PRIMARY KEY (`rowid`), UNIQUE KEY `uk_product_lot` (`fk_product`,`batch`) ) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; @@ -10875,7 +9970,7 @@ CREATE TABLE `llx_product_lot` ( LOCK TABLES `llx_product_lot` WRITE; /*!40000 ALTER TABLE `llx_product_lot` DISABLE KEYS */; -INSERT INTO `llx_product_lot` VALUES (1,1,2,'123456','2018-07-07',NULL,'2018-07-21 20:55:19','2018-12-12 10:53:58',NULL,NULL,NULL),(2,1,2,'2222','2018-07-08','2018-07-07','2018-07-21 21:00:42','2018-12-12 10:53:58',NULL,NULL,NULL),(3,1,10,'5599887766452',NULL,NULL,'2018-07-30 17:39:31','2018-12-12 10:53:58',NULL,NULL,NULL),(4,1,10,'4494487766452',NULL,NULL,'2018-07-30 17:40:12','2018-12-12 10:53:58',NULL,NULL,NULL),(39,1,1,'000000',NULL,NULL,'2020-01-08 20:41:18','2020-01-08 16:41:18',NULL,NULL,NULL),(40,1,4,'aaa','2020-01-01',NULL,'2020-01-08 20:41:18','2020-01-13 11:28:05',NULL,12,NULL),(46,1,1,'string',NULL,NULL,'2020-01-18 20:16:58','2020-01-18 19:16:58',NULL,NULL,NULL),(47,1,4,'000000',NULL,NULL,'2020-01-08 16:40:27','2020-01-21 10:30:15',1,1,NULL),(50,1,4,'Lot 2021-02',NULL,NULL,'2021-04-15 08:40:18','2021-04-15 11:40:18',NULL,NULL,NULL); +INSERT INTO `llx_product_lot` VALUES (1,1,2,'123456','2018-07-07',NULL,'2018-07-21 20:55:19','2018-12-12 10:53:58',NULL,NULL,NULL,NULL,NULL,NULL),(2,1,2,'2222','2018-07-08','2018-07-07','2018-07-21 21:00:42','2018-12-12 10:53:58',NULL,NULL,NULL,NULL,NULL,NULL),(3,1,10,'5599887766452',NULL,NULL,'2018-07-30 17:39:31','2018-12-12 10:53:58',NULL,NULL,NULL,NULL,NULL,NULL),(4,1,10,'4494487766452',NULL,NULL,'2018-07-30 17:40:12','2018-12-12 10:53:58',NULL,NULL,NULL,NULL,NULL,NULL),(39,1,1,'000000',NULL,NULL,'2020-01-08 20:41:18','2020-01-08 16:41:18',NULL,NULL,NULL,NULL,NULL,NULL),(40,1,4,'aaa','2020-01-01',NULL,'2020-01-08 20:41:18','2020-01-13 11:28:05',NULL,12,NULL,NULL,NULL,NULL),(46,1,1,'string',NULL,NULL,'2020-01-18 20:16:58','2020-01-18 19:16:58',NULL,NULL,NULL,NULL,NULL,NULL),(47,1,4,'000000',NULL,NULL,'2020-01-08 16:40:27','2020-01-21 10:30:15',1,1,NULL,NULL,NULL,NULL),(50,1,4,'Lot 2021-02',NULL,NULL,'2021-04-15 08:40:18','2021-04-15 11:40:18',NULL,NULL,NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_product_lot` ENABLE KEYS */; UNLOCK TABLES; @@ -11092,59 +10187,6 @@ INSERT INTO `llx_product_stock` VALUES (1,'2012-07-08 22:43:51',2,2,1000,NULL),( /*!40000 ALTER TABLE `llx_product_stock` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_product_subproduct` --- - -DROP TABLE IF EXISTS `llx_product_subproduct`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_product_subproduct` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_product` int(11) NOT NULL, - `fk_product_subproduct` int(11) NOT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `fk_product` (`fk_product`,`fk_product_subproduct`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_product_subproduct` --- - -LOCK TABLES `llx_product_subproduct` WRITE; -/*!40000 ALTER TABLE `llx_product_subproduct` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_product_subproduct` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_product_warehouse_properties` --- - -DROP TABLE IF EXISTS `llx_product_warehouse_properties`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_product_warehouse_properties` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_product` int(11) NOT NULL, - `fk_entrepot` int(11) NOT NULL, - `seuil_stock_alerte` float DEFAULT NULL, - `desiredstock` float DEFAULT NULL, - `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_product_warehouse_properties` --- - -LOCK TABLES `llx_product_warehouse_properties` WRITE; -/*!40000 ALTER TABLE `llx_product_warehouse_properties` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_product_warehouse_properties` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_projet` -- @@ -11351,65 +10393,6 @@ INSERT INTO `llx_projet_task_time` VALUES (2,4,'2016-12-21','2016-12-21 12:00:00 /*!40000 ALTER TABLE `llx_projet_task_time` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_projet_taskdet` --- - -DROP TABLE IF EXISTS `llx_projet_taskdet`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_projet_taskdet` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_task` int(11) NOT NULL DEFAULT 0, - `fk_product` int(11) NOT NULL DEFAULT 0, - `qty_planned` double DEFAULT NULL, - `qty_used` double DEFAULT NULL, - `qty_deleted` double DEFAULT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `pmp` double(24,8) DEFAULT 0.00000000, - `price` double(24,8) DEFAULT 0.00000000, - `fk_statut` int(11) NOT NULL DEFAULT 0, - `note_public` mediumtext COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`rowid`), - UNIQUE KEY `uk_projet_taskdet` (`fk_task`,`fk_product`), - KEY `idx_projet_taskdet_fk_task` (`fk_task`), - KEY `idx_projet_taskdet_fk_product` (`fk_product`), - CONSTRAINT `fk_projet_taskdet_fk_task` FOREIGN KEY (`fk_task`) REFERENCES `llx_projet_task` (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_projet_taskdet` --- - -LOCK TABLES `llx_projet_taskdet` WRITE; -/*!40000 ALTER TABLE `llx_projet_taskdet` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_projet_taskdet` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_projet_taskdet_equipement` --- - -DROP TABLE IF EXISTS `llx_projet_taskdet_equipement`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_projet_taskdet_equipement` ( - `fk_equipement` int(11) NOT NULL DEFAULT 0, - `fk_projet_taskdet` int(11) NOT NULL DEFAULT 0, - UNIQUE KEY `uk_factory_equipement` (`fk_equipement`,`fk_projet_taskdet`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_projet_taskdet_equipement` --- - -LOCK TABLES `llx_projet_taskdet_equipement` WRITE; -/*!40000 ALTER TABLE `llx_projet_taskdet_equipement` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_projet_taskdet_equipement` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_propal` -- @@ -11498,7 +10481,7 @@ CREATE TABLE `llx_propal` ( LOCK TABLES `llx_propal` WRITE; /*!40000 ALTER TABLE `llx_propal` DISABLE KEYS */; -INSERT INTO `llx_propal` VALUES (1,2,NULL,'2020-12-10 12:24:22','PR1007-0001',1,NULL,NULL,'','2012-07-09 01:33:49','2020-07-09','2020-07-24 12:00:00','2020-08-08 14:24:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,30.00000000,3.84000000,0.00000000,0.00000000,33.84000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(2,1,NULL,'2021-04-15 10:22:55','PR1007-0002',1,NULL,NULL,'','2012-07-10 02:11:44','2020-07-10','2020-07-25 12:00:00','2020-07-10 02:12:55','2020-07-20 15:23:12','2020-07-20 15:23:12',1,NULL,1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,1,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,4,NULL,'2021-04-15 10:22:55','PR1007-0003',1,NULL,NULL,'','2012-07-18 11:35:11','2020-07-18','2020-08-02 12:00:00','2020-07-18 11:36:18','2020-07-20 15:21:15','2020-07-20 15:21:15',1,NULL,1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(5,19,NULL,'2021-04-15 10:22:31','PR1302-0005',1,NULL,NULL,'','2015-02-17 15:39:56','2021-02-17','2021-03-04 12:00:00','2020-11-15 23:27:10',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(6,19,NULL,'2021-04-15 10:22:31','PR1302-0006',1,NULL,NULL,'','2015-02-17 15:40:12','2021-02-17','2021-03-04 12:00:00',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(7,19,NULL,'2021-04-15 10:22:31','PR1302-0007',1,NULL,NULL,'','2015-02-17 15:41:15','2021-02-17','2021-03-04 12:00:00','2020-01-29 21:49:33',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,400.00000000,0.00000000,400.00000000,NULL),(8,19,NULL,'2021-04-15 10:22:31','PR1302-0008',1,NULL,NULL,'','2015-02-17 15:43:39','2021-02-17','2021-03-04 12:00:00',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(10,7,4,'2020-12-10 12:24:22','PR1909-0031',1,NULL,NULL,'','2017-11-15 23:37:08','2020-11-15','2020-11-30 12:00:00','2021-09-27 16:54:30',NULL,NULL,12,NULL,12,NULL,NULL,1,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,3,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',NULL,NULL,1.00000000,10.00000000,0.00000000,10.00000000,'propale/PR1909-0031/PR1909-0031.pdf'),(11,1,NULL,'2020-06-12 17:12:08','PR1702-0009',1,NULL,NULL,'','2017-02-16 01:44:58','2020-05-13','2020-05-28 12:00:00','2020-02-16 01:44:58',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,60.00000000,0.00000000,0.00000000,0.00000000,60.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,60.00000000,0.00000000,60.00000000,NULL),(12,7,NULL,'2020-12-10 12:24:22','PR1702-0010',1,NULL,NULL,'','2017-02-16 01:45:44','2020-06-24','2020-07-09 12:00:00','2020-02-16 01:45:44',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,832.00000000,0.00000000,0.00000000,0.00000000,832.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,832.00000000,0.00000000,832.00000000,NULL),(13,26,NULL,'2021-04-15 10:22:31','PR1702-0011',1,NULL,NULL,'','2017-02-16 01:46:15','2021-04-03','2020-04-18 12:00:00','2021-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,242.00000000,0.00000000,0.00000000,0.00000000,242.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,242.00000000,0.00000000,242.00000000,NULL),(14,3,NULL,'2020-12-10 12:24:22','PR1702-0012',1,NULL,NULL,'','2017-02-16 01:46:15','2020-06-19','2020-07-04 12:00:00','2020-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,245.00000000,0.00000000,0.00000000,0.00000000,245.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,245.00000000,0.00000000,245.00000000,NULL),(15,26,NULL,'2020-06-12 17:12:08','PR1702-0013',1,NULL,NULL,'','2017-02-16 01:46:15','2020-05-01','2020-05-16 12:00:00','2019-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,940.00000000,0.00000000,0.00000000,0.00000000,940.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,940.00000000,0.00000000,940.00000000,NULL),(16,1,NULL,'2020-06-12 17:12:08','PR1702-0014',1,NULL,NULL,'','2017-02-16 01:46:15','2020-05-13','2020-05-28 12:00:00','2020-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,125.00000000,0.00000000,0.00000000,0.00000000,125.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,125.00000000,0.00000000,125.00000000,NULL),(17,1,NULL,'2020-12-10 12:24:22','PR1702-0015',1,NULL,NULL,'','2017-02-16 01:46:15','2020-07-23','2020-08-07 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,163.00000000,0.00000000,0.00000000,0.00000000,163.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,163.00000000,0.00000000,163.00000000,NULL),(18,26,NULL,'2021-04-15 10:22:31','PR1702-0016',1,NULL,NULL,'','2017-02-16 01:46:15','2021-02-13','2021-02-28 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,900.00000000,0.00000000,0.00000000,0.00000000,900.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000,NULL),(19,12,NULL,'2021-04-15 10:22:31','PR1702-0017',1,NULL,NULL,'','2017-02-16 01:46:15','2021-03-30','2021-04-14 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000,NULL),(20,26,NULL,'2020-12-10 12:24:22','PR1702-0018',1,NULL,NULL,'','2017-02-16 01:46:15','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,830.00000000,0.00000000,0.00000000,0.00000000,830.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,830.00000000,0.00000000,830.00000000,NULL),(21,1,NULL,'2020-12-10 12:24:22','PR1702-0019',1,NULL,NULL,'','2017-02-16 01:46:15','2020-09-23','2020-10-08 12:00:00','2020-02-16 04:47:09',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,89.00000000,0.00000000,0.00000000,0.00000000,89.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,89.00000000,0.00000000,89.00000000,NULL),(22,26,NULL,'2020-12-10 12:24:22','PR1702-0020',1,NULL,NULL,'','2017-02-16 01:46:15','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,0,0,NULL,NULL,0,70.00000000,0.00000000,0.00000000,0.00000000,70.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,70.00000000,0.00000000,70.00000000,'propale/PR1702-0020/PR1702-0020.pdf'),(23,12,NULL,'2021-04-15 10:22:31','PR1702-0021',1,NULL,NULL,'','2017-02-16 01:46:17','2021-04-03','2020-04-18 12:00:00','2020-02-17 16:07:18',NULL,NULL,2,NULL,12,NULL,NULL,1,0,NULL,NULL,0,715.00000000,0.00000000,0.00000000,0.00000000,715.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,715.00000000,0.00000000,715.00000000,NULL),(24,7,NULL,'2020-12-10 12:24:22','PR1702-0022',1,NULL,NULL,'','2017-02-16 01:46:17','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:17',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,250.00000000,0.00000000,250.00000000,NULL),(25,3,NULL,'2021-04-15 10:22:55','PR1702-0023',1,NULL,NULL,'','2017-02-16 01:46:17','2020-07-09','2020-07-24 12:00:00','2020-02-16 01:46:17','2020-02-16 04:47:29','2020-02-16 04:47:29',1,NULL,1,12,12,4,0,NULL,NULL,0,1018.00000000,0.00000000,0.00000000,0.00000000,1018.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000,NULL),(26,1,NULL,'2021-04-15 10:22:31','PR1702-0024',1,NULL,NULL,'','2017-02-16 01:46:17','2021-04-03','2020-04-18 12:00:00','2020-02-16 01:46:18',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,710.00000000,0.00000000,0.00000000,0.00000000,710.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,710.00000000,0.00000000,710.00000000,NULL),(27,6,NULL,'2020-12-10 12:24:22','PR1702-0025',1,NULL,NULL,'','2017-02-16 01:46:18','2020-11-12','2020-11-27 12:00:00','2020-02-16 01:46:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,300.00000000,0.00000000,300.00000000,NULL),(28,19,NULL,'2021-04-15 10:22:55','PR1702-0026',1,NULL,NULL,'','2017-02-16 01:46:18','2020-07-30','2020-08-14 12:00:00','2020-02-16 01:46:18','2020-02-16 04:46:31','2020-02-16 04:46:31',2,NULL,2,12,12,2,0,NULL,NULL,0,440.00000000,0.00000000,0.00000000,0.00000000,440.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000,NULL),(29,1,NULL,'2021-04-15 10:22:55','PR1702-0027',1,NULL,NULL,'','2017-02-16 01:46:18','2020-07-23','2020-08-07 12:00:00','2020-02-16 01:46:18','2021-12-20 20:50:23','2021-12-20 20:50:23',2,NULL,2,12,12,2,0,NULL,NULL,0,1000.00000000,0.00000000,0.00000000,0.00000000,1000.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,'propale/PR1702-0027/PR1702-0027.pdf'),(30,1,NULL,'2021-04-15 10:22:55','PR1702-0028',1,NULL,NULL,'','2017-02-16 01:46:18','2020-05-01','2020-05-16 12:00:00','2019-02-16 01:46:18','2019-02-16 04:46:42','2019-02-16 04:46:42',2,NULL,2,12,12,3,0,NULL,NULL,0,1200.00000000,0.00000000,0.00000000,0.00000000,1200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,0.00000000,1200.00000000,NULL),(31,11,NULL,'2020-12-10 12:24:22','PR1702-0029',1,NULL,NULL,'','2017-02-16 01:46:18','2020-06-24','2020-07-09 12:00:00','2020-02-16 01:46:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,720.00000000,0.00000000,0.00000000,0.00000000,720.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,720.00000000,0.00000000,720.00000000,NULL),(32,19,NULL,'2020-12-10 12:24:22','PR1702-0030',1,NULL,NULL,'','2017-02-16 01:46:18','2020-11-12','2020-11-27 12:00:00','2020-02-16 01:46:18',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,608.00000000,0.00000000,0.00000000,0.00000000,608.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,608.00000000,0.00000000,608.00000000,NULL),(33,10,6,'2020-12-10 12:24:22','PR1909-0032',1,NULL,NULL,'','2019-09-27 17:07:40','2020-09-27','2020-10-12 12:00:00','2020-09-27 17:08:59',NULL,NULL,12,12,12,NULL,NULL,1,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,'This is a private note','This is a public note','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'propale/PR1909-0032/PR1909-0032.pdf'),(34,10,6,'2021-04-15 10:22:55','PR1909-0033',1,NULL,NULL,'','2019-09-27 17:11:21','2020-09-27','2020-10-12 12:00:00','2020-09-27 17:13:13','2020-01-07 23:43:06','2020-01-07 23:43:06',12,12,12,12,12,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,NULL,NULL,NULL,'a & a
\r\nb < r','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,'propale/PR1909-0033/PR1909-0033.pdf'),(35,10,NULL,'2020-12-10 12:24:22','(PROV35)',1,NULL,NULL,'','2019-09-27 17:53:44','2020-09-27','2020-10-12 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,5.00000000,0.00000000,5.00000000,'propale/(PROV35)/(PROV35).pdf'),(36,1,NULL,'2021-04-15 10:22:55','PR2001-0034',1,NULL,NULL,'','2020-01-01 23:55:35','2021-01-01','2021-01-16 12:00:00','2021-01-19 14:24:22','2021-01-19 14:24:27','2021-01-19 14:24:27',12,NULL,12,12,12,2,0,NULL,NULL,0,4.00000000,0.24000000,0.00000000,0.00000000,4.24000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,4.00000000,0.24000000,4.24000000,'propale/PR2001-0034/PR2001-0034.pdf'),(37,10,NULL,'2021-04-15 10:22:31','(PROV37)',1,NULL,NULL,'','2020-01-06 00:44:16','2021-01-05','2021-01-20 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,'propale/(PROV37)/(PROV37).pdf'),(38,30,NULL,'2021-04-15 10:22:31','(PROV38)',1,NULL,NULL,'','2020-01-13 17:25:28','2021-01-13','2021-01-28 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'propale/(PROV38)/(PROV38).pdf'); +INSERT INTO `llx_propal` VALUES (1,2,NULL,'2021-07-11 17:49:28','PR1007-0001',1,NULL,NULL,'','2012-07-09 01:33:49','2021-07-09','2020-07-24 12:00:00','2020-08-08 14:24:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,30.00000000,3.84000000,0.00000000,0.00000000,33.84000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(2,1,NULL,'2021-07-11 17:49:28','PR1007-0002',1,NULL,NULL,'','2012-07-10 02:11:44','2021-07-10','2020-07-25 12:00:00','2021-07-10 02:12:55','2020-07-20 15:23:12','2020-07-20 15:23:12',1,NULL,1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,1,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(3,4,NULL,'2021-04-15 10:22:55','PR1007-0003',1,NULL,NULL,'','2012-07-18 11:35:11','2020-07-18','2020-08-02 12:00:00','2020-07-18 11:36:18','2020-07-20 15:21:15','2020-07-20 15:21:15',1,NULL,1,1,1,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(5,19,NULL,'2021-04-15 10:22:31','PR1302-0005',1,NULL,NULL,'','2015-02-17 15:39:56','2021-02-17','2021-03-04 12:00:00','2020-11-15 23:27:10',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,10.00000000,2.00000000,0.00000000,0.00000000,12.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(6,19,NULL,'2021-04-15 10:22:31','PR1302-0006',1,NULL,NULL,'','2015-02-17 15:40:12','2021-02-17','2021-03-04 12:00:00',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(7,19,NULL,'2021-04-15 10:22:31','PR1302-0007',1,NULL,NULL,'','2015-02-17 15:41:15','2021-02-17','2021-03-04 12:00:00','2020-01-29 21:49:33',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,400.00000000,0.00000000,0.00000000,0.00000000,400.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,400.00000000,0.00000000,400.00000000,NULL),(8,19,NULL,'2021-04-15 10:22:31','PR1302-0008',1,NULL,NULL,'','2015-02-17 15:43:39','2021-02-17','2021-03-04 12:00:00',NULL,NULL,NULL,1,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,1,0,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,1.00000000,0.00000000,0.00000000,0.00000000,NULL),(10,7,4,'2020-12-10 12:24:22','PR1909-0031',1,NULL,NULL,'','2017-11-15 23:37:08','2020-11-15','2020-11-30 12:00:00','2021-09-27 16:54:30',NULL,NULL,12,NULL,12,NULL,NULL,1,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,1,3,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',NULL,NULL,1.00000000,10.00000000,0.00000000,10.00000000,'propale/PR1909-0031/PR1909-0031.pdf'),(11,1,NULL,'2021-07-11 17:49:28','PR1702-0009',1,NULL,NULL,'','2017-02-16 01:44:58','2021-05-13','2021-05-28 12:00:00','2021-02-16 01:44:58',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,60.00000000,0.00000000,0.00000000,0.00000000,60.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,60.00000000,0.00000000,60.00000000,NULL),(12,7,NULL,'2021-07-11 17:49:28','PR1702-0010',1,NULL,NULL,'','2017-02-16 01:45:44','2021-06-24','2021-07-09 12:00:00','2021-02-16 01:45:44',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,832.00000000,0.00000000,0.00000000,0.00000000,832.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,832.00000000,0.00000000,832.00000000,NULL),(13,26,NULL,'2021-04-15 10:22:31','PR1702-0011',1,NULL,NULL,'','2017-02-16 01:46:15','2021-04-03','2020-04-18 12:00:00','2021-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,242.00000000,0.00000000,0.00000000,0.00000000,242.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,242.00000000,0.00000000,242.00000000,NULL),(14,3,NULL,'2021-07-11 17:49:28','PR1702-0012',1,NULL,NULL,'','2017-02-16 01:46:15','2021-06-19','2021-07-04 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,245.00000000,0.00000000,0.00000000,0.00000000,245.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,245.00000000,0.00000000,245.00000000,NULL),(15,26,NULL,'2021-07-11 17:49:28','PR1702-0013',1,NULL,NULL,'','2017-02-16 01:46:15','2021-05-01','2021-05-16 12:00:00','2020-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,940.00000000,0.00000000,0.00000000,0.00000000,940.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,940.00000000,0.00000000,940.00000000,NULL),(16,1,NULL,'2021-07-11 17:49:28','PR1702-0014',1,NULL,NULL,'','2017-02-16 01:46:15','2021-05-13','2021-05-28 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,125.00000000,0.00000000,0.00000000,0.00000000,125.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,125.00000000,0.00000000,125.00000000,NULL),(17,1,NULL,'2020-12-10 12:24:22','PR1702-0015',1,NULL,NULL,'','2017-02-16 01:46:15','2020-07-23','2020-08-07 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,163.00000000,0.00000000,0.00000000,0.00000000,163.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,163.00000000,0.00000000,163.00000000,NULL),(18,26,NULL,'2021-04-15 10:22:31','PR1702-0016',1,NULL,NULL,'','2017-02-16 01:46:15','2021-02-13','2021-02-28 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,900.00000000,0.00000000,0.00000000,0.00000000,900.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,900.00000000,0.00000000,900.00000000,NULL),(19,12,NULL,'2021-04-15 10:22:31','PR1702-0017',1,NULL,NULL,'','2017-02-16 01:46:15','2021-03-30','2021-04-14 12:00:00','2021-02-16 01:46:15',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,200.00000000,0.00000000,0.00000000,0.00000000,200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,200.00000000,0.00000000,200.00000000,NULL),(20,26,NULL,'2020-12-10 12:24:22','PR1702-0018',1,NULL,NULL,'','2017-02-16 01:46:15','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,830.00000000,0.00000000,0.00000000,0.00000000,830.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,830.00000000,0.00000000,830.00000000,NULL),(21,1,NULL,'2020-12-10 12:24:22','PR1702-0019',1,NULL,NULL,'','2017-02-16 01:46:15','2020-09-23','2020-10-08 12:00:00','2020-02-16 04:47:09',NULL,NULL,1,NULL,12,NULL,NULL,1,0,NULL,NULL,0,89.00000000,0.00000000,0.00000000,0.00000000,89.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,89.00000000,0.00000000,89.00000000,NULL),(22,26,NULL,'2020-12-10 12:24:22','PR1702-0020',1,NULL,NULL,'','2017-02-16 01:46:15','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:15',NULL,NULL,1,NULL,1,NULL,NULL,0,0,NULL,NULL,0,70.00000000,0.00000000,0.00000000,0.00000000,70.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,70.00000000,0.00000000,70.00000000,'propale/PR1702-0020/PR1702-0020.pdf'),(23,12,NULL,'2021-04-15 10:22:31','PR1702-0021',1,NULL,NULL,'','2017-02-16 01:46:17','2021-04-03','2020-04-18 12:00:00','2020-02-17 16:07:18',NULL,NULL,2,NULL,12,NULL,NULL,1,0,NULL,NULL,0,715.00000000,0.00000000,0.00000000,0.00000000,715.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,715.00000000,0.00000000,715.00000000,NULL),(24,7,NULL,'2020-12-10 12:24:22','PR1702-0022',1,NULL,NULL,'','2017-02-16 01:46:17','2020-11-13','2020-11-28 12:00:00','2020-02-16 01:46:17',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,250.00000000,0.00000000,0.00000000,0.00000000,250.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,250.00000000,0.00000000,250.00000000,NULL),(25,3,NULL,'2021-07-11 17:49:28','PR1702-0023',1,NULL,NULL,'','2017-02-16 01:46:17','2021-07-09','2020-07-24 12:00:00','2021-02-16 01:46:17','2020-02-16 04:47:29','2021-02-16 04:47:29',1,NULL,1,12,12,4,0,NULL,NULL,0,1018.00000000,0.00000000,0.00000000,0.00000000,1018.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1018.00000000,0.00000000,1018.00000000,NULL),(26,1,NULL,'2021-04-15 10:22:31','PR1702-0024',1,NULL,NULL,'','2017-02-16 01:46:17','2021-04-03','2020-04-18 12:00:00','2020-02-16 01:46:18',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,710.00000000,0.00000000,0.00000000,0.00000000,710.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,710.00000000,0.00000000,710.00000000,NULL),(27,6,NULL,'2020-12-10 12:24:22','PR1702-0025',1,NULL,NULL,'','2017-02-16 01:46:18','2020-11-12','2020-11-27 12:00:00','2020-02-16 01:46:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,300.00000000,0.00000000,0.00000000,0.00000000,300.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,300.00000000,0.00000000,300.00000000,NULL),(28,19,NULL,'2021-04-15 10:22:55','PR1702-0026',1,NULL,NULL,'','2017-02-16 01:46:18','2020-07-30','2020-08-14 12:00:00','2020-02-16 01:46:18','2020-02-16 04:46:31','2020-02-16 04:46:31',2,NULL,2,12,12,2,0,NULL,NULL,0,440.00000000,0.00000000,0.00000000,0.00000000,440.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,440.00000000,0.00000000,440.00000000,NULL),(29,1,NULL,'2021-04-15 10:22:55','PR1702-0027',1,NULL,NULL,'','2017-02-16 01:46:18','2020-07-23','2020-08-07 12:00:00','2020-02-16 01:46:18','2021-12-20 20:50:23','2021-12-20 20:50:23',2,NULL,2,12,12,2,0,NULL,NULL,0,1000.00000000,0.00000000,0.00000000,0.00000000,1000.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1000.00000000,0.00000000,1000.00000000,'propale/PR1702-0027/PR1702-0027.pdf'),(30,1,NULL,'2021-07-11 17:49:28','PR1702-0028',1,NULL,NULL,'','2017-02-16 01:46:18','2021-05-01','2021-05-16 12:00:00','2020-02-16 01:46:18','2019-02-16 04:46:42','2020-02-16 04:46:42',2,NULL,2,12,12,3,0,NULL,NULL,0,1200.00000000,0.00000000,0.00000000,0.00000000,1200.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,1200.00000000,0.00000000,1200.00000000,NULL),(31,11,NULL,'2021-07-11 17:49:28','PR1702-0029',1,NULL,NULL,'','2017-02-16 01:46:18','2021-06-24','2021-07-09 12:00:00','2021-02-16 01:46:18',NULL,NULL,1,NULL,1,NULL,NULL,1,0,NULL,NULL,0,720.00000000,0.00000000,0.00000000,0.00000000,720.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,720.00000000,0.00000000,720.00000000,NULL),(32,19,NULL,'2020-12-10 12:24:22','PR1702-0030',1,NULL,NULL,'','2017-02-16 01:46:18','2020-11-12','2020-11-27 12:00:00','2020-02-16 01:46:18',NULL,NULL,2,NULL,2,NULL,NULL,1,0,NULL,NULL,0,608.00000000,0.00000000,0.00000000,0.00000000,608.00000000,NULL,NULL,3,3,'','','',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',0,'EUR',1.00000000,608.00000000,0.00000000,608.00000000,NULL),(33,10,6,'2020-12-10 12:24:22','PR1909-0032',1,NULL,NULL,'','2019-09-27 17:07:40','2020-09-27','2020-10-12 12:00:00','2020-09-27 17:08:59',NULL,NULL,12,12,12,NULL,NULL,1,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,'This is a private note','This is a public note','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'propale/PR1909-0032/PR1909-0032.pdf'),(34,10,6,'2021-04-15 10:22:55','PR1909-0033',1,NULL,NULL,'','2019-09-27 17:11:21','2020-09-27','2020-10-12 12:00:00','2020-09-27 17:13:13','2020-01-07 23:43:06','2020-01-07 23:43:06',12,12,12,12,12,2,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,NULL,NULL,NULL,'a & a
\r\nb < r','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,'propale/PR1909-0033/PR1909-0033.pdf'),(35,10,NULL,'2020-12-10 12:24:22','(PROV35)',1,NULL,NULL,'','2019-09-27 17:53:44','2020-09-27','2020-10-12 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,5.00000000,0.00000000,0.00000000,0.00000000,5.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,5.00000000,0.00000000,5.00000000,'propale/(PROV35)/(PROV35).pdf'),(36,1,NULL,'2021-04-15 10:22:55','PR2001-0034',1,NULL,NULL,'','2020-01-01 23:55:35','2021-01-01','2021-01-16 12:00:00','2021-01-19 14:24:22','2021-01-19 14:24:27','2021-01-19 14:24:27',12,NULL,12,12,12,2,0,NULL,NULL,0,4.00000000,0.24000000,0.00000000,0.00000000,4.24000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,4.00000000,0.24000000,4.24000000,'propale/PR2001-0034/PR2001-0034.pdf'),(37,10,NULL,'2021-04-15 10:22:31','(PROV37)',1,NULL,NULL,'','2020-01-06 00:44:16','2021-01-05','2021-01-20 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,10.00000000,0.00000000,0.00000000,0.00000000,10.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,10.00000000,0.00000000,10.00000000,'propale/(PROV37)/(PROV37).pdf'),(38,30,NULL,'2021-04-15 10:22:31','(PROV38)',1,NULL,NULL,'','2020-01-13 17:25:28','2021-01-13','2021-01-28 12:00:00',NULL,NULL,NULL,12,NULL,NULL,NULL,NULL,0,0,NULL,NULL,0,0.00000000,0.00000000,0.00000000,0.00000000,0.00000000,NULL,NULL,NULL,NULL,'','','azur',NULL,NULL,NULL,0,NULL,0,NULL,NULL,0,'',1,'EUR',1.00000000,0.00000000,0.00000000,0.00000000,'propale/(PROV38)/(PROV38).pdf'); /*!40000 ALTER TABLE `llx_propal` ENABLE KEYS */; UNLOCK TABLES; @@ -11767,7 +10750,7 @@ CREATE TABLE `llx_recruitment_recruitmentcandidature` ( `remuneration_requested` int(11) DEFAULT NULL, `remuneration_proposed` int(11) DEFAULT NULL, `fk_recruitment_origin` int(11) DEFAULT NULL, - `email_msgid` varchar(175) CHARACTER SET utf8mb4 DEFAULT NULL, + `email_msgid` varchar(175) COLLATE utf8_unicode_ci DEFAULT NULL, `entity` int(11) NOT NULL DEFAULT 1, `date_birth` date DEFAULT NULL, PRIMARY KEY (`rowid`), @@ -12006,7 +10989,7 @@ CREATE TABLE `llx_rights_def` ( LOCK TABLES `llx_rights_def` WRITE; /*!40000 ALTER TABLE `llx_rights_def` DISABLE KEYS */; -INSERT INTO `llx_rights_def` VALUES (11,'Read invoices','facture',1,'lire',NULL,'a',0,11,0),(11,'Lire les factures','facture',2,'lire',NULL,'a',1,10,0),(12,'Create and update invoices','facture',1,'creer',NULL,'a',0,11,0),(12,'Creer/modifier les factures','facture',2,'creer',NULL,'a',0,10,0),(13,'Devalidate invoices','facture',1,'invoice_advance','unvalidate','a',0,11,0),(13,'Dévalider les factures','facture',2,'invoice_advance','unvalidate','a',0,10,0),(14,'Validate invoices','facture',1,'invoice_advance','validate','a',0,11,0),(14,'Valider les factures','facture',2,'valider',NULL,'a',0,10,0),(15,'Send invoices by email','facture',1,'invoice_advance','send','a',0,11,0),(15,'Envoyer les factures par mail','facture',2,'invoice_advance','send','a',0,10,0),(16,'Issue payments on invoices','facture',1,'paiement',NULL,'a',0,11,0),(16,'Emettre des paiements sur les factures','facture',2,'paiement',NULL,'a',0,10,0),(19,'Delete invoices','facture',1,'supprimer',NULL,'a',0,11,0),(19,'Supprimer les factures','facture',2,'supprimer',NULL,'a',0,10,0),(21,'Lire les propositions commerciales','propale',1,'lire',NULL,'r',1,22,0),(21,'Lire les propositions commerciales','propale',2,'lire',NULL,'r',1,22,0),(22,'Creer/modifier les propositions commerciales','propale',1,'creer',NULL,'w',0,22,0),(22,'Creer/modifier les propositions commerciales','propale',2,'creer',NULL,'w',0,22,0),(24,'Valider les propositions commerciales','propale',1,'propal_advance','validate','d',0,22,0),(24,'Valider les propositions commerciales','propale',2,'valider',NULL,'d',0,22,0),(25,'Envoyer les propositions commerciales aux clients','propale',1,'propal_advance','send','d',0,22,0),(25,'Envoyer les propositions commerciales aux clients','propale',2,'propal_advance','send','d',0,22,0),(26,'Cloturer les propositions commerciales','propale',1,'propal_advance','close','d',0,22,0),(26,'Cloturer les propositions commerciales','propale',2,'propal_advance','close','d',0,22,0),(27,'Supprimer les propositions commerciales','propale',1,'supprimer',NULL,'d',0,22,0),(27,'Supprimer les propositions commerciales','propale',2,'supprimer',NULL,'d',0,22,0),(28,'Exporter les propositions commerciales et attributs','propale',1,'export',NULL,'r',0,22,0),(28,'Exporter les propositions commerciales et attributs','propale',2,'export',NULL,'r',0,22,0),(31,'Lire les produits','produit',1,'lire',NULL,'r',1,25,0),(31,'Lire les produits','produit',2,'lire',NULL,'r',1,25,0),(32,'Creer/modifier les produits','produit',1,'creer',NULL,'w',0,25,0),(32,'Creer/modifier les produits','produit',2,'creer',NULL,'w',0,25,0),(34,'Supprimer les produits','produit',1,'supprimer',NULL,'d',0,25,0),(34,'Supprimer les produits','produit',2,'supprimer',NULL,'d',0,25,0),(38,'Exporter les produits','produit',1,'export',NULL,'r',0,25,0),(38,'Exporter les produits','produit',2,'export',NULL,'r',0,25,0),(39,'Ignore minimum price','produit',1,'ignore_price_min_advance',NULL,'r',0,25,0),(41,'Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)','projet',1,'lire',NULL,'r',1,14,0),(42,'Create/modify projects and tasks (shared projects or projects I am contact for)','projet',1,'creer',NULL,'w',0,14,0),(44,'Delete project and tasks (shared projects or projects I am contact for)','projet',1,'supprimer',NULL,'d',0,14,0),(45,'Export projects','projet',1,'export',NULL,'d',0,14,0),(61,'Lire les fiches d\'intervention','ficheinter',1,'lire',NULL,'r',1,41,0),(62,'Creer/modifier les fiches d\'intervention','ficheinter',1,'creer',NULL,'w',0,41,0),(64,'Supprimer les fiches d\'intervention','ficheinter',1,'supprimer',NULL,'d',0,41,0),(67,'Exporter les fiches interventions','ficheinter',1,'export',NULL,'r',0,41,0),(68,'Envoyer les fiches d\'intervention par courriel','ficheinter',1,'ficheinter_advance','send','r',0,41,0),(69,'Valider les fiches d\'intervention ','ficheinter',1,'ficheinter_advance','validate','a',0,41,0),(70,'Dévalider les fiches d\'intervention','ficheinter',1,'ficheinter_advance','unvalidate','a',0,41,0),(71,'Read members\' card','adherent',1,'lire',NULL,'r',0,55,0),(72,'Create/modify members (need also user module permissions if member linked to a user)','adherent',1,'creer',NULL,'w',0,55,0),(74,'Remove members','adherent',1,'supprimer',NULL,'d',0,55,0),(75,'Setup types of membership','adherent',1,'configurer',NULL,'w',0,55,0),(76,'Export members','adherent',1,'export',NULL,'r',0,55,0),(78,'Read subscriptions','adherent',1,'cotisation','lire','r',0,55,0),(79,'Create/modify/remove subscriptions','adherent',1,'cotisation','creer','w',0,55,0),(81,'Read sales orders','commande',1,'lire',NULL,'r',0,11,0),(82,'Creeat/modify sales orders','commande',1,'creer',NULL,'w',0,11,0),(84,'Validate sales orders','commande',1,'order_advance','validate','d',0,11,0),(86,'Send sale orders by email','commande',1,'order_advance','send','d',0,11,0),(87,'Close sale orders','commande',1,'order_advance','close','d',0,11,0),(88,'Cancel sale orders','commande',1,'order_advance','annuler','d',0,11,0),(89,'Delete sales orders','commande',1,'supprimer',NULL,'d',0,11,0),(91,'Lire les charges','tax',1,'charges','lire','r',0,50,0),(91,'Lire les charges','tax',2,'charges','lire','r',1,50,0),(92,'Creer/modifier les charges','tax',1,'charges','creer','w',0,50,0),(92,'Creer/modifier les charges','tax',2,'charges','creer','w',0,50,0),(93,'Supprimer les charges','tax',1,'charges','supprimer','d',0,50,0),(93,'Supprimer les charges','tax',2,'charges','supprimer','d',0,50,0),(94,'Exporter les charges','tax',1,'charges','export','r',0,50,0),(94,'Exporter les charges','tax',2,'charges','export','r',0,50,0),(101,'Lire les expeditions','expedition',1,'lire',NULL,'r',0,40,0),(102,'Creer modifier les expeditions','expedition',1,'creer',NULL,'w',0,40,0),(104,'Valider les expeditions','expedition',1,'shipping_advance','validate','d',0,40,0),(105,'Envoyer les expeditions aux clients','expedition',1,'shipping_advance','send','d',0,40,0),(106,'Exporter les expeditions','expedition',1,'shipment','export','r',0,40,0),(109,'Supprimer les expeditions','expedition',1,'supprimer',NULL,'d',0,40,0),(111,'Read bank account and transactions','banque',1,'lire',NULL,'r',0,51,0),(111,'Lire les comptes bancaires','banque',2,'lire',NULL,'r',1,51,0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',1,'modifier',NULL,'w',0,51,0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',2,'modifier',NULL,'w',0,51,0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',1,'configurer',NULL,'a',0,51,0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',2,'configurer',NULL,'a',0,51,0),(114,'Rapprocher les ecritures bancaires','banque',1,'consolidate',NULL,'w',0,51,0),(114,'Rapprocher les ecritures bancaires','banque',2,'consolidate',NULL,'w',0,51,0),(115,'Exporter transactions et releves','banque',1,'export',NULL,'r',0,51,0),(115,'Exporter transactions et releves','banque',2,'export',NULL,'r',0,51,0),(116,'Virements entre comptes','banque',1,'transfer',NULL,'w',0,51,0),(116,'Virements entre comptes','banque',2,'transfer',NULL,'w',0,51,0),(117,'Gerer les envois de cheques','banque',1,'cheque',NULL,'w',0,51,0),(117,'Gerer les envois de cheques','banque',2,'cheque',NULL,'w',0,51,0),(121,'Read third parties','societe',1,'lire',NULL,'r',0,9,0),(121,'Lire les societes','societe',2,'lire',NULL,'r',1,9,0),(122,'Create and update third parties','societe',1,'creer',NULL,'w',0,9,0),(122,'Creer modifier les societes','societe',2,'creer',NULL,'w',0,9,0),(125,'Delete third parties','societe',1,'supprimer',NULL,'d',0,9,0),(125,'Supprimer les societes','societe',2,'supprimer',NULL,'d',0,9,0),(126,'Export third parties','societe',1,'export',NULL,'r',0,9,0),(126,'Exporter les societes','societe',2,'export',NULL,'r',0,9,0),(141,'Read all projects and tasks (also private projects I am not contact for)','projet',1,'all','lire','r',0,14,0),(142,'Create/modify all projects and tasks (also private projects I am not contact for)','projet',1,'all','creer','w',0,14,0),(144,'Delete all projects and tasks (also private projects I am not contact for)','projet',1,'all','supprimer','d',0,14,0),(151,'Read withdrawals','prelevement',1,'bons','lire','r',1,52,0),(152,'Create/modify a withdrawals','prelevement',1,'bons','creer','w',0,52,0),(153,'Send withdrawals to bank','prelevement',1,'bons','send','a',0,52,0),(154,'credit/refuse withdrawals','prelevement',1,'bons','credit','a',0,52,0),(161,'Lire les contrats','contrat',1,'lire',NULL,'r',1,35,0),(162,'Creer / modifier les contrats','contrat',1,'creer',NULL,'w',0,35,0),(163,'Activer un service d\'un contrat','contrat',1,'activer',NULL,'w',0,35,0),(164,'Desactiver un service d\'un contrat','contrat',1,'desactiver',NULL,'w',0,35,0),(165,'Supprimer un contrat','contrat',1,'supprimer',NULL,'d',0,35,0),(167,'Export contracts','contrat',1,'export',NULL,'r',0,35,0),(221,'Consulter les mailings','mailing',1,'lire',NULL,'r',1,11,0),(221,'Consulter les mailings','mailing',2,'lire',NULL,'r',1,11,0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',1,'creer',NULL,'w',0,11,0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',2,'creer',NULL,'w',0,11,0),(223,'Valider les mailings (permet leur envoi)','mailing',1,'valider',NULL,'w',0,11,0),(223,'Valider les mailings (permet leur envoi)','mailing',2,'valider',NULL,'w',0,11,0),(229,'Supprimer les mailings','mailing',1,'supprimer',NULL,'d',0,11,0),(229,'Supprimer les mailings','mailing',2,'supprimer',NULL,'d',0,11,0),(237,'View recipients and info','mailing',1,'mailing_advance','recipient','r',0,11,0),(237,'View recipients and info','mailing',2,'mailing_advance','recipient','r',0,11,0),(238,'Manually send mailings','mailing',1,'mailing_advance','send','w',0,11,0),(238,'Manually send mailings','mailing',2,'mailing_advance','send','w',0,11,0),(239,'Delete mailings after validation and/or sent','mailing',1,'mailing_advance','delete','d',0,11,0),(239,'Delete mailings after validation and/or sent','mailing',2,'mailing_advance','delete','d',0,11,0),(241,'Lire les categories','categorie',1,'lire',NULL,'r',1,20,0),(242,'Creer/modifier les categories','categorie',1,'creer',NULL,'w',0,20,0),(243,'Supprimer les categories','categorie',1,'supprimer',NULL,'d',0,20,0),(251,'Consulter les autres utilisateurs','user',1,'user','lire','r',0,5,0),(252,'Consulter les permissions des autres utilisateurs','user',1,'user_advance','readperms','r',0,5,0),(253,'Creer/modifier utilisateurs internes et externes','user',1,'user','creer','w',0,5,0),(254,'Creer/modifier utilisateurs externes seulement','user',1,'user_advance','write','w',0,5,0),(255,'Modifier le mot de passe des autres utilisateurs','user',1,'user','password','w',0,5,0),(256,'Supprimer ou desactiver les autres utilisateurs','user',1,'user','supprimer','d',0,5,0),(262,'Read all third parties (and their objects) by internal users (otherwise only if commercial contact). Not effective for external users (limited to themselves).','societe',1,'client','voir','r',0,9,0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',2,'client','voir','r',1,9,0),(281,'Read contacts','societe',1,'contact','lire','r',0,9,0),(281,'Lire les contacts','societe',2,'contact','lire','r',1,9,0),(282,'Create and update contact','societe',1,'contact','creer','w',0,9,0),(282,'Creer modifier les contacts','societe',2,'contact','creer','w',0,9,0),(283,'Delete contacts','societe',1,'contact','supprimer','d',0,9,0),(283,'Supprimer les contacts','societe',2,'contact','supprimer','d',0,9,0),(286,'Export contacts','societe',1,'contact','export','d',0,9,0),(286,'Exporter les contacts','societe',2,'contact','export','d',0,9,0),(301,'Read barcodes','barcode',1,'lire_advance',NULL,'r',1,0,0),(302,'Create/modify barcodes','barcode',1,'creer_advance',NULL,'w',0,0,0),(331,'Lire les bookmarks','bookmark',1,'lire',NULL,'r',0,50,0),(332,'Creer/modifier les bookmarks','bookmark',1,'creer',NULL,'r',0,50,0),(333,'Supprimer les bookmarks','bookmark',1,'supprimer',NULL,'r',0,50,0),(341,'Consulter ses propres permissions','user',1,'self_advance','readperms','r',0,5,0),(342,'Creer/modifier ses propres infos utilisateur','user',1,'self','creer','w',0,5,0),(343,'Modifier son propre mot de passe','user',1,'self','password','w',0,5,0),(344,'Modifier ses propres permissions','user',1,'self_advance','writeperms','w',0,5,0),(351,'Consulter les groupes','user',1,'group_advance','read','r',0,5,0),(352,'Consulter les permissions des groupes','user',1,'group_advance','readperms','r',0,5,0),(353,'Creer/modifier les groupes et leurs permissions','user',1,'group_advance','write','w',0,5,0),(354,'Supprimer ou desactiver les groupes','user',1,'group_advance','delete','d',0,5,0),(358,'Exporter les utilisateurs','user',1,'user','export','r',0,5,0),(511,'Read payments of employee salaries (yours and your subordinates)','salaries',1,'read',NULL,'r',0,50,0),(512,'Create/modify payments of empoyee salaries','salaries',1,'write',NULL,'w',0,50,0),(514,'Delete payments of employee salary','salaries',1,'delete',NULL,'d',0,50,0),(517,'Read payments of salariests of every employee','salaries',1,'readall',NULL,'r',0,50,0),(519,'Export payments of employee salaries','salaries',1,'export',NULL,'r',0,50,0),(520,'Read loans','loan',1,'read',NULL,'r',0,50,0),(521,'Read loans','loan',1,'read',NULL,'r',0,50,0),(522,'Create/modify loans','loan',1,'write',NULL,'w',0,50,0),(524,'Delete loans','loan',1,'delete',NULL,'d',0,50,0),(525,'Access loan calculator','loan',1,'calc',NULL,'r',0,50,0),(527,'Export loans','loan',1,'export',NULL,'r',0,50,0),(531,'Read services','service',1,'lire',NULL,'r',0,29,0),(532,'Create/modify services','service',1,'creer',NULL,'w',0,29,0),(534,'Delete les services','service',1,'supprimer',NULL,'d',0,29,0),(538,'Export services','service',1,'export',NULL,'r',0,29,0),(561,'Read bank transfer payment orders','paymentbybanktransfer',1,'read',NULL,'r',0,52,0),(562,'Create/modify a bank transfer payment order','paymentbybanktransfer',1,'create',NULL,'w',0,52,0),(563,'Send/Transmit bank transfer payment order','paymentbybanktransfer',1,'send',NULL,'a',0,52,0),(564,'Record Debits/Rejects of bank transfer payment order','paymentbybanktransfer',1,'debit',NULL,'a',0,52,0),(651,'Read bom of Bom','bom',1,'read',NULL,'w',0,65,0),(652,'Create/Update bom of Bom','bom',1,'write',NULL,'w',0,65,0),(653,'Delete bom of Bom','bom',1,'delete',NULL,'w',0,65,0),(661,'Read Manufacturing Order','mrp',1,'read',NULL,'w',0,66,0),(662,'Create/Update Manufacturing Order','mrp',1,'write',NULL,'w',0,66,0),(663,'Delete Manufacturing Order','mrp',1,'delete',NULL,'w',0,66,0),(701,'Lire les dons','don',1,'lire',NULL,'r',1,50,0),(701,'Lire les dons','don',2,'lire',NULL,'r',1,50,0),(702,'Creer/modifier les dons','don',1,'creer',NULL,'w',0,50,0),(702,'Creer/modifier les dons','don',2,'creer',NULL,'w',0,50,0),(703,'Supprimer les dons','don',1,'supprimer',NULL,'d',0,50,0),(703,'Supprimer les dons','don',2,'supprimer',NULL,'d',0,50,0),(750,'Read job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','read','w',0,44,0),(751,'Create/Update job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','write','w',0,44,0),(752,'Delete Job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','delete','w',0,44,0),(771,'Read expense reports (yours and your subordinates)','expensereport',1,'lire',NULL,'r',0,42,0),(772,'Create/modify expense reports','expensereport',1,'creer',NULL,'w',0,42,0),(773,'Delete expense reports','expensereport',1,'supprimer',NULL,'d',0,42,0),(775,'Approve expense reports','expensereport',1,'approve',NULL,'w',0,42,0),(776,'Pay expense reports','expensereport',1,'to_paid',NULL,'w',0,42,0),(777,'Read expense reports of everybody','expensereport',1,'readall',NULL,'r',0,42,0),(778,'Create expense reports for everybody','expensereport',1,'writeall_advance',NULL,'w',0,42,0),(779,'Export expense reports','expensereport',1,'export',NULL,'r',0,42,0),(1001,'Lire les stocks','stock',1,'lire',NULL,'r',1,40,0),(1002,'Creer/Modifier les stocks','stock',1,'creer',NULL,'w',0,40,0),(1003,'Supprimer les stocks','stock',1,'supprimer',NULL,'d',0,40,0),(1004,'Lire mouvements de stocks','stock',1,'mouvement','lire','r',1,40,0),(1005,'Creer/modifier mouvements de stocks','stock',1,'mouvement','creer','w',0,40,0),(1101,'Read delivery receipts','expedition',1,'delivery','lire','r',0,40,0),(1102,'Create/modify delivery receipts','expedition',1,'delivery','creer','w',0,40,0),(1104,'Validate delivery receipts','expedition',1,'delivery_advance','validate','d',0,40,0),(1109,'Delete delivery receipts','expedition',1,'delivery','supprimer','d',0,40,0),(1121,'Read supplier proposals','supplier_proposal',1,'lire',NULL,'w',0,35,0),(1122,'Create/modify supplier proposals','supplier_proposal',1,'creer',NULL,'w',0,35,0),(1123,'Validate supplier proposals','supplier_proposal',1,'validate_advance',NULL,'w',0,35,0),(1124,'Envoyer les demandes fournisseurs','supplier_proposal',1,'send_advance',NULL,'w',0,35,0),(1125,'Delete supplier proposals','supplier_proposal',1,'supprimer',NULL,'w',0,35,0),(1126,'Close supplier price requests','supplier_proposal',1,'cloturer',NULL,'w',0,35,0),(1181,'Consulter les fournisseurs','fournisseur',1,'lire',NULL,'r',0,12,0),(1182,'Consulter les commandes fournisseur','fournisseur',1,'commande','lire','r',0,12,0),(1183,'Creer une commande fournisseur','fournisseur',1,'commande','creer','w',0,12,0),(1184,'Valider une commande fournisseur','fournisseur',1,'supplier_order_advance','validate','w',0,12,0),(1185,'Approuver une commande fournisseur','fournisseur',1,'commande','approuver','w',0,12,0),(1186,'Commander une commande fournisseur','fournisseur',1,'commande','commander','w',0,12,0),(1187,'Receptionner une commande fournisseur','fournisseur',1,'commande','receptionner','d',0,12,0),(1188,'Supprimer une commande fournisseur','fournisseur',1,'commande','supprimer','d',0,12,0),(1189,'Check/Uncheck a supplier order reception','fournisseur',1,'commande_advance','check','w',0,12,0),(1191,'Exporter les commande fournisseurs, attributs','fournisseur',1,'commande','export','r',0,12,0),(1201,'Lire les exports','export',1,'lire',NULL,'r',1,72,0),(1202,'Creer/modifier un export','export',1,'creer',NULL,'w',0,72,0),(1231,'Consulter les factures fournisseur','fournisseur',1,'facture','lire','r',0,12,0),(1232,'Creer une facture fournisseur','fournisseur',1,'facture','creer','w',0,12,0),(1233,'Valider une facture fournisseur','fournisseur',1,'supplier_invoice_advance','validate','w',0,12,0),(1234,'Supprimer une facture fournisseur','fournisseur',1,'facture','supprimer','d',0,12,0),(1235,'Envoyer les factures par mail','fournisseur',1,'supplier_invoice_advance','send','a',0,12,0),(1236,'Exporter les factures fournisseurs, attributs et reglements','fournisseur',1,'facture','export','r',0,12,0),(1251,'Run mass imports of external data (data load)','import',1,'run',NULL,'r',0,70,0),(1321,'Export customer invoices, attributes and payments','facture',1,'facture','export','r',0,11,0),(1321,'Exporter les factures clients, attributs et reglements','facture',2,'facture','export','r',0,10,0),(1322,'Re-open a fully paid invoice','facture',1,'invoice_advance','reopen','r',0,11,0),(1421,'Export sales orders and attributes','commande',1,'commande','export','r',0,11,0),(2401,'Read actions/tasks linked to his account','agenda',1,'myactions','read','r',0,15,0),(2401,'Read actions/tasks linked to his account','agenda',2,'myactions','read','r',1,15,0),(2402,'Create/modify actions/tasks linked to his account','agenda',1,'myactions','create','w',0,15,0),(2402,'Create/modify actions/tasks linked to his account','agenda',2,'myactions','create','w',0,15,0),(2403,'Delete actions/tasks linked to his account','agenda',1,'myactions','delete','w',0,15,0),(2403,'Delete actions/tasks linked to his account','agenda',2,'myactions','delete','w',0,15,0),(2411,'Read actions/tasks of others','agenda',1,'allactions','read','r',0,15,0),(2411,'Read actions/tasks of others','agenda',2,'allactions','read','r',0,15,0),(2412,'Create/modify actions/tasks of others','agenda',1,'allactions','create','w',0,15,0),(2412,'Create/modify actions/tasks of others','agenda',2,'allactions','create','w',0,15,0),(2413,'Delete actions/tasks of others','agenda',1,'allactions','delete','w',0,15,0),(2413,'Delete actions/tasks of others','agenda',2,'allactions','delete','w',0,15,0),(2414,'Export actions/tasks of others','agenda',1,'export',NULL,'w',0,15,0),(2501,'Read or download documents','ecm',1,'read',NULL,'r',0,10,0),(2503,'Upload a document','ecm',1,'upload',NULL,'w',0,10,0),(2515,'Administer directories of documents','ecm',1,'setup',NULL,'w',0,10,0),(3200,'Read archived events and fingerprints','blockedlog',1,'read',NULL,'w',0,76,0),(3201,'Read archived events and fingerprints','blockedlog',1,'read',NULL,'w',0,76,0),(10001,'Read website content','website',1,'read',NULL,'w',0,50,0),(10002,'Create/modify website content (html and javascript content)','website',1,'write',NULL,'w',0,50,0),(10003,'Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers.','website',1,'writephp',NULL,'w',0,50,0),(10005,'Delete website content','website',1,'delete',NULL,'w',0,50,0),(10008,'Export website content','website',1,'export',NULL,'w',0,50,0),(20001,'Read leave requests (yours and your subordinates)','holiday',1,'read',NULL,'w',0,42,0),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',2,'write',NULL,'w',1,42,0),(20002,'Create/modify leave requests','holiday',1,'write',NULL,'w',0,42,0),(20003,'Delete leave requests','holiday',1,'delete',NULL,'w',0,42,0),(20003,'Supprimer des demandes de congés payés','holiday',2,'delete',NULL,'w',0,42,0),(20004,'Read leave requests for everybody','holiday',1,'readall',NULL,'w',0,42,0),(20004,'Définir les congés payés des utilisateurs','holiday',2,'define_holiday',NULL,'w',0,42,0),(20005,'Create/modify leave requests for everybody','holiday',1,'writeall_advance',NULL,'w',0,42,0),(20005,'Voir les logs de modification des congés payés','holiday',2,'view_log',NULL,'w',0,42,0),(20006,'Setup leave requests of users (setup and update balance)','holiday',1,'define_holiday',NULL,'w',0,42,0),(20006,'Accéder au rapport mensuel des congés payés','holiday',2,'month_report',NULL,'w',0,42,0),(20007,'Approve leave requests','holiday',1,'approve',NULL,'w',0,42,0),(23001,'Read cron jobs','cron',1,'read',NULL,'w',0,50,0),(23002,'Create cron Jobs','cron',1,'create',NULL,'w',0,50,0),(23003,'Delete cron Jobs','cron',1,'delete',NULL,'w',0,50,0),(23004,'Execute cron Jobs','cron',1,'execute',NULL,'w',0,50,0),(50151,'Use Point Of Sale','takepos',1,'run',NULL,'a',0,60,0),(50401,'Bind products and invoices with accounting accounts','accounting',1,'bind','write','r',0,61,0),(50411,'Read operations in General Ledger','accounting',1,'mouvements','lire','r',0,61,0),(50412,'Write/Edit operations in General Ledger','accounting',1,'mouvements','creer','w',0,61,0),(50414,'Delete operations in Ledger','accounting',1,'mouvements','supprimer','d',0,61,0),(50415,'Delete all operations by year and journal in Ledger','accounting',1,'mouvements','supprimer_tous','d',0,61,0),(50418,'Export operations of the Ledger','accounting',1,'mouvements','export','r',0,61,0),(50420,'Report and export reports (turnover, balance, journals, general ledger)','accounting',1,'comptarapport','lire','r',0,61,0),(50430,'Define and close a fiscal year','accounting',1,'fiscalyear','write','r',0,61,0),(50440,'Manage chart of accounts, setup of accountancy','accounting',1,'chartofaccount',NULL,'r',0,61,0),(55001,'Read surveys','opensurvey',1,'read',NULL,'r',0,40,0),(55002,'Create/modify surveys','opensurvey',1,'write',NULL,'w',0,40,0),(56001,'Read ticket','ticket',1,'read',NULL,'r',0,60,0),(56002,'Create les tickets','ticket',1,'write',NULL,'w',0,60,0),(56003,'Delete les tickets','ticket',1,'delete',NULL,'d',0,60,0),(56004,'Manage tickets','ticket',1,'manage',NULL,'w',0,60,0),(59001,'Visualiser les marges','margins',1,'liretous',NULL,'r',0,55,0),(59002,'Définir les marges','margins',1,'creer',NULL,'w',0,55,0),(59003,'Read every user margin','margins',1,'read','all','r',0,55,0),(63001,'Read resources','resource',1,'read',NULL,'w',0,16,0),(63002,'Create/Modify resources','resource',1,'write',NULL,'w',0,16,0),(63003,'Delete resources','resource',1,'delete',NULL,'w',0,16,0),(63004,'Link resources to agenda events','resource',1,'link',NULL,'w',0,16,0),(64001,'DirectPrint','printing',1,'read',NULL,'r',0,52,0),(101250,'Read surveys','opensurvey',2,'survey','read','r',0,40,0),(101251,'Create/modify surveys','opensurvey',2,'survey','write','w',0,40,0),(941601,'Lire les receptions','reception',1,'lire',NULL,'r',0,40,0),(941602,'Creer modifier les receptions','reception',1,'creer',NULL,'w',0,40,0),(941603,'Valider les receptions','reception',1,'reception_advance','validate','d',0,40,0),(941604,'Envoyer les receptions aux clients','reception',1,'reception_advance','send','d',0,40,0),(941605,'Exporter les receptions','reception',1,'reception','export','r',0,40,0),(941606,'Supprimer les receptions','reception',1,'supprimer',NULL,'d',0,40,0); +INSERT INTO `llx_rights_def` VALUES (11,'Read invoices','facture',1,'lire',NULL,'a',0,0,0),(11,'Lire les factures','facture',2,'lire',NULL,'a',1,10,0),(12,'Create and update invoices','facture',1,'creer',NULL,'a',0,0,0),(12,'Creer/modifier les factures','facture',2,'creer',NULL,'a',0,10,0),(13,'Devalidate invoices','facture',1,'invoice_advance','unvalidate','a',0,0,0),(13,'Dévalider les factures','facture',2,'invoice_advance','unvalidate','a',0,10,0),(14,'Validate invoices','facture',1,'invoice_advance','validate','a',0,0,0),(14,'Valider les factures','facture',2,'valider',NULL,'a',0,10,0),(15,'Send invoices by email','facture',1,'invoice_advance','send','a',0,0,0),(15,'Envoyer les factures par mail','facture',2,'invoice_advance','send','a',0,10,0),(16,'Issue payments on invoices','facture',1,'paiement',NULL,'a',0,0,0),(16,'Emettre des paiements sur les factures','facture',2,'paiement',NULL,'a',0,10,0),(19,'Delete invoices','facture',1,'supprimer',NULL,'a',0,0,0),(19,'Supprimer les factures','facture',2,'supprimer',NULL,'a',0,10,0),(21,'Lire les propositions commerciales','propale',1,'lire',NULL,'r',1,22,0),(21,'Lire les propositions commerciales','propale',2,'lire',NULL,'r',1,22,0),(22,'Creer/modifier les propositions commerciales','propale',1,'creer',NULL,'w',0,22,0),(22,'Creer/modifier les propositions commerciales','propale',2,'creer',NULL,'w',0,22,0),(24,'Valider les propositions commerciales','propale',1,'propal_advance','validate','d',0,22,0),(24,'Valider les propositions commerciales','propale',2,'valider',NULL,'d',0,22,0),(25,'Envoyer les propositions commerciales aux clients','propale',1,'propal_advance','send','d',0,22,0),(25,'Envoyer les propositions commerciales aux clients','propale',2,'propal_advance','send','d',0,22,0),(26,'Cloturer les propositions commerciales','propale',1,'propal_advance','close','d',0,22,0),(26,'Cloturer les propositions commerciales','propale',2,'propal_advance','close','d',0,22,0),(27,'Supprimer les propositions commerciales','propale',1,'supprimer',NULL,'d',0,22,0),(27,'Supprimer les propositions commerciales','propale',2,'supprimer',NULL,'d',0,22,0),(28,'Exporter les propositions commerciales et attributs','propale',1,'export',NULL,'r',0,22,0),(28,'Exporter les propositions commerciales et attributs','propale',2,'export',NULL,'r',0,22,0),(31,'Lire les produits','produit',1,'lire',NULL,'r',1,25,0),(31,'Lire les produits','produit',2,'lire',NULL,'r',1,25,0),(32,'Creer/modifier les produits','produit',1,'creer',NULL,'w',0,25,0),(32,'Creer/modifier les produits','produit',2,'creer',NULL,'w',0,25,0),(34,'Supprimer les produits','produit',1,'supprimer',NULL,'d',0,25,0),(34,'Supprimer les produits','produit',2,'supprimer',NULL,'d',0,25,0),(38,'Exporter les produits','produit',1,'export',NULL,'r',0,25,0),(38,'Exporter les produits','produit',2,'export',NULL,'r',0,25,0),(39,'Ignore minimum price','produit',1,'ignore_price_min_advance',NULL,'r',0,25,0),(41,'Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)','projet',1,'lire',NULL,'r',1,14,0),(42,'Create/modify projects and tasks (shared projects or projects I am contact for)','projet',1,'creer',NULL,'w',0,14,0),(44,'Delete project and tasks (shared projects or projects I am contact for)','projet',1,'supprimer',NULL,'d',0,14,0),(45,'Export projects','projet',1,'export',NULL,'d',0,14,0),(61,'Lire les fiches d\'intervention','ficheinter',1,'lire',NULL,'r',1,41,0),(62,'Creer/modifier les fiches d\'intervention','ficheinter',1,'creer',NULL,'w',0,41,0),(64,'Supprimer les fiches d\'intervention','ficheinter',1,'supprimer',NULL,'d',0,41,0),(67,'Exporter les fiches interventions','ficheinter',1,'export',NULL,'r',0,41,0),(68,'Envoyer les fiches d\'intervention par courriel','ficheinter',1,'ficheinter_advance','send','r',0,41,0),(69,'Valider les fiches d\'intervention ','ficheinter',1,'ficheinter_advance','validate','a',0,41,0),(70,'Dévalider les fiches d\'intervention','ficheinter',1,'ficheinter_advance','unvalidate','a',0,41,0),(71,'Read members\' card','adherent',1,'lire',NULL,'r',0,55,0),(72,'Create/modify members (need also user module permissions if member linked to a user)','adherent',1,'creer',NULL,'w',0,55,0),(74,'Remove members','adherent',1,'supprimer',NULL,'d',0,55,0),(75,'Setup types of membership','adherent',1,'configurer',NULL,'w',0,55,0),(76,'Export members','adherent',1,'export',NULL,'r',0,55,0),(78,'Read subscriptions','adherent',1,'cotisation','lire','r',0,55,0),(79,'Create/modify/remove subscriptions','adherent',1,'cotisation','creer','w',0,55,0),(81,'Read sales orders','commande',1,'lire',NULL,'r',0,0,0),(82,'Creeat/modify sales orders','commande',1,'creer',NULL,'w',0,0,0),(84,'Validate sales orders','commande',1,'order_advance','validate','d',0,0,0),(86,'Send sale orders by email','commande',1,'order_advance','send','d',0,0,0),(87,'Close sale orders','commande',1,'order_advance','close','d',0,0,0),(88,'Cancel sale orders','commande',1,'order_advance','annuler','d',0,0,0),(89,'Delete sales orders','commande',1,'supprimer',NULL,'d',0,0,0),(91,'Lire les charges','tax',1,'charges','lire','r',0,50,0),(91,'Lire les charges','tax',2,'charges','lire','r',1,50,0),(92,'Creer/modifier les charges','tax',1,'charges','creer','w',0,50,0),(92,'Creer/modifier les charges','tax',2,'charges','creer','w',0,50,0),(93,'Supprimer les charges','tax',1,'charges','supprimer','d',0,50,0),(93,'Supprimer les charges','tax',2,'charges','supprimer','d',0,50,0),(94,'Exporter les charges','tax',1,'charges','export','r',0,50,0),(94,'Exporter les charges','tax',2,'charges','export','r',0,50,0),(101,'Lire les expeditions','expedition',1,'lire',NULL,'r',0,40,0),(102,'Creer modifier les expeditions','expedition',1,'creer',NULL,'w',0,40,0),(104,'Valider les expeditions','expedition',1,'shipping_advance','validate','d',0,40,0),(105,'Envoyer les expeditions aux clients','expedition',1,'shipping_advance','send','d',0,40,0),(106,'Exporter les expeditions','expedition',1,'shipment','export','r',0,40,0),(109,'Supprimer les expeditions','expedition',1,'supprimer',NULL,'d',0,40,0),(111,'Read bank account and transactions','banque',1,'lire',NULL,'r',0,0,0),(111,'Lire les comptes bancaires','banque',2,'lire',NULL,'r',1,51,0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',1,'modifier',NULL,'w',0,0,0),(112,'Creer/modifier montant/supprimer ecriture bancaire','banque',2,'modifier',NULL,'w',0,51,0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',1,'configurer',NULL,'a',0,0,0),(113,'Configurer les comptes bancaires (creer, gerer categories)','banque',2,'configurer',NULL,'a',0,51,0),(114,'Rapprocher les ecritures bancaires','banque',1,'consolidate',NULL,'w',0,0,0),(114,'Rapprocher les ecritures bancaires','banque',2,'consolidate',NULL,'w',0,51,0),(115,'Exporter transactions et releves','banque',1,'export',NULL,'r',0,0,0),(115,'Exporter transactions et releves','banque',2,'export',NULL,'r',0,51,0),(116,'Virements entre comptes','banque',1,'transfer',NULL,'w',0,0,0),(116,'Virements entre comptes','banque',2,'transfer',NULL,'w',0,51,0),(117,'Gerer les envois de cheques','banque',1,'cheque',NULL,'w',0,0,0),(117,'Gerer les envois de cheques','banque',2,'cheque',NULL,'w',0,51,0),(121,'Read third parties','societe',1,'lire',NULL,'r',0,0,0),(121,'Lire les societes','societe',2,'lire',NULL,'r',1,9,0),(122,'Create and update third parties','societe',1,'creer',NULL,'w',0,0,0),(122,'Creer modifier les societes','societe',2,'creer',NULL,'w',0,9,0),(125,'Delete third parties','societe',1,'supprimer',NULL,'d',0,0,0),(125,'Supprimer les societes','societe',2,'supprimer',NULL,'d',0,9,0),(126,'Export third parties','societe',1,'export',NULL,'r',0,0,0),(126,'Exporter les societes','societe',2,'export',NULL,'r',0,9,0),(141,'Read all projects and tasks (also private projects I am not contact for)','projet',1,'all','lire','r',0,14,0),(142,'Create/modify all projects and tasks (also private projects I am not contact for)','projet',1,'all','creer','w',0,14,0),(144,'Delete all projects and tasks (also private projects I am not contact for)','projet',1,'all','supprimer','d',0,14,0),(151,'Read withdrawals','prelevement',1,'bons','lire','r',1,52,0),(152,'Create/modify a withdrawals','prelevement',1,'bons','creer','w',0,52,0),(153,'Send withdrawals to bank','prelevement',1,'bons','send','a',0,52,0),(154,'credit/refuse withdrawals','prelevement',1,'bons','credit','a',0,52,0),(161,'Lire les contrats','contrat',1,'lire',NULL,'r',1,35,0),(162,'Creer / modifier les contrats','contrat',1,'creer',NULL,'w',0,35,0),(163,'Activer un service d\'un contrat','contrat',1,'activer',NULL,'w',0,35,0),(164,'Desactiver un service d\'un contrat','contrat',1,'desactiver',NULL,'w',0,35,0),(165,'Supprimer un contrat','contrat',1,'supprimer',NULL,'d',0,35,0),(167,'Export contracts','contrat',1,'export',NULL,'r',0,35,0),(221,'Consulter les mailings','mailing',1,'lire',NULL,'r',1,11,0),(221,'Consulter les mailings','mailing',2,'lire',NULL,'r',1,11,0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',1,'creer',NULL,'w',0,11,0),(222,'Creer/modifier les mailings (sujet, destinataires...)','mailing',2,'creer',NULL,'w',0,11,0),(223,'Valider les mailings (permet leur envoi)','mailing',1,'valider',NULL,'w',0,11,0),(223,'Valider les mailings (permet leur envoi)','mailing',2,'valider',NULL,'w',0,11,0),(229,'Supprimer les mailings','mailing',1,'supprimer',NULL,'d',0,11,0),(229,'Supprimer les mailings','mailing',2,'supprimer',NULL,'d',0,11,0),(237,'View recipients and info','mailing',1,'mailing_advance','recipient','r',0,11,0),(237,'View recipients and info','mailing',2,'mailing_advance','recipient','r',0,11,0),(238,'Manually send mailings','mailing',1,'mailing_advance','send','w',0,11,0),(238,'Manually send mailings','mailing',2,'mailing_advance','send','w',0,11,0),(239,'Delete mailings after validation and/or sent','mailing',1,'mailing_advance','delete','d',0,11,0),(239,'Delete mailings after validation and/or sent','mailing',2,'mailing_advance','delete','d',0,11,0),(241,'Lire les categories','categorie',1,'lire',NULL,'r',1,20,0),(242,'Creer/modifier les categories','categorie',1,'creer',NULL,'w',0,20,0),(243,'Supprimer les categories','categorie',1,'supprimer',NULL,'d',0,20,0),(251,'Consulter les autres utilisateurs','user',1,'user','lire','r',0,0,0),(252,'Consulter les permissions des autres utilisateurs','user',1,'user_advance','readperms','r',0,0,0),(253,'Creer/modifier utilisateurs internes et externes','user',1,'user','creer','w',0,0,0),(254,'Creer/modifier utilisateurs externes seulement','user',1,'user_advance','write','w',0,0,0),(255,'Modifier le mot de passe des autres utilisateurs','user',1,'user','password','w',0,0,0),(256,'Supprimer ou desactiver les autres utilisateurs','user',1,'user','supprimer','d',0,0,0),(262,'Read all third parties (and their objects) by internal users (otherwise only if commercial contact). Not effective for external users (limited to themselves).','societe',1,'client','voir','r',0,0,0),(262,'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).','societe',2,'client','voir','r',1,9,0),(281,'Read contacts','societe',1,'contact','lire','r',0,0,0),(281,'Lire les contacts','societe',2,'contact','lire','r',1,9,0),(282,'Create and update contact','societe',1,'contact','creer','w',0,0,0),(282,'Creer modifier les contacts','societe',2,'contact','creer','w',0,9,0),(283,'Delete contacts','societe',1,'contact','supprimer','d',0,0,0),(283,'Supprimer les contacts','societe',2,'contact','supprimer','d',0,9,0),(286,'Export contacts','societe',1,'contact','export','d',0,0,0),(286,'Exporter les contacts','societe',2,'contact','export','d',0,9,0),(301,'Read barcodes','barcode',1,'lire_advance',NULL,'r',1,0,0),(302,'Create/modify barcodes','barcode',1,'creer_advance',NULL,'w',0,0,0),(331,'Lire les bookmarks','bookmark',1,'lire',NULL,'r',0,50,0),(332,'Creer/modifier les bookmarks','bookmark',1,'creer',NULL,'r',0,50,0),(333,'Supprimer les bookmarks','bookmark',1,'supprimer',NULL,'r',0,50,0),(341,'Consulter ses propres permissions','user',1,'self_advance','readperms','r',0,0,0),(342,'Creer/modifier ses propres infos utilisateur','user',1,'self','creer','w',0,0,0),(343,'Modifier son propre mot de passe','user',1,'self','password','w',0,0,0),(344,'Modifier ses propres permissions','user',1,'self_advance','writeperms','w',0,0,0),(351,'Consulter les groupes','user',1,'group_advance','read','r',0,0,0),(352,'Consulter les permissions des groupes','user',1,'group_advance','readperms','r',0,0,0),(353,'Creer/modifier les groupes et leurs permissions','user',1,'group_advance','write','w',0,0,0),(354,'Supprimer ou desactiver les groupes','user',1,'group_advance','delete','d',0,0,0),(358,'Exporter les utilisateurs','user',1,'user','export','r',0,0,0),(511,'Read employee salaries and payments (yours and your subordinates)','salaries',1,'read',NULL,'r',0,0,0),(512,'Create/modify payments of empoyee salaries','salaries',1,'write',NULL,'w',0,0,0),(514,'Delete payments of employee salary','salaries',1,'delete',NULL,'d',0,0,0),(517,'Read salaries and payments of all employees','salaries',1,'readall',NULL,'r',0,0,0),(519,'Export payments of employee salaries','salaries',1,'export',NULL,'r',0,0,0),(520,'Read loans','loan',1,'read',NULL,'r',0,50,0),(521,'Read loans','loan',1,'read',NULL,'r',0,50,0),(522,'Create/modify loans','loan',1,'write',NULL,'w',0,50,0),(524,'Delete loans','loan',1,'delete',NULL,'d',0,50,0),(525,'Access loan calculator','loan',1,'calc',NULL,'r',0,50,0),(527,'Export loans','loan',1,'export',NULL,'r',0,50,0),(531,'Read services','service',1,'lire',NULL,'r',0,0,0),(532,'Create/modify services','service',1,'creer',NULL,'w',0,0,0),(534,'Delete les services','service',1,'supprimer',NULL,'d',0,0,0),(538,'Export services','service',1,'export',NULL,'r',0,0,0),(561,'Read bank transfer payment orders','paymentbybanktransfer',1,'read',NULL,'r',0,52,0),(562,'Create/modify a bank transfer payment order','paymentbybanktransfer',1,'create',NULL,'w',0,52,0),(563,'Send/Transmit bank transfer payment order','paymentbybanktransfer',1,'send',NULL,'a',0,52,0),(564,'Record Debits/Rejects of bank transfer payment order','paymentbybanktransfer',1,'debit',NULL,'a',0,52,0),(651,'Read bom of Bom','bom',1,'read',NULL,'w',0,0,0),(652,'Create/Update bom of Bom','bom',1,'write',NULL,'w',0,0,0),(653,'Delete bom of Bom','bom',1,'delete',NULL,'w',0,0,0),(661,'Read Manufacturing Order','mrp',1,'read',NULL,'w',0,0,0),(662,'Create/Update Manufacturing Order','mrp',1,'write',NULL,'w',0,0,0),(663,'Delete Manufacturing Order','mrp',1,'delete',NULL,'w',0,0,0),(701,'Lire les dons','don',1,'lire',NULL,'r',1,50,0),(701,'Lire les dons','don',2,'lire',NULL,'r',1,50,0),(702,'Creer/modifier les dons','don',1,'creer',NULL,'w',0,50,0),(702,'Creer/modifier les dons','don',2,'creer',NULL,'w',0,50,0),(703,'Supprimer les dons','don',1,'supprimer',NULL,'d',0,50,0),(703,'Supprimer les dons','don',2,'supprimer',NULL,'d',0,50,0),(750,'Read job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','read','w',0,0,0),(751,'Create/Update job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','write','w',0,0,0),(752,'Delete Job positions to fill and candidatures','recruitment',1,'recruitmentjobposition','delete','w',0,0,0),(771,'Read expense reports (yours and your subordinates)','expensereport',1,'lire',NULL,'r',0,0,0),(772,'Create/modify expense reports','expensereport',1,'creer',NULL,'w',0,0,0),(773,'Delete expense reports','expensereport',1,'supprimer',NULL,'d',0,0,0),(775,'Approve expense reports','expensereport',1,'approve',NULL,'w',0,0,0),(776,'Pay expense reports','expensereport',1,'to_paid',NULL,'w',0,0,0),(777,'Read expense reports of everybody','expensereport',1,'readall',NULL,'r',0,0,0),(778,'Create expense reports for everybody','expensereport',1,'writeall_advance',NULL,'w',0,0,0),(779,'Export expense reports','expensereport',1,'export',NULL,'r',0,0,0),(1001,'Lire les stocks','stock',1,'lire',NULL,'r',1,40,0),(1002,'Creer/Modifier les stocks','stock',1,'creer',NULL,'w',0,40,0),(1003,'Supprimer les stocks','stock',1,'supprimer',NULL,'d',0,40,0),(1004,'Lire mouvements de stocks','stock',1,'mouvement','lire','r',1,40,0),(1005,'Creer/modifier mouvements de stocks','stock',1,'mouvement','creer','w',0,40,0),(1101,'Read delivery receipts','expedition',1,'delivery','lire','r',0,40,0),(1102,'Create/modify delivery receipts','expedition',1,'delivery','creer','w',0,40,0),(1104,'Validate delivery receipts','expedition',1,'delivery_advance','validate','d',0,40,0),(1109,'Delete delivery receipts','expedition',1,'delivery','supprimer','d',0,40,0),(1121,'Read supplier proposals','supplier_proposal',1,'lire',NULL,'w',0,35,0),(1122,'Create/modify supplier proposals','supplier_proposal',1,'creer',NULL,'w',0,35,0),(1123,'Validate supplier proposals','supplier_proposal',1,'validate_advance',NULL,'w',0,35,0),(1124,'Envoyer les demandes fournisseurs','supplier_proposal',1,'send_advance',NULL,'w',0,35,0),(1125,'Delete supplier proposals','supplier_proposal',1,'supprimer',NULL,'w',0,35,0),(1126,'Close supplier price requests','supplier_proposal',1,'cloturer',NULL,'w',0,35,0),(1181,'Consulter les fournisseurs','fournisseur',1,'lire',NULL,'r',0,0,0),(1182,'Consulter les commandes fournisseur','fournisseur',1,'commande','lire','r',0,0,0),(1183,'Creer une commande fournisseur','fournisseur',1,'commande','creer','w',0,0,0),(1184,'Valider une commande fournisseur','fournisseur',1,'supplier_order_advance','validate','w',0,0,0),(1185,'Approuver une commande fournisseur','fournisseur',1,'commande','approuver','w',0,0,0),(1186,'Commander une commande fournisseur','fournisseur',1,'commande','commander','w',0,0,0),(1187,'Receptionner une commande fournisseur','fournisseur',1,'commande','receptionner','d',0,0,0),(1188,'Supprimer une commande fournisseur','fournisseur',1,'commande','supprimer','d',0,0,0),(1189,'Check/Uncheck a supplier order reception','fournisseur',1,'commande_advance','check','w',0,0,0),(1191,'Exporter les commande fournisseurs, attributs','fournisseur',1,'commande','export','r',0,0,0),(1201,'Lire les exports','export',1,'lire',NULL,'r',1,72,0),(1202,'Creer/modifier un export','export',1,'creer',NULL,'w',0,72,0),(1231,'Consulter les factures fournisseur','fournisseur',1,'facture','lire','r',0,0,0),(1232,'Creer une facture fournisseur','fournisseur',1,'facture','creer','w',0,0,0),(1233,'Valider une facture fournisseur','fournisseur',1,'supplier_invoice_advance','validate','w',0,0,0),(1234,'Supprimer une facture fournisseur','fournisseur',1,'facture','supprimer','d',0,0,0),(1235,'Envoyer les factures par mail','fournisseur',1,'supplier_invoice_advance','send','a',0,0,0),(1236,'Exporter les factures fournisseurs, attributs et reglements','fournisseur',1,'facture','export','r',0,0,0),(1251,'Run mass imports of external data (data load)','import',1,'run',NULL,'r',0,70,0),(1321,'Export customer invoices, attributes and payments','facture',1,'facture','export','r',0,0,0),(1321,'Exporter les factures clients, attributs et reglements','facture',2,'facture','export','r',0,10,0),(1322,'Re-open a fully paid invoice','facture',1,'invoice_advance','reopen','r',0,0,0),(1421,'Export sales orders and attributes','commande',1,'commande','export','r',0,0,0),(2401,'Read actions/tasks linked to his account','agenda',1,'myactions','read','r',0,0,0),(2401,'Read actions/tasks linked to his account','agenda',2,'myactions','read','r',1,15,0),(2402,'Create/modify actions/tasks linked to his account','agenda',1,'myactions','create','w',0,0,0),(2402,'Create/modify actions/tasks linked to his account','agenda',2,'myactions','create','w',0,15,0),(2403,'Delete actions/tasks linked to his account','agenda',1,'myactions','delete','w',0,0,0),(2403,'Delete actions/tasks linked to his account','agenda',2,'myactions','delete','w',0,15,0),(2411,'Read actions/tasks of others','agenda',1,'allactions','read','r',0,0,0),(2411,'Read actions/tasks of others','agenda',2,'allactions','read','r',0,15,0),(2412,'Create/modify actions/tasks of others','agenda',1,'allactions','create','w',0,0,0),(2412,'Create/modify actions/tasks of others','agenda',2,'allactions','create','w',0,15,0),(2413,'Delete actions/tasks of others','agenda',1,'allactions','delete','w',0,0,0),(2413,'Delete actions/tasks of others','agenda',2,'allactions','delete','w',0,15,0),(2414,'Export actions/tasks of others','agenda',1,'export',NULL,'w',0,0,0),(2501,'Read or download documents','ecm',1,'read',NULL,'r',0,0,0),(2503,'Upload a document','ecm',1,'upload',NULL,'w',0,0,0),(2515,'Administer directories of documents','ecm',1,'setup',NULL,'w',0,0,0),(3200,'Read archived events and fingerprints','blockedlog',1,'read',NULL,'w',0,76,0),(3201,'Read archived events and fingerprints','blockedlog',1,'read',NULL,'w',0,76,0),(10001,'Read website content','website',1,'read',NULL,'w',0,0,0),(10002,'Create/modify website content (html and javascript content)','website',1,'write',NULL,'w',0,0,0),(10003,'Create/modify website content (dynamic php code). Dangerous, must be reserved to restricted developers.','website',1,'writephp',NULL,'w',0,0,0),(10005,'Delete website content','website',1,'delete',NULL,'w',0,0,0),(10008,'Export website content','website',1,'export',NULL,'w',0,0,0),(20001,'Read leave requests (yours and your subordinates)','holiday',1,'read',NULL,'w',0,0,0),(20001,'Créer / Modifier / Lire ses demandes de congés payés','holiday',2,'write',NULL,'w',1,42,0),(20002,'Create/modify leave requests','holiday',1,'write',NULL,'w',0,0,0),(20003,'Delete leave requests','holiday',1,'delete',NULL,'w',0,0,0),(20003,'Supprimer des demandes de congés payés','holiday',2,'delete',NULL,'w',0,42,0),(20004,'Read leave requests for everybody','holiday',1,'readall',NULL,'w',0,0,0),(20004,'Définir les congés payés des utilisateurs','holiday',2,'define_holiday',NULL,'w',0,42,0),(20005,'Create/modify leave requests for everybody','holiday',1,'writeall_advance',NULL,'w',0,0,0),(20005,'Voir les logs de modification des congés payés','holiday',2,'view_log',NULL,'w',0,42,0),(20006,'Setup leave requests of users (setup and update balance)','holiday',1,'define_holiday',NULL,'w',0,0,0),(20006,'Accéder au rapport mensuel des congés payés','holiday',2,'month_report',NULL,'w',0,42,0),(20007,'Approve leave requests','holiday',1,'approve',NULL,'w',0,0,0),(23001,'Read cron jobs','cron',1,'read',NULL,'w',0,0,0),(23002,'Create cron Jobs','cron',1,'create',NULL,'w',0,0,0),(23003,'Delete cron Jobs','cron',1,'delete',NULL,'w',0,0,0),(23004,'Execute cron Jobs','cron',1,'execute',NULL,'w',0,0,0),(50151,'Use Point Of Sale (record a sale, add products, record payment)','takepos',1,'run',NULL,'a',0,0,0),(50152,'Can modify added sales lines (prices, discount)','takepos',1,'editlines',NULL,'a',0,0,0),(50153,'Edit ordered sales lines (useful only when option \"Order printers\" has been enabled). Allow to edit sales lines even after the order has been printed','takepos',1,'editorderedlines',NULL,'a',0,0,0),(50401,'Bind products and invoices with accounting accounts','accounting',1,'bind','write','r',0,61,0),(50411,'Read operations in General Ledger','accounting',1,'mouvements','lire','r',0,61,0),(50412,'Write/Edit operations in General Ledger','accounting',1,'mouvements','creer','w',0,61,0),(50414,'Delete operations in Ledger','accounting',1,'mouvements','supprimer','d',0,61,0),(50415,'Delete all operations by year and journal in Ledger','accounting',1,'mouvements','supprimer_tous','d',0,61,0),(50418,'Export operations of the Ledger','accounting',1,'mouvements','export','r',0,61,0),(50420,'Report and export reports (turnover, balance, journals, general ledger)','accounting',1,'comptarapport','lire','r',0,61,0),(50430,'Define and close a fiscal year','accounting',1,'fiscalyear','write','r',0,61,0),(50440,'Manage chart of accounts, setup of accountancy','accounting',1,'chartofaccount',NULL,'r',0,61,0),(55001,'Read surveys','opensurvey',1,'read',NULL,'r',0,0,0),(55002,'Create/modify surveys','opensurvey',1,'write',NULL,'w',0,0,0),(56001,'Read ticket','ticket',1,'read',NULL,'r',0,0,0),(56002,'Create les tickets','ticket',1,'write',NULL,'w',0,0,0),(56003,'Delete les tickets','ticket',1,'delete',NULL,'d',0,0,0),(56004,'Manage tickets','ticket',1,'manage',NULL,'w',0,0,0),(59001,'Visualiser les marges','margins',1,'liretous',NULL,'r',0,55,0),(59002,'Définir les marges','margins',1,'creer',NULL,'w',0,55,0),(59003,'Read every user margin','margins',1,'read','all','r',0,55,0),(63001,'Read resources','resource',1,'read',NULL,'w',0,16,0),(63002,'Create/Modify resources','resource',1,'write',NULL,'w',0,16,0),(63003,'Delete resources','resource',1,'delete',NULL,'w',0,16,0),(63004,'Link resources to agenda events','resource',1,'link',NULL,'w',0,16,0),(64001,'DirectPrint','printing',1,'read',NULL,'r',0,52,0),(101250,'Read surveys','opensurvey',2,'survey','read','r',0,40,0),(101251,'Create/modify surveys','opensurvey',2,'survey','write','w',0,40,0),(941601,'Lire les receptions','reception',1,'lire',NULL,'r',0,40,0),(941602,'Creer modifier les receptions','reception',1,'creer',NULL,'w',0,40,0),(941603,'Valider les receptions','reception',1,'reception_advance','validate','d',0,40,0),(941604,'Envoyer les receptions aux clients','reception',1,'reception_advance','send','d',0,40,0),(941605,'Exporter les receptions','reception',1,'reception','export','r',0,40,0),(941606,'Supprimer les receptions','reception',1,'supprimer',NULL,'d',0,40,0); /*!40000 ALTER TABLE `llx_rights_def` ENABLE KEYS */; UNLOCK TABLES; @@ -12062,14 +11045,14 @@ DROP TABLE IF EXISTS `llx_session`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `llx_session` ( - `session_id` varchar(50) NOT NULL, - `session_variable` text DEFAULT NULL, + `session_id` varchar(50) CHARACTER SET utf8mb4 NOT NULL, + `session_variable` text CHARACTER SET utf8mb4 DEFAULT NULL, `last_accessed` datetime NOT NULL, `fk_user` int(11) NOT NULL, - `remote_ip` varchar(64) DEFAULT NULL, - `user_agent` varchar(128) DEFAULT NULL, + `remote_ip` varchar(64) CHARACTER SET utf8mb4 DEFAULT NULL, + `user_agent` varchar(128) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`session_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -12387,34 +11370,6 @@ INSERT INTO `llx_societe_extrafields` VALUES (75,'2018-01-22 16:40:03',10,NULL,N /*!40000 ALTER TABLE `llx_societe_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_societe_log` --- - -DROP TABLE IF EXISTS `llx_societe_log`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_societe_log` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `datel` datetime DEFAULT NULL, - `fk_soc` int(11) DEFAULT NULL, - `fk_statut` int(11) DEFAULT NULL, - `fk_user` int(11) DEFAULT NULL, - `author` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `label` varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_societe_log` --- - -LOCK TABLES `llx_societe_log` WRITE; -/*!40000 ALTER TABLE `llx_societe_log` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_societe_log` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_societe_perentity` -- @@ -12749,38 +11704,6 @@ LOCK TABLES `llx_socpeople_extrafields` WRITE; /*!40000 ALTER TABLE `llx_socpeople_extrafields` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_stock_lotserial` --- - -DROP TABLE IF EXISTS `llx_stock_lotserial`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_stock_lotserial` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) DEFAULT NULL, - `fk_product` int(11) NOT NULL, - `batch` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, - `eatby` date DEFAULT NULL, - `sellby` date DEFAULT NULL, - `datec` datetime DEFAULT NULL, - `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fk_user_creat` int(11) DEFAULT NULL, - `fk_user_modif` int(11) DEFAULT NULL, - `import_key` int(11) DEFAULT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_stock_lotserial` --- - -LOCK TABLES `llx_stock_lotserial` WRITE; -/*!40000 ALTER TABLE `llx_stock_lotserial` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_stock_lotserial` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_stock_mouvement` -- @@ -13493,7 +12416,7 @@ CREATE TABLE `llx_user_rights` ( UNIQUE KEY `uk_user_rights` (`entity`,`fk_user`,`fk_id`), KEY `fk_user_rights_fk_user_user` (`fk_user`), CONSTRAINT `fk_user_rights_fk_user_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) -) ENGINE=InnoDB AUTO_INCREMENT=20342 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=20602 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -13502,38 +12425,10 @@ CREATE TABLE `llx_user_rights` ( LOCK TABLES `llx_user_rights` WRITE; /*!40000 ALTER TABLE `llx_user_rights` DISABLE KEYS */; -INSERT INTO `llx_user_rights` VALUES (12402,1,1,11),(12380,1,1,12),(12385,1,1,13),(12389,1,1,14),(12393,1,1,15),(12398,1,1,16),(12404,1,1,19),(9726,1,1,21),(9700,1,1,22),(9706,1,1,24),(9711,1,1,25),(9716,1,1,26),(9722,1,1,27),(9728,1,1,28),(9978,1,1,31),(9968,1,1,32),(9974,1,1,34),(1910,1,1,36),(9980,1,1,38),(11573,1,1,41),(11574,1,1,42),(11575,1,1,44),(11576,1,1,45),(7184,1,1,61),(7181,1,1,62),(7183,1,1,64),(7185,1,1,67),(7186,1,1,68),(1678,1,1,71),(1673,1,1,72),(1675,1,1,74),(1679,1,1,75),(1677,1,1,76),(1681,1,1,78),(1682,1,1,79),(12322,1,1,81),(12309,1,1,82),(12312,1,1,84),(12314,1,1,86),(12317,1,1,87),(12320,1,1,88),(12323,1,1,89),(11580,1,1,91),(11581,1,1,92),(11582,1,1,93),(11583,1,1,94),(10097,1,1,95),(10099,1,1,96),(10103,1,1,97),(10104,1,1,98),(7139,1,1,101),(7134,1,1,102),(7136,1,1,104),(7137,1,1,105),(7138,1,1,106),(7140,1,1,109),(10229,1,1,111),(10201,1,1,112),(10207,1,1,113),(10213,1,1,114),(10219,1,1,115),(10225,1,1,116),(10231,1,1,117),(12518,1,1,121),(12508,1,1,122),(12514,1,1,125),(12520,1,1,126),(11577,1,1,141),(11578,1,1,142),(11579,1,1,144),(2307,1,1,151),(2304,1,1,152),(2306,1,1,153),(2308,1,1,154),(10092,1,1,161),(10093,1,1,162),(10094,1,1,163),(10095,1,1,164),(10096,1,1,165),(1585,1,1,170),(12342,1,1,171),(12331,1,1,172),(12335,1,1,173),(12339,1,1,174),(12343,1,1,178),(10000,1,1,221),(9990,1,1,222),(9996,1,1,223),(10002,1,1,229),(10007,1,1,237),(10011,1,1,238),(10015,1,1,239),(1686,1,1,241),(1685,1,1,242),(1687,1,1,243),(12604,1,1,251),(12566,1,1,252),(12569,1,1,253),(12572,1,1,254),(12575,1,1,255),(12579,1,1,256),(1617,1,1,258),(12525,1,1,262),(12544,1,1,281),(12534,1,1,282),(12540,1,1,283),(12546,1,1,286),(12288,1,1,300),(12290,1,1,301),(11591,1,1,302),(1763,1,1,331),(1762,1,1,332),(1764,1,1,333),(12582,1,1,341),(12584,1,1,342),(12586,1,1,343),(12588,1,1,344),(12600,1,1,351),(12593,1,1,352),(12597,1,1,353),(12601,1,1,354),(12605,1,1,358),(12560,1,1,531),(12553,1,1,532),(12557,1,1,534),(1625,1,1,536),(12561,1,1,538),(12358,1,1,700),(12348,1,1,701),(12354,1,1,702),(12360,1,1,703),(1755,1,1,1001),(1754,1,1,1002),(1756,1,1,1003),(1758,1,1,1004),(1759,1,1,1005),(7146,1,1,1101),(7143,1,1,1102),(7145,1,1,1104),(7147,1,1,1109),(12412,1,1,1181),(12458,1,1,1182),(12417,1,1,1183),(12420,1,1,1184),(12423,1,1,1185),(12427,1,1,1186),(12431,1,1,1187),(12437,1,1,1188),(12434,1,1,1189),(1578,1,1,1201),(1579,1,1,1202),(12454,1,1,1231),(12443,1,1,1232),(12446,1,1,1233),(12449,1,1,1234),(12452,1,1,1235),(12455,1,1,1236),(12459,1,1,1237),(1736,1,1,1251),(12409,1,1,1321),(12326,1,1,1421),(8190,1,1,1791),(8187,1,1,1792),(8191,1,1,1793),(12264,1,1,2401),(12260,1,1,2402),(12266,1,1,2403),(12280,1,1,2411),(12276,1,1,2412),(12282,1,1,2413),(12286,1,1,2414),(1618,1,1,2500),(12370,1,1,2501),(12367,1,1,2503),(12371,1,1,2515),(9610,1,1,5001),(9611,1,1,5002),(12490,1,1,20001),(12474,1,1,20003),(12480,1,1,20004),(12486,1,1,20005),(12492,1,1,20006),(12302,1,1,23001),(12295,1,1,23002),(12299,1,1,23003),(12303,1,1,23004),(7701,1,1,50101),(4984,1,1,50401),(4983,1,1,50402),(4985,1,1,50403),(4987,1,1,50411),(4988,1,1,50412),(4989,1,1,50415),(12498,1,1,55001),(12499,1,1,55002),(3564,1,1,100700),(3565,1,1,100701),(9596,1,1,101051),(9598,1,1,101052),(9600,1,1,101053),(9604,1,1,101060),(9605,1,1,101061),(7177,1,1,101201),(7178,1,1,101202),(10353,1,1,101250),(10355,1,1,101251),(8980,1,1,101261),(8981,1,1,101262),(7616,1,1,101331),(10030,1,1,101701),(10031,1,1,101702),(3582,1,1,102000),(3583,1,1,102001),(9819,1,1,400051),(9823,1,1,400052),(9827,1,1,400053),(9831,1,1,400055),(132,1,2,11),(133,1,2,12),(134,1,2,13),(135,1,2,14),(136,1,2,16),(137,1,2,19),(138,1,2,21),(139,1,2,22),(140,1,2,24),(141,1,2,25),(142,1,2,26),(143,1,2,27),(10359,1,2,31),(145,1,2,32),(10361,1,2,34),(146,1,2,36),(147,1,2,41),(148,1,2,42),(149,1,2,44),(150,1,2,61),(151,1,2,62),(152,1,2,64),(153,1,2,71),(154,1,2,72),(155,1,2,74),(156,1,2,75),(157,1,2,78),(158,1,2,79),(159,1,2,81),(160,1,2,82),(161,1,2,84),(162,1,2,86),(163,1,2,87),(164,1,2,88),(165,1,2,89),(166,1,2,91),(167,1,2,92),(168,1,2,93),(2475,1,2,95),(2476,1,2,96),(2477,1,2,97),(2478,1,2,98),(169,1,2,101),(170,1,2,102),(171,1,2,104),(172,1,2,109),(173,1,2,111),(174,1,2,112),(175,1,2,113),(176,1,2,114),(177,1,2,116),(178,1,2,117),(179,1,2,121),(180,1,2,122),(181,1,2,125),(182,1,2,141),(183,1,2,142),(184,1,2,144),(2479,1,2,151),(2480,1,2,152),(2481,1,2,153),(2482,1,2,154),(185,1,2,161),(186,1,2,162),(187,1,2,163),(188,1,2,164),(189,1,2,165),(190,1,2,170),(2471,1,2,171),(192,1,2,172),(2472,1,2,173),(193,1,2,221),(194,1,2,222),(195,1,2,229),(196,1,2,241),(197,1,2,242),(198,1,2,243),(199,1,2,251),(201,1,2,262),(202,1,2,281),(203,1,2,282),(204,1,2,283),(205,1,2,331),(15072,1,2,510),(2483,1,2,531),(207,1,2,532),(2484,1,2,534),(208,1,2,536),(2473,1,2,700),(210,1,2,701),(211,1,2,702),(2474,1,2,703),(15064,1,2,771),(15057,1,2,772),(15059,1,2,773),(15061,1,2,774),(15063,1,2,775),(15065,1,2,776),(212,1,2,1001),(213,1,2,1002),(214,1,2,1003),(215,1,2,1004),(216,1,2,1005),(217,1,2,1101),(218,1,2,1102),(219,1,2,1104),(220,1,2,1109),(15073,1,2,1121),(15074,1,2,1122),(15075,1,2,1123),(15076,1,2,1124),(15077,1,2,1125),(15078,1,2,1126),(221,1,2,1181),(222,1,2,1182),(223,1,2,1183),(224,1,2,1184),(225,1,2,1185),(226,1,2,1186),(227,1,2,1187),(228,1,2,1188),(229,1,2,1201),(230,1,2,1202),(231,1,2,1231),(232,1,2,1232),(233,1,2,1233),(234,1,2,1234),(235,1,2,1421),(236,1,2,2401),(237,1,2,2402),(238,1,2,2403),(239,1,2,2411),(240,1,2,2412),(241,1,2,2413),(242,1,2,2500),(2470,1,2,2501),(243,1,2,2515),(10363,1,2,20001),(10365,1,2,20003),(10366,1,2,20004),(10367,1,2,20005),(10368,1,2,20006),(15054,1,2,23001),(10362,1,2,50101),(15067,1,2,55001),(15066,1,2,59001),(15068,1,2,63001),(15069,1,2,63002),(15070,1,2,63003),(15071,1,2,63004),(10372,1,2,101250),(1807,1,3,11),(1808,1,3,31),(1809,1,3,36),(1810,1,3,41),(1811,1,3,61),(1812,1,3,71),(1813,1,3,72),(1814,1,3,74),(1815,1,3,75),(1816,1,3,78),(1817,1,3,79),(1818,1,3,91),(1819,1,3,95),(1820,1,3,97),(1821,1,3,111),(1822,1,3,121),(1823,1,3,122),(1824,1,3,125),(1825,1,3,161),(1826,1,3,170),(1827,1,3,171),(1828,1,3,172),(1829,1,3,221),(1830,1,3,222),(1831,1,3,229),(1832,1,3,241),(1833,1,3,242),(1834,1,3,243),(1835,1,3,251),(1836,1,3,255),(1837,1,3,256),(1838,1,3,262),(1839,1,3,281),(1840,1,3,282),(1841,1,3,283),(1842,1,3,331),(1843,1,3,531),(1844,1,3,536),(1845,1,3,700),(1846,1,3,1001),(1847,1,3,1002),(1848,1,3,1003),(1849,1,3,1004),(1850,1,3,1005),(1851,1,3,1181),(1852,1,3,1182),(1853,1,3,1201),(1854,1,3,1202),(1855,1,3,1231),(1856,1,3,2401),(1857,1,3,2402),(1858,1,3,2403),(1859,1,3,2411),(1860,1,3,2412),(1861,1,3,2413),(1862,1,3,2500),(1863,1,3,2515),(8026,1,4,11),(8027,1,4,21),(8028,1,4,31),(8029,1,4,41),(8030,1,4,61),(8031,1,4,71),(8032,1,4,72),(8033,1,4,74),(8034,1,4,75),(8035,1,4,78),(8036,1,4,79),(8037,1,4,81),(8038,1,4,91),(8039,1,4,95),(8040,1,4,97),(8041,1,4,101),(8042,1,4,111),(8043,1,4,121),(8044,1,4,151),(8045,1,4,161),(8046,1,4,171),(8047,1,4,221),(8048,1,4,222),(8049,1,4,229),(8050,1,4,241),(8051,1,4,242),(8052,1,4,243),(8146,1,4,251),(8147,1,4,253),(8053,1,4,262),(8054,1,4,281),(8055,1,4,331),(8056,1,4,341),(8057,1,4,342),(8058,1,4,343),(8059,1,4,344),(8060,1,4,531),(8061,1,4,700),(8062,1,4,1001),(8063,1,4,1002),(8064,1,4,1003),(8065,1,4,1004),(8066,1,4,1005),(8067,1,4,1101),(8068,1,4,1181),(8069,1,4,1182),(8070,1,4,1201),(8071,1,4,1202),(8072,1,4,1231),(8073,1,4,2401),(8074,1,4,2501),(8075,1,4,2503),(8076,1,4,2515),(8077,1,4,20001),(8078,1,4,50101),(8079,1,4,101201),(8080,1,4,101261),(8081,1,4,102000),(8082,1,4,400051),(8083,1,4,400052),(8084,1,4,400053),(8085,1,4,400055),(12608,1,10,11),(12609,1,10,21),(12610,1,10,31),(12611,1,10,41),(12612,1,10,61),(12613,1,10,71),(12614,1,10,72),(12615,1,10,74),(12616,1,10,75),(12617,1,10,78),(12618,1,10,79),(12619,1,10,81),(12620,1,10,91),(12621,1,10,95),(12622,1,10,97),(12623,1,10,101),(12624,1,10,111),(12625,1,10,121),(12626,1,10,151),(12627,1,10,161),(12628,1,10,171),(12629,1,10,221),(12630,1,10,222),(12631,1,10,229),(12632,1,10,241),(12633,1,10,242),(12634,1,10,243),(12635,1,10,262),(12636,1,10,281),(12637,1,10,300),(12638,1,10,331),(12639,1,10,341),(12640,1,10,342),(12641,1,10,343),(12642,1,10,344),(12643,1,10,531),(12644,1,10,700),(12645,1,10,1001),(12646,1,10,1002),(12647,1,10,1003),(12648,1,10,1004),(12649,1,10,1005),(12650,1,10,1101),(12651,1,10,1181),(12652,1,10,1182),(12653,1,10,1201),(12654,1,10,1202),(12655,1,10,1231),(12656,1,10,2401),(12657,1,10,2501),(12658,1,10,2503),(12659,1,10,2515),(12660,1,10,20001),(12662,1,10,23001),(12663,1,10,50101),(12664,1,11,11),(12665,1,11,21),(12666,1,11,31),(12667,1,11,41),(12668,1,11,61),(12669,1,11,71),(12670,1,11,72),(12671,1,11,74),(12672,1,11,75),(12673,1,11,78),(12674,1,11,79),(12675,1,11,81),(12676,1,11,91),(12677,1,11,95),(12678,1,11,97),(12679,1,11,101),(12680,1,11,111),(12681,1,11,121),(12682,1,11,151),(12683,1,11,161),(12684,1,11,171),(12685,1,11,221),(12686,1,11,222),(12687,1,11,229),(12688,1,11,241),(12689,1,11,242),(12690,1,11,243),(12691,1,11,262),(12692,1,11,281),(12693,1,11,300),(12694,1,11,331),(12695,1,11,341),(12696,1,11,342),(12697,1,11,343),(12698,1,11,344),(12699,1,11,531),(12700,1,11,700),(12701,1,11,1001),(12702,1,11,1002),(12703,1,11,1003),(12704,1,11,1004),(12705,1,11,1005),(12706,1,11,1101),(12707,1,11,1181),(12708,1,11,1182),(12709,1,11,1201),(12710,1,11,1202),(12711,1,11,1231),(12712,1,11,2401),(12713,1,11,2501),(12714,1,11,2503),(12715,1,11,2515),(12716,1,11,20001),(12718,1,11,23001),(12719,1,11,50101),(20197,1,12,11),(20189,1,12,12),(20190,1,12,13),(20191,1,12,14),(20192,1,12,15),(20195,1,12,16),(20198,1,12,19),(14146,1,12,21),(14135,1,12,22),(14137,1,12,24),(14139,1,12,25),(14142,1,12,26),(14145,1,12,27),(14148,1,12,28),(14930,1,12,31),(14926,1,12,32),(14929,1,12,34),(14932,1,12,38),(13816,1,12,41),(13813,1,12,42),(13815,1,12,44),(13817,1,12,45),(14094,1,12,61),(14091,1,12,62),(14093,1,12,64),(14095,1,12,67),(14096,1,12,68),(16203,1,12,71),(16198,1,12,72),(16200,1,12,74),(16204,1,12,75),(16202,1,12,76),(16206,1,12,78),(16207,1,12,79),(20154,1,12,81),(20149,1,12,82),(20150,1,12,84),(20151,1,12,86),(20152,1,12,87),(20153,1,12,88),(20155,1,12,89),(15401,1,12,91),(15397,1,12,92),(15400,1,12,93),(15403,1,12,94),(13990,1,12,95),(12734,1,12,97),(19241,1,12,101),(19237,1,12,102),(19238,1,12,104),(19239,1,12,105),(19240,1,12,106),(19242,1,12,109),(20136,1,12,111),(20122,1,12,112),(20125,1,12,113),(20128,1,12,114),(20131,1,12,115),(20134,1,12,116),(20137,1,12,117),(20288,1,12,121),(20283,1,12,122),(20286,1,12,125),(20289,1,12,126),(13821,1,12,141),(13820,1,12,142),(13822,1,12,144),(13912,1,12,151),(13909,1,12,152),(13911,1,12,153),(13913,1,12,154),(14063,1,12,161),(14056,1,12,162),(14058,1,12,163),(14060,1,12,164),(14062,1,12,165),(14064,1,12,167),(13350,1,12,171),(13345,1,12,172),(13347,1,12,173),(13349,1,12,174),(13351,1,12,178),(13838,1,12,221),(13834,1,12,222),(13837,1,12,223),(13840,1,12,229),(13842,1,12,237),(13844,1,12,238),(13846,1,12,239),(13516,1,12,241),(13515,1,12,242),(13517,1,12,243),(20330,1,12,251),(20311,1,12,252),(20313,1,12,253),(20314,1,12,254),(20316,1,12,255),(20318,1,12,256),(20290,1,12,262),(20300,1,12,281),(20295,1,12,282),(20298,1,12,283),(20301,1,12,286),(19877,1,12,300),(20138,1,12,301),(20139,1,12,302),(16194,1,12,331),(16193,1,12,332),(16195,1,12,333),(20319,1,12,341),(20320,1,12,342),(20321,1,12,343),(20322,1,12,344),(20328,1,12,351),(20325,1,12,352),(20327,1,12,353),(20329,1,12,354),(20331,1,12,358),(19249,1,12,430),(16384,1,12,501),(16378,1,12,502),(13865,1,12,510),(20270,1,12,511),(20265,1,12,512),(20267,1,12,514),(20269,1,12,517),(20271,1,12,519),(15291,1,12,520),(15286,1,12,522),(15288,1,12,524),(15290,1,12,525),(15292,1,12,527),(20277,1,12,531),(20274,1,12,532),(20276,1,12,534),(20278,1,12,538),(20076,1,12,561),(20073,1,12,562),(20075,1,12,563),(20077,1,12,564),(16932,1,12,650),(20116,1,12,651),(20115,1,12,652),(20117,1,12,653),(17124,1,12,660),(20245,1,12,661),(20244,1,12,662),(20246,1,12,663),(13358,1,12,700),(20163,1,12,701),(20161,1,12,702),(20164,1,12,703),(20254,1,12,750),(20253,1,12,751),(20255,1,12,752),(20183,1,12,771),(20172,1,12,772),(20174,1,12,773),(15085,1,12,774),(20176,1,12,775),(20178,1,12,776),(20180,1,12,777),(20182,1,12,778),(20184,1,12,779),(14917,1,12,1001),(14916,1,12,1002),(14918,1,12,1003),(14920,1,12,1004),(14921,1,12,1005),(19247,1,12,1101),(19245,1,12,1102),(19246,1,12,1104),(19248,1,12,1109),(19233,1,12,1121),(19226,1,12,1122),(19228,1,12,1123),(19230,1,12,1124),(19232,1,12,1125),(19234,1,12,1126),(20201,1,12,1181),(20215,1,12,1182),(20204,1,12,1183),(20205,1,12,1184),(20207,1,12,1185),(20209,1,12,1186),(20211,1,12,1187),(20214,1,12,1188),(20212,1,12,1189),(20216,1,12,1191),(13827,1,12,1201),(13828,1,12,1202),(20224,1,12,1231),(20219,1,12,1232),(20220,1,12,1233),(20222,1,12,1234),(20223,1,12,1235),(20225,1,12,1236),(16302,1,12,1237),(13829,1,12,1251),(20199,1,12,1321),(20200,1,12,1322),(20156,1,12,1421),(20102,1,12,2401),(20100,1,12,2402),(20103,1,12,2403),(20110,1,12,2411),(20108,1,12,2412),(20111,1,12,2413),(20112,1,12,2414),(20168,1,12,2501),(20167,1,12,2503),(20169,1,12,2515),(20082,1,12,3200),(20341,1,12,3301),(15435,1,12,5001),(15436,1,12,5002),(20339,1,12,10001),(20334,1,12,10002),(20336,1,12,10003),(20338,1,12,10005),(20340,1,12,10008),(20237,1,12,20001),(20228,1,12,20002),(20230,1,12,20003),(20234,1,12,20004),(20236,1,12,20005),(20238,1,12,20006),(20232,1,12,20007),(20145,1,12,23001),(20142,1,12,23002),(20144,1,12,23003),(20146,1,12,23004),(19019,1,12,50101),(20309,1,12,50151),(20084,1,12,50401),(20092,1,12,50411),(20087,1,12,50412),(20089,1,12,50414),(20091,1,12,50415),(20093,1,12,50418),(20094,1,12,50420),(20095,1,12,50430),(20083,1,12,50440),(20248,1,12,55001),(20249,1,12,55002),(20307,1,12,56001),(20304,1,12,56002),(20306,1,12,56003),(20308,1,12,56004),(16742,1,12,56005),(20239,1,12,59001),(20240,1,12,59002),(20241,1,12,59003),(20261,1,12,63001),(20258,1,12,63002),(20260,1,12,63003),(20262,1,12,63004),(20250,1,12,64001),(17328,1,12,101130),(17327,1,12,101131),(17329,1,12,101132),(16009,1,12,101331),(16010,1,12,101332),(16011,1,12,101333),(19208,1,12,101701),(19209,1,12,101702),(20069,1,12,941601),(20065,1,12,941602),(20066,1,12,941603),(20067,1,12,941604),(20068,1,12,941605),(20070,1,12,941606),(12776,1,13,11),(12777,1,13,21),(12778,1,13,31),(12779,1,13,41),(12780,1,13,61),(12781,1,13,71),(12782,1,13,72),(12783,1,13,74),(12784,1,13,75),(12785,1,13,78),(12786,1,13,79),(12787,1,13,81),(12788,1,13,91),(12789,1,13,95),(12790,1,13,97),(12791,1,13,101),(12792,1,13,111),(12793,1,13,121),(12794,1,13,151),(12795,1,13,161),(12796,1,13,171),(12797,1,13,221),(12798,1,13,222),(12799,1,13,229),(12800,1,13,241),(12801,1,13,242),(12802,1,13,243),(12803,1,13,262),(12804,1,13,281),(12805,1,13,300),(12806,1,13,331),(12807,1,13,341),(12808,1,13,342),(12809,1,13,343),(12810,1,13,344),(12811,1,13,531),(12812,1,13,700),(12813,1,13,1001),(12814,1,13,1002),(12815,1,13,1003),(12816,1,13,1004),(12817,1,13,1005),(12818,1,13,1101),(12819,1,13,1181),(12820,1,13,1182),(12821,1,13,1201),(12822,1,13,1202),(12823,1,13,1231),(12824,1,13,2401),(12825,1,13,2501),(12826,1,13,2503),(12827,1,13,2515),(12828,1,13,20001),(12830,1,13,23001),(12831,1,13,50101),(12832,1,14,11),(12833,1,14,21),(12834,1,14,31),(12835,1,14,41),(12836,1,14,61),(12837,1,14,71),(12838,1,14,72),(12839,1,14,74),(12840,1,14,75),(12841,1,14,78),(12842,1,14,79),(12843,1,14,81),(12844,1,14,91),(12845,1,14,95),(12846,1,14,97),(12847,1,14,101),(12848,1,14,111),(12849,1,14,121),(12850,1,14,151),(12851,1,14,161),(12852,1,14,171),(12853,1,14,221),(12854,1,14,222),(12855,1,14,229),(12856,1,14,241),(12857,1,14,242),(12858,1,14,243),(12859,1,14,262),(12860,1,14,281),(12861,1,14,300),(12862,1,14,331),(12863,1,14,341),(12864,1,14,342),(12865,1,14,343),(12866,1,14,344),(12867,1,14,531),(12868,1,14,700),(12869,1,14,1001),(12870,1,14,1002),(12871,1,14,1003),(12872,1,14,1004),(12873,1,14,1005),(12874,1,14,1101),(12875,1,14,1181),(12876,1,14,1182),(12877,1,14,1201),(12878,1,14,1202),(12879,1,14,1231),(12880,1,14,2401),(12881,1,14,2501),(12882,1,14,2503),(12883,1,14,2515),(12884,1,14,20001),(12886,1,14,23001),(12887,1,14,50101),(12944,1,16,11),(12945,1,16,21),(12946,1,16,31),(13056,1,16,41),(13057,1,16,42),(13058,1,16,44),(13059,1,16,45),(12948,1,16,61),(12949,1,16,71),(12950,1,16,72),(12951,1,16,74),(12952,1,16,75),(12953,1,16,78),(12954,1,16,79),(12955,1,16,81),(12956,1,16,91),(12957,1,16,95),(12958,1,16,97),(12959,1,16,101),(12960,1,16,111),(12961,1,16,121),(13060,1,16,141),(13061,1,16,142),(13062,1,16,144),(12962,1,16,151),(12963,1,16,161),(12964,1,16,171),(12965,1,16,221),(12966,1,16,222),(12967,1,16,229),(12968,1,16,241),(12969,1,16,242),(12970,1,16,243),(13128,1,16,251),(13064,1,16,262),(12972,1,16,281),(12973,1,16,300),(12974,1,16,331),(12975,1,16,341),(12976,1,16,342),(12977,1,16,343),(12978,1,16,344),(12979,1,16,531),(12980,1,16,700),(12981,1,16,1001),(12982,1,16,1002),(12983,1,16,1003),(12984,1,16,1004),(12985,1,16,1005),(12986,1,16,1101),(12987,1,16,1181),(12988,1,16,1182),(12989,1,16,1201),(12990,1,16,1202),(12991,1,16,1231),(12992,1,16,2401),(12993,1,16,2501),(12994,1,16,2503),(12995,1,16,2515),(12996,1,16,20001),(12998,1,16,23001),(12999,1,16,50101),(13000,1,17,11),(13001,1,17,21),(13002,1,17,31),(13065,1,17,41),(13066,1,17,42),(13067,1,17,44),(13068,1,17,45),(13004,1,17,61),(13005,1,17,71),(13006,1,17,72),(13007,1,17,74),(13008,1,17,75),(13009,1,17,78),(13010,1,17,79),(13011,1,17,81),(13012,1,17,91),(13013,1,17,95),(13014,1,17,97),(13015,1,17,101),(13016,1,17,111),(13017,1,17,121),(13069,1,17,141),(13070,1,17,142),(13071,1,17,144),(13018,1,17,151),(13019,1,17,161),(13020,1,17,171),(13021,1,17,221),(13022,1,17,222),(13023,1,17,229),(13024,1,17,241),(13025,1,17,242),(13026,1,17,243),(13028,1,17,281),(13029,1,17,300),(13030,1,17,331),(13031,1,17,341),(13032,1,17,342),(13033,1,17,343),(13034,1,17,344),(13035,1,17,531),(13036,1,17,700),(13037,1,17,1001),(13038,1,17,1002),(13039,1,17,1003),(13040,1,17,1004),(13041,1,17,1005),(13042,1,17,1101),(13043,1,17,1181),(13044,1,17,1182),(13045,1,17,1201),(13046,1,17,1202),(13047,1,17,1231),(13048,1,17,2401),(13049,1,17,2501),(13050,1,17,2503),(13051,1,17,2515),(13052,1,17,20001),(13054,1,17,23001),(13055,1,17,50101),(14504,1,18,11),(14505,1,18,21),(14506,1,18,31),(14507,1,18,41),(14508,1,18,61),(14509,1,18,71),(14510,1,18,78),(14511,1,18,81),(14512,1,18,91),(14513,1,18,95),(14514,1,18,101),(14515,1,18,111),(14516,1,18,121),(14517,1,18,151),(14518,1,18,161),(14519,1,18,221),(14520,1,18,241),(14521,1,18,262),(14522,1,18,281),(14523,1,18,300),(14524,1,18,331),(14525,1,18,332),(14526,1,18,333),(14527,1,18,341),(14528,1,18,342),(14529,1,18,343),(14530,1,18,344),(14531,1,18,531),(14532,1,18,701),(14533,1,18,771),(14534,1,18,774),(14535,1,18,1001),(14536,1,18,1004),(14537,1,18,1101),(14538,1,18,1181),(14539,1,18,1182),(14540,1,18,1201),(14541,1,18,1231),(14542,1,18,2401),(14543,1,18,2501),(14544,1,18,2503),(14545,1,18,2515),(14546,1,18,20001),(14548,1,18,50101),(14549,1,18,59001),(15242,1,19,21),(15243,1,19,31),(15244,1,19,41),(15245,1,19,61),(15246,1,19,71),(15247,1,19,78),(15248,1,19,81),(15249,1,19,101),(15250,1,19,121),(15251,1,19,151),(15252,1,19,161),(15253,1,19,221),(15254,1,19,241),(15255,1,19,262),(15256,1,19,281),(15257,1,19,300),(15258,1,19,331),(15259,1,19,332),(15260,1,19,341),(15261,1,19,342),(15262,1,19,343),(15263,1,19,344),(15264,1,19,531),(15265,1,19,701),(15266,1,19,771),(15267,1,19,774),(15268,1,19,777),(15269,1,19,1001),(15270,1,19,1004),(15271,1,19,1101),(15272,1,19,1121),(15273,1,19,1181),(15274,1,19,1182),(15275,1,19,1201),(15276,1,19,1231),(15277,1,19,2401),(15278,1,19,2501),(15279,1,19,20001),(15281,1,19,50101),(15282,1,19,59001),(15283,1,19,63001); +INSERT INTO `llx_user_rights` VALUES (12402,1,1,11),(12380,1,1,12),(12385,1,1,13),(12389,1,1,14),(12393,1,1,15),(12398,1,1,16),(12404,1,1,19),(9726,1,1,21),(9700,1,1,22),(9706,1,1,24),(9711,1,1,25),(9716,1,1,26),(9722,1,1,27),(9728,1,1,28),(9978,1,1,31),(9968,1,1,32),(9974,1,1,34),(1910,1,1,36),(9980,1,1,38),(11573,1,1,41),(11574,1,1,42),(11575,1,1,44),(11576,1,1,45),(7184,1,1,61),(7181,1,1,62),(7183,1,1,64),(7185,1,1,67),(7186,1,1,68),(1678,1,1,71),(1673,1,1,72),(1675,1,1,74),(1679,1,1,75),(1677,1,1,76),(1681,1,1,78),(1682,1,1,79),(12322,1,1,81),(12309,1,1,82),(12312,1,1,84),(12314,1,1,86),(12317,1,1,87),(12320,1,1,88),(12323,1,1,89),(11580,1,1,91),(11581,1,1,92),(11582,1,1,93),(11583,1,1,94),(10097,1,1,95),(10099,1,1,96),(10103,1,1,97),(10104,1,1,98),(7139,1,1,101),(7134,1,1,102),(7136,1,1,104),(7137,1,1,105),(7138,1,1,106),(7140,1,1,109),(10229,1,1,111),(10201,1,1,112),(10207,1,1,113),(10213,1,1,114),(10219,1,1,115),(10225,1,1,116),(10231,1,1,117),(12518,1,1,121),(12508,1,1,122),(12514,1,1,125),(12520,1,1,126),(11577,1,1,141),(11578,1,1,142),(11579,1,1,144),(2307,1,1,151),(2304,1,1,152),(2306,1,1,153),(2308,1,1,154),(10092,1,1,161),(10093,1,1,162),(10094,1,1,163),(10095,1,1,164),(10096,1,1,165),(1585,1,1,170),(12342,1,1,171),(12331,1,1,172),(12335,1,1,173),(12339,1,1,174),(12343,1,1,178),(10000,1,1,221),(9990,1,1,222),(9996,1,1,223),(10002,1,1,229),(10007,1,1,237),(10011,1,1,238),(10015,1,1,239),(1686,1,1,241),(1685,1,1,242),(1687,1,1,243),(12604,1,1,251),(12566,1,1,252),(12569,1,1,253),(12572,1,1,254),(12575,1,1,255),(12579,1,1,256),(1617,1,1,258),(12525,1,1,262),(12544,1,1,281),(12534,1,1,282),(12540,1,1,283),(12546,1,1,286),(12288,1,1,300),(12290,1,1,301),(11591,1,1,302),(1763,1,1,331),(1762,1,1,332),(1764,1,1,333),(12582,1,1,341),(12584,1,1,342),(12586,1,1,343),(12588,1,1,344),(12600,1,1,351),(12593,1,1,352),(12597,1,1,353),(12601,1,1,354),(12605,1,1,358),(12560,1,1,531),(12553,1,1,532),(12557,1,1,534),(1625,1,1,536),(12561,1,1,538),(12358,1,1,700),(12348,1,1,701),(12354,1,1,702),(12360,1,1,703),(1755,1,1,1001),(1754,1,1,1002),(1756,1,1,1003),(1758,1,1,1004),(1759,1,1,1005),(7146,1,1,1101),(7143,1,1,1102),(7145,1,1,1104),(7147,1,1,1109),(12412,1,1,1181),(12458,1,1,1182),(12417,1,1,1183),(12420,1,1,1184),(12423,1,1,1185),(12427,1,1,1186),(12431,1,1,1187),(12437,1,1,1188),(12434,1,1,1189),(1578,1,1,1201),(1579,1,1,1202),(12454,1,1,1231),(12443,1,1,1232),(12446,1,1,1233),(12449,1,1,1234),(12452,1,1,1235),(12455,1,1,1236),(12459,1,1,1237),(1736,1,1,1251),(12409,1,1,1321),(12326,1,1,1421),(8190,1,1,1791),(8187,1,1,1792),(8191,1,1,1793),(12264,1,1,2401),(12260,1,1,2402),(12266,1,1,2403),(12280,1,1,2411),(12276,1,1,2412),(12282,1,1,2413),(12286,1,1,2414),(1618,1,1,2500),(12370,1,1,2501),(12367,1,1,2503),(12371,1,1,2515),(9610,1,1,5001),(9611,1,1,5002),(12490,1,1,20001),(12474,1,1,20003),(12480,1,1,20004),(12486,1,1,20005),(12492,1,1,20006),(12302,1,1,23001),(12295,1,1,23002),(12299,1,1,23003),(12303,1,1,23004),(7701,1,1,50101),(4984,1,1,50401),(4983,1,1,50402),(4985,1,1,50403),(4987,1,1,50411),(4988,1,1,50412),(4989,1,1,50415),(12498,1,1,55001),(12499,1,1,55002),(3564,1,1,100700),(3565,1,1,100701),(9596,1,1,101051),(9598,1,1,101052),(9600,1,1,101053),(9604,1,1,101060),(9605,1,1,101061),(7177,1,1,101201),(7178,1,1,101202),(10353,1,1,101250),(10355,1,1,101251),(8980,1,1,101261),(8981,1,1,101262),(7616,1,1,101331),(10030,1,1,101701),(10031,1,1,101702),(3582,1,1,102000),(3583,1,1,102001),(9819,1,1,400051),(9823,1,1,400052),(9827,1,1,400053),(9831,1,1,400055),(132,1,2,11),(133,1,2,12),(134,1,2,13),(135,1,2,14),(136,1,2,16),(137,1,2,19),(138,1,2,21),(139,1,2,22),(140,1,2,24),(141,1,2,25),(142,1,2,26),(143,1,2,27),(10359,1,2,31),(145,1,2,32),(10361,1,2,34),(146,1,2,36),(147,1,2,41),(148,1,2,42),(149,1,2,44),(150,1,2,61),(151,1,2,62),(152,1,2,64),(153,1,2,71),(154,1,2,72),(155,1,2,74),(156,1,2,75),(157,1,2,78),(158,1,2,79),(159,1,2,81),(160,1,2,82),(161,1,2,84),(162,1,2,86),(163,1,2,87),(164,1,2,88),(165,1,2,89),(166,1,2,91),(167,1,2,92),(168,1,2,93),(2475,1,2,95),(2476,1,2,96),(2477,1,2,97),(2478,1,2,98),(169,1,2,101),(170,1,2,102),(171,1,2,104),(172,1,2,109),(173,1,2,111),(174,1,2,112),(175,1,2,113),(176,1,2,114),(177,1,2,116),(178,1,2,117),(179,1,2,121),(180,1,2,122),(181,1,2,125),(182,1,2,141),(183,1,2,142),(184,1,2,144),(2479,1,2,151),(2480,1,2,152),(2481,1,2,153),(2482,1,2,154),(185,1,2,161),(186,1,2,162),(187,1,2,163),(188,1,2,164),(189,1,2,165),(190,1,2,170),(2471,1,2,171),(192,1,2,172),(2472,1,2,173),(193,1,2,221),(194,1,2,222),(195,1,2,229),(196,1,2,241),(197,1,2,242),(198,1,2,243),(199,1,2,251),(201,1,2,262),(202,1,2,281),(203,1,2,282),(204,1,2,283),(205,1,2,331),(15072,1,2,510),(2483,1,2,531),(207,1,2,532),(2484,1,2,534),(208,1,2,536),(2473,1,2,700),(210,1,2,701),(211,1,2,702),(2474,1,2,703),(15064,1,2,771),(15057,1,2,772),(15059,1,2,773),(15061,1,2,774),(15063,1,2,775),(15065,1,2,776),(212,1,2,1001),(213,1,2,1002),(214,1,2,1003),(215,1,2,1004),(216,1,2,1005),(217,1,2,1101),(218,1,2,1102),(219,1,2,1104),(220,1,2,1109),(15073,1,2,1121),(15074,1,2,1122),(15075,1,2,1123),(15076,1,2,1124),(15077,1,2,1125),(15078,1,2,1126),(221,1,2,1181),(222,1,2,1182),(223,1,2,1183),(224,1,2,1184),(225,1,2,1185),(226,1,2,1186),(227,1,2,1187),(228,1,2,1188),(229,1,2,1201),(230,1,2,1202),(231,1,2,1231),(232,1,2,1232),(233,1,2,1233),(234,1,2,1234),(235,1,2,1421),(236,1,2,2401),(237,1,2,2402),(238,1,2,2403),(239,1,2,2411),(240,1,2,2412),(241,1,2,2413),(242,1,2,2500),(2470,1,2,2501),(243,1,2,2515),(10363,1,2,20001),(10365,1,2,20003),(10366,1,2,20004),(10367,1,2,20005),(10368,1,2,20006),(15054,1,2,23001),(10362,1,2,50101),(15067,1,2,55001),(15066,1,2,59001),(15068,1,2,63001),(15069,1,2,63002),(15070,1,2,63003),(15071,1,2,63004),(10372,1,2,101250),(1807,1,3,11),(1808,1,3,31),(1809,1,3,36),(1810,1,3,41),(1811,1,3,61),(1812,1,3,71),(1813,1,3,72),(1814,1,3,74),(1815,1,3,75),(1816,1,3,78),(1817,1,3,79),(1818,1,3,91),(1819,1,3,95),(1820,1,3,97),(1821,1,3,111),(1822,1,3,121),(1823,1,3,122),(1824,1,3,125),(1825,1,3,161),(1826,1,3,170),(1827,1,3,171),(1828,1,3,172),(1829,1,3,221),(1830,1,3,222),(1831,1,3,229),(1832,1,3,241),(1833,1,3,242),(1834,1,3,243),(1835,1,3,251),(1836,1,3,255),(1837,1,3,256),(1838,1,3,262),(1839,1,3,281),(1840,1,3,282),(1841,1,3,283),(1842,1,3,331),(1843,1,3,531),(1844,1,3,536),(1845,1,3,700),(1846,1,3,1001),(1847,1,3,1002),(1848,1,3,1003),(1849,1,3,1004),(1850,1,3,1005),(1851,1,3,1181),(1852,1,3,1182),(1853,1,3,1201),(1854,1,3,1202),(1855,1,3,1231),(1856,1,3,2401),(1857,1,3,2402),(1858,1,3,2403),(1859,1,3,2411),(1860,1,3,2412),(1861,1,3,2413),(1862,1,3,2500),(1863,1,3,2515),(8026,1,4,11),(8027,1,4,21),(8028,1,4,31),(8029,1,4,41),(8030,1,4,61),(8031,1,4,71),(8032,1,4,72),(8033,1,4,74),(8034,1,4,75),(8035,1,4,78),(8036,1,4,79),(8037,1,4,81),(8038,1,4,91),(8039,1,4,95),(8040,1,4,97),(8041,1,4,101),(8042,1,4,111),(8043,1,4,121),(8044,1,4,151),(8045,1,4,161),(8046,1,4,171),(8047,1,4,221),(8048,1,4,222),(8049,1,4,229),(8050,1,4,241),(8051,1,4,242),(8052,1,4,243),(8146,1,4,251),(8147,1,4,253),(8053,1,4,262),(8054,1,4,281),(8055,1,4,331),(8056,1,4,341),(8057,1,4,342),(8058,1,4,343),(8059,1,4,344),(8060,1,4,531),(8061,1,4,700),(8062,1,4,1001),(8063,1,4,1002),(8064,1,4,1003),(8065,1,4,1004),(8066,1,4,1005),(8067,1,4,1101),(8068,1,4,1181),(8069,1,4,1182),(8070,1,4,1201),(8071,1,4,1202),(8072,1,4,1231),(8073,1,4,2401),(8074,1,4,2501),(8075,1,4,2503),(8076,1,4,2515),(8077,1,4,20001),(8078,1,4,50101),(8079,1,4,101201),(8080,1,4,101261),(8081,1,4,102000),(8082,1,4,400051),(8083,1,4,400052),(8084,1,4,400053),(8085,1,4,400055),(12608,1,10,11),(12609,1,10,21),(12610,1,10,31),(12611,1,10,41),(12612,1,10,61),(12613,1,10,71),(12614,1,10,72),(12615,1,10,74),(12616,1,10,75),(12617,1,10,78),(12618,1,10,79),(12619,1,10,81),(12620,1,10,91),(12621,1,10,95),(12622,1,10,97),(12623,1,10,101),(12624,1,10,111),(12625,1,10,121),(12626,1,10,151),(12627,1,10,161),(12628,1,10,171),(12629,1,10,221),(12630,1,10,222),(12631,1,10,229),(12632,1,10,241),(12633,1,10,242),(12634,1,10,243),(12635,1,10,262),(12636,1,10,281),(12637,1,10,300),(12638,1,10,331),(12639,1,10,341),(12640,1,10,342),(12641,1,10,343),(12642,1,10,344),(12643,1,10,531),(12644,1,10,700),(12645,1,10,1001),(12646,1,10,1002),(12647,1,10,1003),(12648,1,10,1004),(12649,1,10,1005),(12650,1,10,1101),(12651,1,10,1181),(12652,1,10,1182),(12653,1,10,1201),(12654,1,10,1202),(12655,1,10,1231),(12656,1,10,2401),(12657,1,10,2501),(12658,1,10,2503),(12659,1,10,2515),(12660,1,10,20001),(12662,1,10,23001),(12663,1,10,50101),(12664,1,11,11),(12665,1,11,21),(12666,1,11,31),(12667,1,11,41),(12668,1,11,61),(12669,1,11,71),(12670,1,11,72),(12671,1,11,74),(12672,1,11,75),(12673,1,11,78),(12674,1,11,79),(12675,1,11,81),(12676,1,11,91),(12677,1,11,95),(12678,1,11,97),(12679,1,11,101),(12680,1,11,111),(12681,1,11,121),(12682,1,11,151),(12683,1,11,161),(12684,1,11,171),(12685,1,11,221),(12686,1,11,222),(12687,1,11,229),(12688,1,11,241),(12689,1,11,242),(12690,1,11,243),(12691,1,11,262),(12692,1,11,281),(12693,1,11,300),(12694,1,11,331),(12695,1,11,341),(12696,1,11,342),(12697,1,11,343),(12698,1,11,344),(12699,1,11,531),(12700,1,11,700),(12701,1,11,1001),(12702,1,11,1002),(12703,1,11,1003),(12704,1,11,1004),(12705,1,11,1005),(12706,1,11,1101),(12707,1,11,1181),(12708,1,11,1182),(12709,1,11,1201),(12710,1,11,1202),(12711,1,11,1231),(12712,1,11,2401),(12713,1,11,2501),(12714,1,11,2503),(12715,1,11,2515),(12716,1,11,20001),(12718,1,11,23001),(12719,1,11,50101),(20456,1,12,11),(20448,1,12,12),(20449,1,12,13),(20450,1,12,14),(20451,1,12,15),(20454,1,12,16),(20457,1,12,19),(14146,1,12,21),(14135,1,12,22),(14137,1,12,24),(14139,1,12,25),(14142,1,12,26),(14145,1,12,27),(14148,1,12,28),(14930,1,12,31),(14926,1,12,32),(14929,1,12,34),(14932,1,12,38),(13816,1,12,41),(13813,1,12,42),(13815,1,12,44),(13817,1,12,45),(14094,1,12,61),(14091,1,12,62),(14093,1,12,64),(14095,1,12,67),(14096,1,12,68),(16203,1,12,71),(16198,1,12,72),(16200,1,12,74),(16204,1,12,75),(16202,1,12,76),(16206,1,12,78),(16207,1,12,79),(20413,1,12,81),(20408,1,12,82),(20409,1,12,84),(20410,1,12,86),(20411,1,12,87),(20412,1,12,88),(20414,1,12,89),(15401,1,12,91),(15397,1,12,92),(15400,1,12,93),(15403,1,12,94),(13990,1,12,95),(12734,1,12,97),(19241,1,12,101),(19237,1,12,102),(19238,1,12,104),(19239,1,12,105),(19240,1,12,106),(19242,1,12,109),(20395,1,12,111),(20381,1,12,112),(20384,1,12,113),(20387,1,12,114),(20390,1,12,115),(20393,1,12,116),(20396,1,12,117),(20547,1,12,121),(20542,1,12,122),(20545,1,12,125),(20548,1,12,126),(13821,1,12,141),(13820,1,12,142),(13822,1,12,144),(13912,1,12,151),(13909,1,12,152),(13911,1,12,153),(13913,1,12,154),(14063,1,12,161),(14056,1,12,162),(14058,1,12,163),(14060,1,12,164),(14062,1,12,165),(14064,1,12,167),(13350,1,12,171),(13345,1,12,172),(13347,1,12,173),(13349,1,12,174),(13351,1,12,178),(13838,1,12,221),(13834,1,12,222),(13837,1,12,223),(13840,1,12,229),(13842,1,12,237),(13844,1,12,238),(13846,1,12,239),(13516,1,12,241),(13515,1,12,242),(13517,1,12,243),(20591,1,12,251),(20572,1,12,252),(20574,1,12,253),(20575,1,12,254),(20577,1,12,255),(20579,1,12,256),(20549,1,12,262),(20559,1,12,281),(20554,1,12,282),(20557,1,12,283),(20560,1,12,286),(19877,1,12,300),(20397,1,12,301),(20398,1,12,302),(16194,1,12,331),(16193,1,12,332),(16195,1,12,333),(20580,1,12,341),(20581,1,12,342),(20582,1,12,343),(20583,1,12,344),(20589,1,12,351),(20586,1,12,352),(20588,1,12,353),(20590,1,12,354),(20592,1,12,358),(19249,1,12,430),(16384,1,12,501),(16378,1,12,502),(13865,1,12,510),(20529,1,12,511),(20524,1,12,512),(20526,1,12,514),(20528,1,12,517),(20530,1,12,519),(15291,1,12,520),(15286,1,12,522),(15288,1,12,524),(15290,1,12,525),(15292,1,12,527),(20536,1,12,531),(20533,1,12,532),(20535,1,12,534),(20537,1,12,538),(20076,1,12,561),(20073,1,12,562),(20075,1,12,563),(20077,1,12,564),(16932,1,12,650),(20375,1,12,651),(20374,1,12,652),(20376,1,12,653),(17124,1,12,660),(20504,1,12,661),(20503,1,12,662),(20505,1,12,663),(13358,1,12,700),(20422,1,12,701),(20420,1,12,702),(20423,1,12,703),(20513,1,12,750),(20512,1,12,751),(20514,1,12,752),(20442,1,12,771),(20431,1,12,772),(20433,1,12,773),(15085,1,12,774),(20435,1,12,775),(20437,1,12,776),(20439,1,12,777),(20441,1,12,778),(20443,1,12,779),(14917,1,12,1001),(14916,1,12,1002),(14918,1,12,1003),(14920,1,12,1004),(14921,1,12,1005),(19247,1,12,1101),(19245,1,12,1102),(19246,1,12,1104),(19248,1,12,1109),(19233,1,12,1121),(19226,1,12,1122),(19228,1,12,1123),(19230,1,12,1124),(19232,1,12,1125),(19234,1,12,1126),(20460,1,12,1181),(20474,1,12,1182),(20463,1,12,1183),(20464,1,12,1184),(20466,1,12,1185),(20468,1,12,1186),(20470,1,12,1187),(20473,1,12,1188),(20471,1,12,1189),(20475,1,12,1191),(13827,1,12,1201),(13828,1,12,1202),(20483,1,12,1231),(20478,1,12,1232),(20479,1,12,1233),(20481,1,12,1234),(20482,1,12,1235),(20484,1,12,1236),(16302,1,12,1237),(13829,1,12,1251),(20458,1,12,1321),(20459,1,12,1322),(20415,1,12,1421),(20361,1,12,2401),(20359,1,12,2402),(20362,1,12,2403),(20369,1,12,2411),(20367,1,12,2412),(20370,1,12,2413),(20371,1,12,2414),(20427,1,12,2501),(20426,1,12,2503),(20428,1,12,2515),(20082,1,12,3200),(20341,1,12,3301),(15435,1,12,5001),(15436,1,12,5002),(20600,1,12,10001),(20595,1,12,10002),(20597,1,12,10003),(20599,1,12,10005),(20601,1,12,10008),(20496,1,12,20001),(20487,1,12,20002),(20489,1,12,20003),(20493,1,12,20004),(20495,1,12,20005),(20497,1,12,20006),(20491,1,12,20007),(20404,1,12,23001),(20401,1,12,23002),(20403,1,12,23003),(20405,1,12,23004),(19019,1,12,50101),(20568,1,12,50151),(20569,1,12,50152),(20570,1,12,50153),(20343,1,12,50401),(20351,1,12,50411),(20346,1,12,50412),(20348,1,12,50414),(20350,1,12,50415),(20352,1,12,50418),(20353,1,12,50420),(20354,1,12,50430),(20342,1,12,50440),(20507,1,12,55001),(20508,1,12,55002),(20566,1,12,56001),(20563,1,12,56002),(20565,1,12,56003),(20567,1,12,56004),(16742,1,12,56005),(20498,1,12,59001),(20499,1,12,59002),(20500,1,12,59003),(20520,1,12,63001),(20517,1,12,63002),(20519,1,12,63003),(20521,1,12,63004),(20509,1,12,64001),(17328,1,12,101130),(17327,1,12,101131),(17329,1,12,101132),(16009,1,12,101331),(16010,1,12,101332),(16011,1,12,101333),(19208,1,12,101701),(19209,1,12,101702),(20069,1,12,941601),(20065,1,12,941602),(20066,1,12,941603),(20067,1,12,941604),(20068,1,12,941605),(20070,1,12,941606),(12776,1,13,11),(12777,1,13,21),(12778,1,13,31),(12779,1,13,41),(12780,1,13,61),(12781,1,13,71),(12782,1,13,72),(12783,1,13,74),(12784,1,13,75),(12785,1,13,78),(12786,1,13,79),(12787,1,13,81),(12788,1,13,91),(12789,1,13,95),(12790,1,13,97),(12791,1,13,101),(12792,1,13,111),(12793,1,13,121),(12794,1,13,151),(12795,1,13,161),(12796,1,13,171),(12797,1,13,221),(12798,1,13,222),(12799,1,13,229),(12800,1,13,241),(12801,1,13,242),(12802,1,13,243),(12803,1,13,262),(12804,1,13,281),(12805,1,13,300),(12806,1,13,331),(12807,1,13,341),(12808,1,13,342),(12809,1,13,343),(12810,1,13,344),(12811,1,13,531),(12812,1,13,700),(12813,1,13,1001),(12814,1,13,1002),(12815,1,13,1003),(12816,1,13,1004),(12817,1,13,1005),(12818,1,13,1101),(12819,1,13,1181),(12820,1,13,1182),(12821,1,13,1201),(12822,1,13,1202),(12823,1,13,1231),(12824,1,13,2401),(12825,1,13,2501),(12826,1,13,2503),(12827,1,13,2515),(12828,1,13,20001),(12830,1,13,23001),(12831,1,13,50101),(12832,1,14,11),(12833,1,14,21),(12834,1,14,31),(12835,1,14,41),(12836,1,14,61),(12837,1,14,71),(12838,1,14,72),(12839,1,14,74),(12840,1,14,75),(12841,1,14,78),(12842,1,14,79),(12843,1,14,81),(12844,1,14,91),(12845,1,14,95),(12846,1,14,97),(12847,1,14,101),(12848,1,14,111),(12849,1,14,121),(12850,1,14,151),(12851,1,14,161),(12852,1,14,171),(12853,1,14,221),(12854,1,14,222),(12855,1,14,229),(12856,1,14,241),(12857,1,14,242),(12858,1,14,243),(12859,1,14,262),(12860,1,14,281),(12861,1,14,300),(12862,1,14,331),(12863,1,14,341),(12864,1,14,342),(12865,1,14,343),(12866,1,14,344),(12867,1,14,531),(12868,1,14,700),(12869,1,14,1001),(12870,1,14,1002),(12871,1,14,1003),(12872,1,14,1004),(12873,1,14,1005),(12874,1,14,1101),(12875,1,14,1181),(12876,1,14,1182),(12877,1,14,1201),(12878,1,14,1202),(12879,1,14,1231),(12880,1,14,2401),(12881,1,14,2501),(12882,1,14,2503),(12883,1,14,2515),(12884,1,14,20001),(12886,1,14,23001),(12887,1,14,50101),(12944,1,16,11),(12945,1,16,21),(12946,1,16,31),(13056,1,16,41),(13057,1,16,42),(13058,1,16,44),(13059,1,16,45),(12948,1,16,61),(12949,1,16,71),(12950,1,16,72),(12951,1,16,74),(12952,1,16,75),(12953,1,16,78),(12954,1,16,79),(12955,1,16,81),(12956,1,16,91),(12957,1,16,95),(12958,1,16,97),(12959,1,16,101),(12960,1,16,111),(12961,1,16,121),(13060,1,16,141),(13061,1,16,142),(13062,1,16,144),(12962,1,16,151),(12963,1,16,161),(12964,1,16,171),(12965,1,16,221),(12966,1,16,222),(12967,1,16,229),(12968,1,16,241),(12969,1,16,242),(12970,1,16,243),(13128,1,16,251),(13064,1,16,262),(12972,1,16,281),(12973,1,16,300),(12974,1,16,331),(12975,1,16,341),(12976,1,16,342),(12977,1,16,343),(12978,1,16,344),(12979,1,16,531),(12980,1,16,700),(12981,1,16,1001),(12982,1,16,1002),(12983,1,16,1003),(12984,1,16,1004),(12985,1,16,1005),(12986,1,16,1101),(12987,1,16,1181),(12988,1,16,1182),(12989,1,16,1201),(12990,1,16,1202),(12991,1,16,1231),(12992,1,16,2401),(12993,1,16,2501),(12994,1,16,2503),(12995,1,16,2515),(12996,1,16,20001),(12998,1,16,23001),(12999,1,16,50101),(13000,1,17,11),(13001,1,17,21),(13002,1,17,31),(13065,1,17,41),(13066,1,17,42),(13067,1,17,44),(13068,1,17,45),(13004,1,17,61),(13005,1,17,71),(13006,1,17,72),(13007,1,17,74),(13008,1,17,75),(13009,1,17,78),(13010,1,17,79),(13011,1,17,81),(13012,1,17,91),(13013,1,17,95),(13014,1,17,97),(13015,1,17,101),(13016,1,17,111),(13017,1,17,121),(13069,1,17,141),(13070,1,17,142),(13071,1,17,144),(13018,1,17,151),(13019,1,17,161),(13020,1,17,171),(13021,1,17,221),(13022,1,17,222),(13023,1,17,229),(13024,1,17,241),(13025,1,17,242),(13026,1,17,243),(13028,1,17,281),(13029,1,17,300),(13030,1,17,331),(13031,1,17,341),(13032,1,17,342),(13033,1,17,343),(13034,1,17,344),(13035,1,17,531),(13036,1,17,700),(13037,1,17,1001),(13038,1,17,1002),(13039,1,17,1003),(13040,1,17,1004),(13041,1,17,1005),(13042,1,17,1101),(13043,1,17,1181),(13044,1,17,1182),(13045,1,17,1201),(13046,1,17,1202),(13047,1,17,1231),(13048,1,17,2401),(13049,1,17,2501),(13050,1,17,2503),(13051,1,17,2515),(13052,1,17,20001),(13054,1,17,23001),(13055,1,17,50101),(14504,1,18,11),(14505,1,18,21),(14506,1,18,31),(14507,1,18,41),(14508,1,18,61),(14509,1,18,71),(14510,1,18,78),(14511,1,18,81),(14512,1,18,91),(14513,1,18,95),(14514,1,18,101),(14515,1,18,111),(14516,1,18,121),(14517,1,18,151),(14518,1,18,161),(14519,1,18,221),(14520,1,18,241),(14521,1,18,262),(14522,1,18,281),(14523,1,18,300),(14524,1,18,331),(14525,1,18,332),(14526,1,18,333),(14527,1,18,341),(14528,1,18,342),(14529,1,18,343),(14530,1,18,344),(14531,1,18,531),(14532,1,18,701),(14533,1,18,771),(14534,1,18,774),(14535,1,18,1001),(14536,1,18,1004),(14537,1,18,1101),(14538,1,18,1181),(14539,1,18,1182),(14540,1,18,1201),(14541,1,18,1231),(14542,1,18,2401),(14543,1,18,2501),(14544,1,18,2503),(14545,1,18,2515),(14546,1,18,20001),(14548,1,18,50101),(14549,1,18,59001),(15242,1,19,21),(15243,1,19,31),(15244,1,19,41),(15245,1,19,61),(15246,1,19,71),(15247,1,19,78),(15248,1,19,81),(15249,1,19,101),(15250,1,19,121),(15251,1,19,151),(15252,1,19,161),(15253,1,19,221),(15254,1,19,241),(15255,1,19,262),(15256,1,19,281),(15257,1,19,300),(15258,1,19,331),(15259,1,19,332),(15260,1,19,341),(15261,1,19,342),(15262,1,19,343),(15263,1,19,344),(15264,1,19,531),(15265,1,19,701),(15266,1,19,771),(15267,1,19,774),(15268,1,19,777),(15269,1,19,1001),(15270,1,19,1004),(15271,1,19,1101),(15272,1,19,1121),(15273,1,19,1181),(15274,1,19,1182),(15275,1,19,1201),(15276,1,19,1231),(15277,1,19,2401),(15278,1,19,2501),(15279,1,19,20001),(15281,1,19,50101),(15282,1,19,59001),(15283,1,19,63001); /*!40000 ALTER TABLE `llx_user_rights` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_user_twofactorauth_webauthn` --- - -DROP TABLE IF EXISTS `llx_user_twofactorauth_webauthn`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_user_twofactorauth_webauthn` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_user` int(11) NOT NULL, - `label` varchar(64) CHARACTER SET utf8mb4 NOT NULL, - `webauthnkey` text CHARACTER SET utf8mb4 NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT 0, - PRIMARY KEY (`rowid`), - UNIQUE KEY `idx_tfa_label_fk_user` (`fk_user`,`label`), - CONSTRAINT `fk_tfa_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_user_twofactorauth_webauthn` --- - -LOCK TABLES `llx_user_twofactorauth_webauthn` WRITE; -/*!40000 ALTER TABLE `llx_user_twofactorauth_webauthn` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_user_twofactorauth_webauthn` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_usergroup` -- @@ -13650,183 +12545,6 @@ INSERT INTO `llx_usergroup_user` VALUES (2,1,1,3),(12,1,2,4),(3,1,3,3),(4,1,11,2 /*!40000 ALTER TABLE `llx_usergroup_user` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `llx_webmail_draft` --- - -DROP TABLE IF EXISTS `llx_webmail_draft`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_webmail_draft` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `fk_user` int(11) NOT NULL DEFAULT 0, - `fk_contact` int(11) NOT NULL DEFAULT 0, - `size` int(11) NOT NULL DEFAULT 0, - `subject` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `body` longtext COLLATE utf8_unicode_ci NOT NULL, - `from` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `to` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `cc` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `bcc` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `files` int(11) NOT NULL DEFAULT 0, - `cron` datetime DEFAULT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_webmail_draft_fk_user` (`fk_user`), - KEY `idx_webmail_draft_cron` (`cron`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_webmail_draft` --- - -LOCK TABLES `llx_webmail_draft` WRITE; -/*!40000 ALTER TABLE `llx_webmail_draft` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_webmail_draft` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_webmail_files` --- - -DROP TABLE IF EXISTS `llx_webmail_files`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_webmail_files` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_mail` int(11) NOT NULL DEFAULT 0, - `fk_user` int(11) NOT NULL DEFAULT 0, - `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `file_name` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `file` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `file_size` int(11) NOT NULL DEFAULT 0, - `file_type` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `search` longtext COLLATE utf8_unicode_ci NOT NULL, - PRIMARY KEY (`rowid`), - KEY `idx_webmail_files_fk_user` (`fk_user`), - KEY `idx_webmail_files_files` (`fk_mail`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_webmail_files` --- - -LOCK TABLES `llx_webmail_files` WRITE; -/*!40000 ALTER TABLE `llx_webmail_files` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_webmail_files` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_webmail_mail` --- - -DROP TABLE IF EXISTS `llx_webmail_mail`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_webmail_mail` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `fk_user` int(11) NOT NULL DEFAULT 0, - `fk_soc` int(11) NOT NULL DEFAULT 0, - `fk_contact` int(11) NOT NULL DEFAULT 0, - `uidl` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - `size` int(11) NOT NULL DEFAULT 0, - `subject` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `body` longtext COLLATE utf8_unicode_ci NOT NULL, - `state_new` int(11) NOT NULL DEFAULT 0, - `state_reply` int(11) NOT NULL DEFAULT 0, - `state_forward` int(11) NOT NULL DEFAULT 0, - `state_wait` int(11) NOT NULL DEFAULT 0, - `state_spam` int(11) NOT NULL DEFAULT 0, - `id_correo` int(11) NOT NULL DEFAULT 0, - `is_outbox` int(11) NOT NULL DEFAULT 0, - `state_sent` int(11) NOT NULL DEFAULT 0, - `state_error` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', - `state_crt` int(11) NOT NULL DEFAULT 0, - `state_archiv` int(11) NOT NULL DEFAULT 0, - `priority` int(11) NOT NULL DEFAULT 0, - `sensitivity` int(11) NOT NULL DEFAULT 0, - `from` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `to` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `cc` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `bcc` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `files` int(11) NOT NULL DEFAULT 0, - `state_delete` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`rowid`), - KEY `idx_webmail_mail_nospam` (`fk_user`,`state_spam`), - KEY `idx_webmail_mail_count` (`fk_user`,`state_new`), - KEY `idx_webmail_mail_sendmail` (`is_outbox`,`state_sent`), - KEY `idx_webmail_mail_fk_user` (`fk_user`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_webmail_mail` --- - -LOCK TABLES `llx_webmail_mail` WRITE; -/*!40000 ALTER TABLE `llx_webmail_mail` DISABLE KEYS */; -INSERT INTO `llx_webmail_mail` VALUES (1,1,1,27,0,'1452254519','2018-01-08 16:01:59',0,'Submission of invoice 16','You will find here the invoice 16
\r\n
\r\nSincerely',0,0,0,0,0,0,1,1,'0',0,0,0,0,'first last ','Aljoun Samira ','','',1,0); -/*!40000 ALTER TABLE `llx_webmail_mail` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_webmail_users` --- - -DROP TABLE IF EXISTS `llx_webmail_users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_webmail_users` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `entity` int(11) NOT NULL DEFAULT 1, - `fk_user` int(11) NOT NULL, - `login` varchar(255) COLLATE utf8_unicode_ci NOT NULL, - `password` mediumtext COLLATE utf8_unicode_ci NOT NULL, - `safemail` tinyint(4) DEFAULT 1, - `dayssafe` int(11) DEFAULT 10, - PRIMARY KEY (`rowid`), - KEY `fk_webmail_users_fk_user` (`fk_user`), - CONSTRAINT `fk_webmail_users_fk_user` FOREIGN KEY (`fk_user`) REFERENCES `llx_user` (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_webmail_users` --- - -LOCK TABLES `llx_webmail_users` WRITE; -/*!40000 ALTER TABLE `llx_webmail_users` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_webmail_users` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `llx_webmail_users_view` --- - -DROP TABLE IF EXISTS `llx_webmail_users_view`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_webmail_users_view` ( - `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_user` int(11) NOT NULL, - `fk_user_view` int(11) NOT NULL, - PRIMARY KEY (`rowid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `llx_webmail_users_view` --- - -LOCK TABLES `llx_webmail_users_view` WRITE; -/*!40000 ALTER TABLE `llx_webmail_users_view` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_webmail_users_view` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `llx_website` -- @@ -13947,181 +12665,6 @@ INSERT INTO `llx_website_page` VALUES (1,5,'blog','','Blog','Blog','blog','
Laurent DESTAILLEUR
\r\n\r\n
\r\n
Project Director
\r\nldestailleur@example.com
\r\n\r\n
 
\r\n\r\n
\r\n
Facebook | Twitter | www.teclib.com
\r\n
\r\n
',0,NULL,1,1,10,10,NULL,'More information on http://www.mydomain.com','2019-10-04 10:06:40','2017-09-06 11:55:30',NULL,'',1,'ldestailleur_200x200.jpg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'007f7f','',NULL,0,0,NULL,NULL,NULL,NULL,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(19,'2017-02-02 03:55:44','2020-01-16 15:44:42',NULL,NULL,'aboston',1,NULL,NULL,NULL,1,0,NULL,'a7a77a5aff2d5fc2f75f2f61507c88d4',NULL,NULL,'Boston','Alex','',NULL,'','','','','aboston@example.com','','[]','Alex Boston
\r\nAdmin support service - 555 01 02 03 04',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',0,'person2.jpeg',NULL,NULL,12,NULL,NULL,25.00000000,'','','',NULL,NULL,'ff00ff','',NULL,0,0,2700.00000000,NULL,NULL,32.00000000,NULL,NULL,'2016-11-04 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL); -/*!40000 ALTER TABLE `tmp_user` ENABLE KEYS */; -UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; @@ -14409,4 +12773,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2021-04-15 16:01:49 +-- Dump completed on 2021-07-11 19:54:10 diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index 46053d1a187..252643afb59 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -5503,7 +5503,7 @@ CREATE TABLE `llx_product` ( LOCK TABLES `llx_product` WRITE; /*!40000 ALTER TABLE `llx_product` DISABLE KEYS */; -INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PIDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0); +INSERT INTO `llx_product` VALUES (1,'2010-07-08 14:33:17','2013-03-12 09:30:24',0,0,'PINKDRESS',1,NULL,'Pink dress','A beatifull pink dress','',NULL,NULL,100.00000000,112.50000000,90.00000000,101.25000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',20,NULL,0,'','',NULL,100,0,NULL,0,NULL,0,NULL,0,2,0.00000000,NULL,1,0,NULL,0),(2,'2010-07-09 00:30:01','2013-01-19 17:31:58',0,0,'Product_P1',1,NULL,'Product P1','','','',32,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,998,0.00000000,NULL,0,0,NULL,0),(3,'2010-07-09 00:30:25','2012-12-08 13:11:14',0,0,'Service_S1',1,NULL,'Service S1','','',NULL,NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,1,'1m',NULL,NULL,0,'','',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,0,0,NULL,0),(4,'2010-07-10 14:44:06','2013-01-19 17:22:48',0,0,'DECAP',1,NULL,'Decapsuleur','','',NULL,NULL,5.00000000,5.62500000,0.00000000,0.00000000,'HT',12.500,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,2,-3,NULL,0,NULL,0,NULL,0,1001,10.00000000,NULL,1,0,NULL,0),(5,'2011-07-20 23:11:38','2011-07-27 17:02:59',0,0,'aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(6,'2011-07-29 22:16:44','2011-07-29 20:16:44',0,0,'Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(7,'2011-07-29 22:31:21','2011-07-29 20:31:21',0,0,'Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(8,'2011-07-29 22:46:54','2011-07-29 20:46:54',0,0,'Copy_of_Copy_of_Copy_of_aaaa',1,NULL,'aaaa','cccc','bbbb','',NULL,10.00000000,11.96000000,0.00000000,0.00000000,'HT',19.600,0,0.000,0.000,1,0,0,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,NULL,0.00000000,'',1,0,NULL,0),(10,'2008-12-31 00:00:00','2012-12-08 13:11:14',0,0,'PR123456',1,NULL,'My product','This is a description example for record','Some note',NULL,NULL,100.00000000,110.00000000,0.00000000,0.00000000,'HT',10.000,0,0.000,0.000,NULL,0,0,0,'1y',0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0.00000000,NULL,NULL,0,'20110729232310',0),(11,'2013-01-13 20:24:42','2013-01-19 17:22:48',0,0,'gh',1,NULL,'hfghf','','','',NULL,0.00000000,0.00000000,0.00000000,0.00000000,'HT',0.000,0,0.000,0.000,1,1,1,0,'',NULL,NULL,0,'','',NULL,NULL,0,NULL,0,NULL,0,NULL,0,-1,0.00000000,'',1,0,NULL,0); /*!40000 ALTER TABLE `llx_product` ENABLE KEYS */; UNLOCK TABLES; diff --git a/dev/tools/spider.php b/dev/tools/spider.php new file mode 100644 index 00000000000..954978b24df --- /dev/null +++ b/dev/tools/spider.php @@ -0,0 +1,145 @@ +#!/usr/bin/env php +. + */ + +/** + * \file dev/tools/spider.php + * \brief Script to spider Dolibarr app. + * + * To use it: + * - Disable module "bookmark" + * - Exclude param optioncss, token, sortfield, sortorder + */ + +$crawledLinks=array(); +const MAX_DEPTH=2; + + +/** + * @param string $url URL + * @param string $depth Depth + * @return string String + */ +function followLink($url, $depth = 0) +{ + global $crawledLinks; + $crawling=array(); + if ($depth>MAX_DEPTH) { + echo "
The Crawler is giving up!
"; + return; + } + $options=array( + 'http'=>array( + 'method'=>"GET", + 'user-agent'=>"gfgBot/0.1\n" + ) + ); + $context=stream_context_create($options); + $doc=new DomDocument(); + @$doc->loadHTML(file_get_contents($url, false, $context)); + $links=$doc->getElementsByTagName('a'); + $pageTitle=getDocTitle($doc, $url); + $metaData=getDocMetaData($doc); + foreach ($links as $i) { + $link=$i->getAttribute('href'); + if (ignoreLink($link)) continue; + $link=convertLink($url, $link); + if (!in_array($link, $crawledLinks)) { + $crawledLinks[]=$link; + $crawling[]=$link; + insertIntoDatabase($link, $pageTitle, $metaData, $depth); + } + } + foreach ($crawling as $crawlURL) + followLink($crawlURL, $depth+1); +} + +/** + * @param string $site Site + * @param string $path Path + * @return string String + */ +function convertLink($site, $path) +{ + if (substr_compare($path, "//", 0, 2)==0) + return parse_url($site)['scheme'].$path; + elseif (substr_compare($path, "http://", 0, 7)==0 or + substr_compare($path, "https://", 0, 8)==0 or + substr_compare($path, "www.", 0, 4)==0) + return $path; + else return $site.'/'.$path; +} + +/** + * @param string $url URL + * @return boolean + */ +function ignoreLink($url) +{ + return $url[0]=="#" or substr($url, 0, 11) == "javascript:"; +} + +/** + * @param string $link URL + * @param string $title Title + * @param string $metaData Array + * @param int $depth Depth + * @return void + */ +function insertIntoDatabase($link, $title, &$metaData, $depth) +{ + //global $crawledLinks; + + echo "Inserting new record {URL= ".$link.", Title = '$title', Description = '".$metaData['description']."', Keywords = ' ".$metaData['keywords']."'}


"; + + //²$crawledLinks[]=$link; +} + +/** + * @param string $doc Doc + * @param string $url URL + * @return string URL/Title + */ +function getDocTitle(&$doc, $url) +{ + $titleNodes=$doc->getElementsByTagName('title'); + if (count($titleNodes)==0 or !isset($titleNodes[0]->nodeValue)) + return $url; + $title=str_replace('', '\n', $titleNodes[0]->nodeValue); + return (strlen($title)<1)?$url:$title; +} + +/** + * @param string $doc Doc + * @return array Array + */ +function getDocMetaData(&$doc) +{ + $metaData=array(); + $metaNodes=$doc->getElementsByTagName('meta'); + foreach ($metaNodes as $node) + $metaData[$node->getAttribute("name")] = $node->getAttribute("content"); + if (!isset($metaData['description'])) + $metaData['description']='No Description Available'; + if (!isset($metaData['keywords'])) $metaData['keywords']=''; + return array( + 'keywords'=>str_replace('', '\n', $metaData['keywords']), + 'description'=>str_replace('', '\n', $metaData['description']) + ); +} + + +followLink("http://localhost/dolibarr_dev/htdocs"); diff --git a/doc/images/README.md b/doc/images/README.md index 7422d246d40..e93c9f9c3d4 100644 --- a/doc/images/README.md +++ b/doc/images/README.md @@ -10,17 +10,16 @@ https://github.com/Dolibarr/foundation -* Few icons are / were from website led24.de -* Attention: This website is no longer available! +# LICENCE OF IMAGE RESOURCES +-------------------------------- -This is original README file for this source: -------------------------------------------------------- +* All image resources (except dolihelp.ico and doliadmin.ico) in this directory are distributed under licence CC BY-SA + +List of icons from http://led24.de/iconset/ are: +- doliadmin.ico +- dolihelp.ico + +This is original README file for the package with this 2 images: You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to http://led24.de/iconset/ or http://led24.de/ would be appreciated. - -Follow us on twitter http://twitter.com/gasyoun or email leds24@gmail.com -512 icons 20/05/2009 -------------------------------------------------------- -List of icons from http://led24.de/iconset/ are: -- dolihelp.ico diff --git a/doc/install/README b/doc/install/README index 0c7341b196c..0192ff27521 100644 --- a/doc/install/README +++ b/doc/install/README @@ -19,7 +19,7 @@ Download Install -------------------------------- -* For a Quick guide, take a look at README file into root directory. +* For a Quick guide, take a look at README.md file into root directory. * More complete documentations are also available on line on the Dolibarr Wiki: https://wiki.dolibarr.org diff --git a/doc/install/README-DE b/doc/install/README-DE index 047e1915d18..f4cb3c1a6f5 100644 --- a/doc/install/README-DE +++ b/doc/install/README-DE @@ -23,7 +23,7 @@ Download / Herunterladen Installation / Hilfe ------------------------------------ -* Für eine kurze Einleitung schau in die README Datei im Hauptverzeichnis. +* Für eine kurze Einleitung schau in die README.md Datei im Hauptverzeichnis. * Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden: https://wiki.dolibarr.org/index.php/Hauptseite diff --git a/doc/install/README-FR b/doc/install/README-FR index 5872ec0e3d1..c362316b39c 100644 --- a/doc/install/README-FR +++ b/doc/install/README-FR @@ -20,9 +20,7 @@ https://www.dolistore.com Documentation utilisateur -------------------------------- -* Pour une prise en main et installation rapide, consultez le fichier -README-FR à la racine. +* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine. -* Une documentation utilisateur francophone plus consistante est disponible en -ligne sur le wiki de Dolibarr à l'adresse: -https://wiki.dolibarr.org/index.php/Accueil +* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse: + https://wiki.dolibarr.org diff --git a/doc/user/README b/doc/user/README index 129dff11058..ecde765cde3 100644 --- a/doc/user/README +++ b/doc/user/README @@ -4,4 +4,5 @@ User guide -------------------------------- * All Dolibarr guides are available, on line, on the Dolibarr Web site: + https://www.dolibarr.org diff --git a/doc/user/README-DE.md b/doc/user/README-DE similarity index 99% rename from doc/user/README-DE.md rename to doc/user/README-DE index 4c7a635a522..336e7ab7085 100644 --- a/doc/user/README-DE.md +++ b/doc/user/README-DE @@ -7,9 +7,7 @@ Benutzeranleitung Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten: - https://www.dolibarr.de (de) oder https://www.dolibarr.org (intl) https://wiki.dolibarr.org/index.php/Hauptseite (de) - diff --git a/doc/user/README-FR b/doc/user/README-FR index fbf67fd89bc..f5cb72ea1c6 100644 --- a/doc/user/README-FR +++ b/doc/user/README-FR @@ -3,9 +3,6 @@ README (french) Documentation utilisateur -------------------------------- -* Pour une prise en main et installation rapide, consultez le fichier -README-FR à la racine. +La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse: -* Une documentation utilisateur francophone plus consistante est disponible en -ligne sur le site Web de Dolibarr à l'adresse: https://www.dolibarr.fr diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f0fd9702009..0f4d538cfac 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -609,10 +609,12 @@ if ($id) { print ''; if ($num) { + $i = 0; // Lines with values while ($i < $num) { $obj = $db->fetch_object($resql); //print_r($obj); + print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { print '
'; @@ -708,6 +710,7 @@ if ($id) { print "\n"; } + $i++; } } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index c5091ef4207..9a8a84893fe 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -444,7 +444,7 @@ if ($search_country_id > 0) { } else { $sql .= " WHERE "; } - $sql .= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)"; + $sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)"; } // If sort order is "country", we use country_code instead diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 24d31acddd6..f8c0c95d3c1 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -91,7 +91,6 @@ if ($action == 'update') { if (!$error) { foreach ($list as $constname) { $constvalue = GETPOST($constname, 'alpha'); - var_dump($constname); if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error++; } @@ -259,7 +258,7 @@ llxHeader('', $title); $linkback = ''; //$linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy'); +print load_fiche_titre($title, $linkback, 'accountancy'); print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 75283667fcb..b84fe255760 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -68,7 +68,9 @@ if ($search_accountancy_code_end == - 1) { $search_accountancy_code_end = ''; } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new BookKeeping($db); +$hookmanager->initHooks(array('balancelist')); // Note that conf->hooks_modules contains array $formaccounting = new FormAccounting($db); $formother = new FormOther($db); @@ -155,16 +157,23 @@ if (empty($user->rights->accounting->mouvements->lire)) { * Action */ -if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $show_subgroup = ''; - $search_date_start = ''; - $search_date_end = ''; - $search_accountancy_code_start = ''; - $search_accountancy_code_end = ''; - $search_ledger_code = array(); - $filter = array(); +$parameters = array('socid'=>$socid); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +if (empty($reshook)) { + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers + $show_subgroup = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_accountancy_code_start = ''; + $search_accountancy_code_end = ''; + $search_ledger_code = array(); + $filter = array(); + } +} /* * View @@ -183,11 +192,11 @@ if ($action == 'export_csv') { } foreach ($object->lines as $line) { - print length_accountg($line->numero_compte).$sep; - print $object->get_compte_desc($line->numero_compte).$sep; - print price($line->debit).$sep; - print price($line->credit).$sep; - print price($line->debit - $line->credit).$sep; + print '"'.length_accountg($line->numero_compte).'"'.$sep; + print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep; + print '"'.price($line->debit).'"'.$sep; + print '"'.price($line->credit).'"'.$sep; + print '"'.price($line->debit - $line->credit).'"'.$sep; print "\n"; } @@ -226,22 +235,28 @@ if ($action != 'export_csv') { print ''; print ''; - $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; - print ''; + '; + } print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit); + $selectedfields = ''; + $moreforfilter = ''; $moreforfilter .= '
'; @@ -283,12 +298,18 @@ if ($action != 'export_csv') { print ' '; print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, '', 'accounts'); print ''; - print ''; + + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields); + $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Action column + print ''; $searchpicto = $form->showFilterButtons(); print $searchpicto; print ''; - - print ''; + print ''."\n"; print ''; print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder); @@ -298,8 +319,14 @@ if ($action != 'export_csv') { print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" class="center"', $sortfield, $sortorder); - print "\n"; + + // Hook fields + $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + print ''."\n"; $total_debit = 0; $total_credit = 0; @@ -361,7 +388,7 @@ if ($action != 'export_csv') { } elseif (empty($tmparrayforrootaccount['label'])) { // $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent. // This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent. - // BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account. + // BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so should not show a link to create another account. // BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin. //$link = '' . img_edit_add() . ''; } @@ -374,14 +401,14 @@ if ($action != 'export_csv') { print ''; print ''.$langs->trans("SubTotal").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($sous_total_opening_balance).''; + print ''.price($sous_total_opening_balance).''; } - print ''.price($sous_total_debit).''; - print ''.price($sous_total_credit).''; + print ''.price($sous_total_debit).''; + print ''.price($sous_total_credit).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).''; + print ''.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).''; } else { - print ''.price(price2num($sous_total_debit - $sous_total_credit)).''; + print ''.price(price2num($sous_total_debit - $sous_total_credit)).''; } print "\n"; print ''; @@ -402,7 +429,7 @@ if ($action != 'export_csv') { print ''; print ''.$accounting_account.''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($opening_balance).''; + print ''.price($opening_balance).''; } $urlzoom = ''; @@ -416,14 +443,14 @@ if ($action != 'export_csv') { } } // Debit - print ''.price($line->debit).''; + print ''.price($line->debit).''; // Credit - print ''.price($line->credit).''; + print ''.price($line->credit).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).''; + print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).''; } else { - print ''.price(price2num($line->debit - $line->credit, 'MT')).''; + print ''.price(price2num($line->debit - $line->credit, 'MT')).''; } print ''; print $link; @@ -439,14 +466,14 @@ if ($action != 'export_csv') { if (!empty($show_subgroup)) { print ''.$langs->trans("SubTotal").':'; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print ''.price($sous_total_opening_balance).''; + print ''.price($sous_total_opening_balance).''; } - print ''.price($sous_total_debit).''; - print ''.price($sous_total_credit).''; + print ''.price($sous_total_debit).''; + print ''.price($sous_total_credit).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ''; + print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ''; } else { - print '' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . ''; + print '' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . ''; } print "\n"; print ''; @@ -456,12 +483,12 @@ if ($action != 'export_csv') { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { print ''.price($total_opening_balance).''; } - print ''.price($total_debit).''; - print ''.price($total_credit).''; + print ''.price($total_debit).''; + print ''.price($total_credit).''; if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { - print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ''; + print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ''; } else { - print '' . price(price2num($total_debit - $total_credit, 'MT')) . ''; + print '' . price(price2num($total_debit - $total_credit, 'MT')) . ''; } print "\n"; print ''; diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index f91b1821df4..c156a388735 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2017 Florian Henry - * Copyright (C) 2013-2018 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2018-2020 Frédéric France * @@ -537,6 +537,22 @@ if ($action == 'create') { print ''; print ''; + // Date document creation + print ''; + print ''.$langs->trans("DateExport").''; + print ''; + print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' '; + print ''; + print ''; + + // Date document creation + print ''; + print ''.$langs->trans("DateValidation").''; + print ''; + print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' '; + print ''; + print ''; + // Validate /* print ''; @@ -619,7 +635,11 @@ if ($action == 'create') { print_liste_field_titre("LabelOperation"); print_liste_field_titre("Debit", "", "", "", "", 'class="right"'); print_liste_field_titre("Credit", "", "", "", "", 'class="right"'); - print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + if (empty($object->date_validation)) { + print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"'); + } else { + print_liste_field_titre(""); + } print "\n"; @@ -662,21 +682,25 @@ if ($action == 'create') { } print ''; print ''.$line->label_operation.''; - print ''.price($line->debit).''; - print ''.price($line->credit).''; + print ''.price($line->debit).''; + print ''.price($line->credit).''; print ''; - print 'id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">'; - print img_edit('', 0, 'class="marginrightonly"'); - print '  '; - - $actiontodelete = 'delete'; - if ($mode == '_tmp' || $action != 'delmouv') { - $actiontodelete = 'confirm_delete'; + if (empty($line->date_export) && empty($line->date_validation)) { + print 'id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">'; + print img_edit('', 0, 'class="marginrightonly"'); + print '  '; } - print ''; - print img_delete(); + if (empty($line->date_validation)) { + $actiontodelete = 'delete'; + if ($mode == '_tmp' || $action != 'delmouv') { + $actiontodelete = 'confirm_delete'; + } + + print ''; + print img_delete(); + } print ''; print ''; @@ -691,32 +715,33 @@ if ($action == 'create') { setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings'); } - if ($action == "" || $action == 'add') { - print ''; - print ''; - print ''; - print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, ''); - print ''; - print ''; - // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: - // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. - // Also, it is not possible to use a value that is not in the list. - // Also, the label is not automatically filled when a value is selected. - if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { - print $formaccounting->select_auxaccount('', 'subledger_account', 1); - } else { - print ''; + if (empty($object->date_export) && empty($object->date_validation)) { + if ($action == "" || $action == 'add') { + print ''; + print ''; + print ''; + print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, ''); + print ''; + print ''; + // TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because: + // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. + // Also, it is not possible to use a value that is not in the list. + // Also, the label is not automatically filled when a value is selected. + if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + print $formaccounting->select_auxaccount('', 'subledger_account', 1); + } else { + print ''; + } + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; } - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; } - print ''; - if ($mode == '_tmp' && $action == '') { print '
'; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index a8a24e67d9d..bc260c77ed3 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2016 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2016-2017 Laurent Destailleur * Copyright (C) 2018-2021 Frédéric France * @@ -44,15 +44,47 @@ $action = GETPOST('action', 'aZ09'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int')); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int')); -$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int')); -$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int')); -$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int')); -$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int')); -$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int')); +$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); +$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); +$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); +$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); +$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); +$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); +$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); +$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); +$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); +$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); +$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); +$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); +$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); +$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); +$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); +$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); +$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); +$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); +$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); //var_dump($search_date_start);exit; if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { @@ -157,6 +189,7 @@ $arrayfields = array( 't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0), 't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -216,14 +249,46 @@ if (empty($reshook)) { $search_mvt_label = ''; $search_direction = ''; $search_ledger_code = array(); + $search_date_startyear = ''; + $search_date_startmonth = ''; + $search_date_startday = ''; + $search_date_endyear = ''; + $search_date_endmonth = ''; + $search_date_endday = ''; $search_date_start = ''; $search_date_end = ''; + $search_date_creation_startyear = ''; + $search_date_creation_startmonth = ''; + $search_date_creation_startday = ''; + $search_date_creation_endyear = ''; + $search_date_creation_endmonth = ''; + $search_date_creation_endday = ''; $search_date_creation_start = ''; $search_date_creation_end = ''; + $search_date_modification_startyear = ''; + $search_date_modification_startmonth = ''; + $search_date_modification_startday = ''; + $search_date_modification_endyear = ''; + $search_date_modification_endmonth = ''; + $search_date_modification_endday = ''; $search_date_modification_start = ''; $search_date_modification_end = ''; + $search_date_export_startyear = ''; + $search_date_export_startmonth = ''; + $search_date_export_startday = ''; + $search_date_export_endyear = ''; + $search_date_export_endmonth = ''; + $search_date_export_endday = ''; $search_date_export_start = ''; $search_date_export_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -301,32 +366,42 @@ if (empty($reshook)) { if (!empty($search_date_creation_start)) { $filter['t.date_creation>='] = $search_date_creation_start; $tmp = dol_getdate($search_date_creation_start); - $param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']); + $param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']); } if (!empty($search_date_creation_end)) { $filter['t.date_creation<='] = $search_date_creation_end; $tmp = dol_getdate($search_date_creation_end); - $param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']); + $param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']); } if (!empty($search_date_modification_start)) { $filter['t.tms>='] = $search_date_modification_start; $tmp = dol_getdate($search_date_modification_start); - $param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']); + $param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']); } if (!empty($search_date_modification_end)) { $filter['t.tms<='] = $search_date_modification_end; $tmp = dol_getdate($search_date_modification_end); - $param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']); + $param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']); } if (!empty($search_date_export_start)) { $filter['t.date_export>='] = $search_date_export_start; $tmp = dol_getdate($search_date_export_start); - $param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']); + $param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']); } if (!empty($search_date_export_end)) { $filter['t.date_export<='] = $search_date_export_end; $tmp = dol_getdate($search_date_export_end); - $param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']); + $param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $tmp = dol_getdate($search_date_validation_start); + $param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']); + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $tmp = dol_getdate($search_date_validation_end); + $param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']); } if (!empty($search_debit)) { $filter['t.debit'] = $search_debit; @@ -447,7 +522,8 @@ $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; $sql .= " t.tms as date_modification,"; -$sql .= " t.date_export"; +$sql .= " t.date_export,"; +$sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t'; // Manage filter $sqlwhere = array(); @@ -471,6 +547,8 @@ if (count($filter) > 0) { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { @@ -498,7 +576,7 @@ if (!empty($sortfield)) { // Export into a file with format defined into setup (FEC, CSV, ...) // Must be after definition of $sql if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) { - // TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them. + // TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them. $result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1)); if ($result < 0) { @@ -508,10 +586,13 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex $accountancyexport = new AccountancyExport($db); $accountancyexport->export($object->lines, $formatexportset); + $notifiedexportdate = GETPOST('notifiedexportdate', 'alpha'); + $notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha'); + if (!empty($accountancyexport->errors)) { setEventMessages('', $accountancyexport->errors, 'errors'); - } else { - // Specify as export : update field date_export + } elseif (!$notifiedexportdate || !$notifiedvalidationdate) { + // Specify as export : update field date_export or date_validated $error = 0; $db->begin(); @@ -520,8 +601,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex $now = dol_now(); $sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping"; - $sql .= " SET date_export = '".$db->idate($now)."'"; - $sql .= " , date_validated = '".$db->idate($now)."'"; + $sql .= " SET"; + if (!$notifiedexportdate && !$notifiedvalidationdate) { + $sql .= " date_export = '".$db->idate($now)."'"; + $sql .= ", date_validated = '".$db->idate($now)."'"; + } elseif (!$notifiedexportdate) { + $sql .= " date_export = '".$db->idate($now)."'"; + } elseif (!$notifiedvalidationdate) { + $sql .= " date_validated = '".$db->idate($now)."'"; + } $sql .= " WHERE rowid = ".((int) $movement->id); dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG); @@ -535,11 +623,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex if (!$error) { $db->commit(); - // setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs'); + // setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs'); } else { $error++; $db->rollback(); - setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors'); + setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors'); } } exit; @@ -587,6 +675,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { llxHeader('', $title_page); +$formconfirm = ''; + if ($action == 'export_file') { $form_question = array(); @@ -598,17 +688,15 @@ if ($action == 'export_file') { ); $form_question['notifiedvalidationdate'] = array( 'name' => 'notifiedvalidationdate', - 'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component + 'type' => 'checkbox', 'label' => $langs->trans('NotifiedValidationDate'), 'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'), ); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300); - print $formconfirm; + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600); } if ($action == 'delmouv') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1); - print $formconfirm; } if ($action == 'delbookkeepingyear') { $form_question = array(); @@ -648,9 +736,11 @@ if ($action == 'delbookkeepingyear') { ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300); - print $formconfirm; } +// Print form confirm +print $formconfirm; + //$param=''; param started before if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { $param .= '&contextpage='.urlencode($contextpage); @@ -669,6 +759,8 @@ print ''; print ''; +$massactionbutton = ''; + if (count($filter)) { $buttonLabel = $langs->trans("ExportFilteredList"); } else { @@ -701,7 +793,7 @@ if (empty($reshook)) { $newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer); } -print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1); $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields @@ -730,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) { // Code journal if (!empty($arrayfields['t.code_journal']['checked'])) { print ''; - print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1); + print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150'); print ''; } // Date document @@ -773,7 +865,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) { print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount'); print '
'; } else { - print ''; + print ''; } print ''; } @@ -812,10 +904,10 @@ print $hookmanager->resPrint; if (!empty($arrayfields['t.date_creation']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } @@ -823,10 +915,10 @@ if (!empty($arrayfields['t.date_creation']['checked'])) { if (!empty($arrayfields['t.tms']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print ''; } @@ -834,10 +926,21 @@ if (!empty($arrayfields['t.tms']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print '
'; - print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; } @@ -892,6 +995,9 @@ if (!empty($arrayfields['t.tms']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print "\n"; @@ -934,6 +1040,7 @@ while ($i < min($num, $limit)) { $line->date_creation = $db->jdate($obj->date_creation); $line->date_modification = $db->jdate($obj->date_modification); $line->date_export = $db->jdate($obj->date_export); + $line->date_validation = $db->jdate($obj->date_validation); $total_debit += $line->debit; $total_credit += $line->credit; @@ -1067,7 +1174,7 @@ while ($i < min($num, $limit)) { // Amount debit if (!empty($arrayfields['t.debit']['checked'])) { - print ''.($line->debit != 0 ? price($line->debit) : '').''; + print ''.($line->debit != 0 ? price($line->debit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -1079,7 +1186,7 @@ while ($i < min($num, $limit)) { // Amount credit if (!empty($arrayfields['t.credit']['checked'])) { - print ''.($line->credit != 0 ? price($line->credit) : '').''; + print ''.($line->credit != 0 ? price($line->credit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -1126,12 +1233,22 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { print ''.img_delete().''; } diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 406664938cc..27f23d36a74 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro + * Copyright (C) 2013-2021 Alexandre Spangaro * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); $search_date_export_endday = GETPOST('search_date_export_endday', 'int'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); -$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_accountancy_code = GETPOST("search_accountancy_code"); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -81,7 +89,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_ } // Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -144,6 +152,7 @@ $arrayfields = array( 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -221,6 +230,14 @@ if (empty($reshook)) { $search_date_export_endyear = ''; $search_date_export_endmonth = ''; $search_date_export_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -301,6 +318,14 @@ if (empty($reshook)) { $filter['t.date_export<='] = $search_date_export_end; $param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear; } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear; + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear; + } } if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { @@ -484,10 +509,9 @@ $moreforfilter = ''; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('AccountAccounting').': '; $moreforfilter .= '
'; -$moreforfilter .= $langs->trans('From').' '; -$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200'); -$moreforfilter .= ' '.$langs->trans('to').' '; -$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200'); +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200'); +$moreforfilter .= ' '; +$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200'); $moreforfilter .= '
'; $moreforfilter .= '
'; @@ -564,6 +588,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print ''; } +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -605,6 +640,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -632,20 +670,19 @@ while ($i < min($num, $limit)) { $accountg = length_accountg($line->numero_compte); //if (empty($accountg)) $accountg = '-'; + $colspan = 0; // colspan before field 'label of operation' + $colspanend = 3; // colspan after debit/credit + if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; } + if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; } + if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; } + // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - $colnumber = 5; - $colnumberend = 7; - - if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { - $colnumber--; - } - if (empty($arrayfields['t.date_export']['checked'])) { - $colnumber--; - } - - $colspan = $totalarray['nbfield'] - $colnumber; - $colspanend = $totalarray['nbfield'] - $colnumberend; // Show a subtotal by accounting account if (isset($displayed_account_number)) { print ''; @@ -807,7 +844,7 @@ while ($i < min($num, $limit)) { // Amount debit if (!empty($arrayfields['t.debit']['checked'])) { - print ''.($line->debit ? price($line->debit) : '').''; + print ''.($line->debit ? price($line->debit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -819,7 +856,7 @@ while ($i < min($num, $limit)) { // Amount credit if (!empty($arrayfields['t.credit']['checked'])) { - print ''.($line->credit ? price($line->credit) : '').''; + print ''.($line->credit ? price($line->credit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -845,6 +882,14 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook @@ -852,12 +897,14 @@ while ($i < min($num, $limit)) { // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print '   '.img_delete().''; + print ''.img_delete().''; } } print ''; @@ -874,9 +921,7 @@ while ($i < min($num, $limit)) { $i++; } -if ($num > 0) { - $colspan = $totalarray['nbfield'] - $colnumber; - $colspanend = $totalarray['nbfield'] - $colnumberend; +if ($num > 0 && $colspan > 0) { print ''; print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; print ''.price($sous_total_debit).''; diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 129e695de3c..5e83c729fb1 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -2,8 +2,8 @@ /* Copyright (C) 2016 Neil Orley * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2020 Florian Henry - * Copyright (C) 2013-2020 Alexandre Spangaro - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int'); $search_date_endmonth = GETPOST('search_date_endmonth', 'int'); $search_date_endday = GETPOST('search_date_endday', 'int'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); -$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); $search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); $search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); @@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); $search_date_export_endday = GETPOST('search_date_export_endday', 'int'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); -$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); +$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); +$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); +$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); +$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); +$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); +$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); +$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_accountancy_code = GETPOST("search_accountancy_code"); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -144,6 +152,7 @@ $arrayfields = array( 't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1), 't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1), 't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1), + 't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1), ); if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { @@ -221,6 +230,14 @@ if (empty($reshook)) { $search_date_export_endyear = ''; $search_date_export_endmonth = ''; $search_date_export_endday = ''; + $search_date_validation_start = ''; + $search_date_validation_end = ''; + $search_date_validation_startyear = ''; + $search_date_validation_startmonth = ''; + $search_date_validation_startday = ''; + $search_date_validation_endyear = ''; + $search_date_validation_endmonth = ''; + $search_date_validation_endday = ''; $search_debit = ''; $search_credit = ''; $search_lettering_code = ''; @@ -301,6 +318,14 @@ if (empty($reshook)) { $filter['t.date_export<='] = $search_date_export_end; $param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear; } + if (!empty($search_date_validation_start)) { + $filter['t.date_validated>='] = $search_date_validation_start; + $param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear; + } + if (!empty($search_date_validation_end)) { + $filter['t.date_validated<='] = $search_date_validation_end; + $param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear; + } } if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) { @@ -373,7 +398,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou llxHeader('', $title_page); - // List $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { @@ -448,7 +472,6 @@ print ''; print ''; - $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { @@ -488,10 +511,9 @@ $moreforfilter = ''; $moreforfilter .= '
'; $moreforfilter .= $langs->trans('AccountAccounting').': '; $moreforfilter .= '
'; -$moreforfilter .= $langs->trans('From').' '; -$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200'); -$moreforfilter .= ' '.$langs->trans('to').' '; -$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200'); +$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200'); +$moreforfilter .= ' '; +$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200'); $moreforfilter .= '
'; $moreforfilter .= '
'; @@ -568,6 +590,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) { print ''; print ''; } +// Date validation +if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''; + print '
'; + print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print '
'; + print '
'; + print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print '
'; + print ''; +} // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -609,6 +642,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) { if (!empty($arrayfields['t.date_export']['checked'])) { print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center '); } +if (!empty($arrayfields['t.date_validated']['checked'])) { + print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center '); +} // Hook fields $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook @@ -636,21 +672,19 @@ while ($i < min($num, $limit)) { $accountg = length_accounta($line->subledger_account); //if (empty($accountg)) $accountg = '-'; + $colspan = 0; // colspan before field 'label of operation' + $colspanend = 3; // colspan after debit/credit + if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; } + if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; } + if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; } + if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; } + // Is it a break ? if ($accountg != $displayed_account_number || !isset($displayed_account_number)) { - $colnumber = 5; - $colnumberend = 7; - - if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) { - $colnumber--; - } - if (empty($arrayfields['t.date_export']['checked'])) { - $colnumber--; - } - - $colspan = $totalarray['nbfield'] - $colnumber; - $colspanend = $totalarray['nbfield'] - $colnumberend; - // Show a subtotal by accounting account if (isset($displayed_account_number)) { print ''; @@ -682,7 +716,7 @@ while ($i < min($num, $limit)) { print ""; print ''; if ($line->subledger_account != "" && $line->subledger_account != '-1') { - print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account); + print $line->subledger_label.' : '.length_accounta($line->subledger_account); } else { // Should not happen: subledger account must be null or a non empty value print ''.$langs->trans("Unknown"); @@ -821,7 +855,7 @@ while ($i < min($num, $limit)) { // Amount debit if (!empty($arrayfields['t.debit']['checked'])) { - print ''.($line->debit ? price($line->debit) : '').''; + print ''.($line->debit ? price($line->debit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -833,7 +867,7 @@ while ($i < min($num, $limit)) { // Amount credit if (!empty($arrayfields['t.credit']['checked'])) { - print ''.($line->credit ? price($line->credit) : '').''; + print ''.($line->credit ? price($line->credit) : '').''; if (!$i) { $totalarray['nbfield']++; } @@ -859,6 +893,14 @@ while ($i < min($num, $limit)) { } } + // Validated operation date + if (!empty($arrayfields['t.date_validated']['checked'])) { + print ''.dol_print_date($line->date_validation, 'dayhour').''; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook @@ -866,12 +908,14 @@ while ($i < min($num, $limit)) { // Action column print ''; - if (empty($line->date_export)) { + if (empty($line->date_export) && empty($line->date_validation)) { if ($user->rights->accounting->mouvements->creer) { - print ''.img_edit().''; + print '' . img_edit() . ''; } + } + if (empty($line->date_validation)) { if ($user->rights->accounting->mouvements->supprimer) { - print '   '.img_delete().''; + print ''.img_delete().''; } } print ''; @@ -888,9 +932,7 @@ while ($i < min($num, $limit)) { $i++; } -if ($num > 0) { - $colspan = $totalarray['nbfield'] - $colnumber; - $colspanend = $totalarray['nbfield'] - $colnumberend; +if ($num > 0 && $colspan > 0) { print ''; print ''.$langs->trans("TotalForAccount").' '.$accountg.':'; print ''.price($sous_total_debit).''; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 8669cae7c2f..29a0171fe08 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -296,15 +296,15 @@ if ($resql) { print ''; print ''.$langs->trans("Total").':'."\n"; - print ''.price($debit).''; - print ''.price($credit).''; + print ''.price($debit).''; + print ''.price($credit).''; print ''; print "\n"; print ''; print ''.$langs->trans("Balancing").':'."\n"; print ' '; - print ''.price($credit - $debit).''; + print ''.price($credit - $debit).''; print ''; print "\n"; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index a73f711e15a..d62a1e9fc25 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -293,15 +293,15 @@ if ($resql) { print ''; print ''.$langs->trans("Total").':'."\n"; - print ''.price($debit).''; - print ''.price($credit).''; + print ''.price($debit).''; + print ''.price($credit).''; print ''; print "\n"; print ''; print ''.$langs->trans("Balancing").':'."\n"; print ' '; - print ''.price($credit - $debit).''; + print ''.price($credit - $debit).''; print ''; print "\n"; diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index d8e1598d1ac..77d10516daa 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -201,7 +201,7 @@ class AccountancyCategory // extends CommonObject $sql .= "entity"; $sql .= ") VALUES ("; if ($this->rowid > 0) { - $sql .= " ".$this->rowid.","; + $sql .= " ".((int) $this->rowid).","; } $sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").","; $sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").","; @@ -209,9 +209,9 @@ class AccountancyCategory // extends CommonObject $sql .= " ".(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").","; $sql .= " ".(!isset($this->category_type) ? 'NULL' : "'".$this->db->escape($this->category_type)."'").","; $sql .= " ".(!isset($this->formula) ? 'NULL' : "'".$this->db->escape($this->formula)."'").","; - $sql .= " ".(!isset($this->position) ? 'NULL' : $this->db->escape($this->position)).","; - $sql .= " ".(!isset($this->fk_country) ? 'NULL' : $this->db->escape($this->fk_country)).","; - $sql .= " ".(!isset($this->active) ? 'NULL' : $this->db->escape($this->active)); + $sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).","; + $sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).","; + $sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active)); $sql .= ", ".$conf->entity; $sql .= ")"; @@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject if ($id) { $sql .= " WHERE t.rowid = ".((int) $id); } else { - $sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid + $sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid if ($code) { $sql .= " AND t.code = '".$this->db->escape($code)."'"; } elseif ($label) { @@ -675,7 +675,7 @@ class AccountancyCategory // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; $sql .= " WHERE c.active = 1"; $sql .= " AND c.entity = ".$conf->entity; - $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; + $sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)"; $sql .= " AND cat.rowid = t.fk_accounting_category"; $sql .= " AND t.entity = ".$conf->entity; $sql .= " ORDER BY cat.position ASC"; @@ -806,7 +806,7 @@ class AccountancyCategory // extends CommonObject if ($categorytype >= 0) { $sql .= " AND c.category_type = 1"; } - $sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)"; + $sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)"; $sql .= " ORDER BY c.position ASC"; $resql = $this->db->query($sql); diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index f1815386624..c8aa1407ddb 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Pierre-Henry Favre - * Copyright (C) 2016-2020 Alexandre Spangaro + * Copyright (C) 2016-2021 Alexandre Spangaro * Copyright (C) 2013-2017 Olivier Geffroy * Copyright (C) 2017 Elarifr. Ari Elbaz * Copyright (C) 2017-2019 Frédéric France @@ -59,6 +59,8 @@ class AccountancyExport public static $EXPORT_TYPE_LDCOMPTA10 = 120; public static $EXPORT_TYPE_GESTIMUMV3 = 130; public static $EXPORT_TYPE_GESTIMUMV5 = 135; + public static $EXPORT_TYPE_ISUITEEXPERT = 200; + // Generic FEC after that public static $EXPORT_TYPE_FEC = 1000; public static $EXPORT_TYPE_FEC2 = 1010; @@ -123,6 +125,7 @@ class AccountancyExport self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'), self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'), self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'), + self::$EXPORT_TYPE_ISUITEEXPERT => 'Export iSuite Expert', ); ksort($listofexporttypes, SORT_NUMERIC); @@ -158,6 +161,7 @@ class AccountancyExport self::$EXPORT_TYPE_GESTIMUMV5 => 'gestimumv5', self::$EXPORT_TYPE_FEC => 'fec', self::$EXPORT_TYPE_FEC2 => 'fec2', + self::$EXPORT_TYPE_ISUITEEXPERT => 'isuiteexpert', ); return $formatcode[$type]; @@ -243,6 +247,10 @@ class AccountancyExport 'label' => $langs->trans('Modelcsv_FEC2'), 'ACCOUNTING_EXPORT_FORMAT' => 'txt', ), + self::$EXPORT_TYPE_ISUITEEXPERT => array( + 'label' => 'iSuite Expert', + 'ACCOUNTING_EXPORT_FORMAT' => 'csv', + ), ), 'cr'=> array( '1' => $langs->trans("Unix"), @@ -334,6 +342,9 @@ class AccountancyExport case self::$EXPORT_TYPE_FEC2: $this->exportFEC2($TData); break; + case self::$EXPORT_TYPE_ISUITEEXPERT : + $this->exportiSuiteExpert($TData); + break; default: $this->errors[] = $langs->trans('accountancy_error_modelnotfound'); break; @@ -466,34 +477,43 @@ class AccountancyExport } /** - * Export format : CIEL + * Export format : CIEL (Format XIMPORT) + * Format since 2003 compatible CIEL version > 2002 / Sage50 + * Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr) + * + * Help : https://sage50c.online-help.sage.fr/aide-technique/ + * In sage software | Use menu : "Exchange" > "Importing entries..." + * + * If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory : + * use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME * * @param array $TData data * @return void */ public function exportCiel(&$TData) { - global $conf; - $end_line = "\r\n"; $i = 1; - $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd + foreach ($TData as $data) { - $code_compta = $data->numero_compte; + $code_compta = length_accountg($data->numero_compte); if (!empty($data->subledger_account)) { - $code_compta = $data->subledger_account; + $code_compta = length_accounta($data->subledger_account); } + $date_document = dol_print_date($data->doc_date, '%Y%m%d'); + $date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d'); + $Tab = array(); - $Tab['num_ecriture'] = str_pad($i, 5); + $Tab['num_ecriture'] = str_pad($data->piece_num, 5); $Tab['code_journal'] = str_pad($data->code_journal, 2); - $Tab['date_ecriture'] = $date_ecriture; - $Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12); + $Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT); + $Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT); + $Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12); $Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11); $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25); - $Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT); + $Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT); $Tab['type_montant'] = str_pad($data->sens, 1); $Tab['vide'] = str_repeat(' ', 18); $Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34); @@ -561,9 +581,9 @@ class AccountancyExport $Tab['contrepartie'] = str_repeat(' ', 8); // Force date format : %d%m%y - if (!empty($data->date_echeance)) { - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // Format must be ddmmyy + if (!empty($data->date_lim_reglement)) { + //$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy } else { $Tab['date_echeance'] = '000000'; } @@ -660,9 +680,9 @@ class AccountancyExport $Tab['code_stat'] = str_repeat(' ', 4); - if (!empty($data->date_echeance)) { - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y'); + if (!empty($data->date_lim_reglement)) { + //$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE); + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y'); } else { $Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y'); } @@ -1752,6 +1772,62 @@ class AccountancyExport } } + /** + * Export format : iSuite Expert + * + * by OpenSolus [https://opensolus.fr] + * + * @param array $objectLines data + * + * @return void + */ + public function exportiSuiteExpert($objectLines) + { + $this->separator = ';'; + $this->end_line = "\r\n"; + + + foreach ($objectLines as $line) { + $tab = array(); + + $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + + $tab[] = $line->piece_num; + $tab[] = $date; + $tab[] = substr($date, 6, 4); + $tab[] = substr($date, 3, 2); + $tab[] = substr($date, 0, 2); + $tab[] = $line->doc_ref; + //Conversion de chaine UTF8 en Latin9 + $tab[] = mb_convert_encoding(str_replace(' - Compte auxiliaire', '', $line->label_operation), "Windows-1252", 'UTF-8'); + + //Calcul de la longueur des numéros de comptes + $taille_numero = strlen(length_accountg($line->numero_compte)); + + //Création du numéro de client générique + $numero_cpt_client = '411'; + for ($i = 1; $i <= ($taille_numero - 3); $i++) { + $numero_cpt_client .= '0'; + } + + //Création des comptes auxiliaire des clients + if (length_accountg($line->numero_compte) == $numero_cpt_client) { + $tab[] = rtrim(length_accounta($line->subledger_account), "0"); + } else { + $tab[] = length_accountg($line->numero_compte); + } + $nom_client = explode(" - ", $line->label_operation); + $tab[] = mb_convert_encoding($nom_client[0], "Windows-1252", 'UTF-8'); + $tab[] = price($line->debit); + $tab[] = price($line->credit); + $tab[] = price($line->montant); + $tab[] = $line->code_journal; + + $separator = $this->separator; + print implode($separator, $tab) . $this->end_line; + } + } + /** * trunc * diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 28601380ac1..99a0dc0dc48 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -602,7 +602,7 @@ class AccountingAccount extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account "; $sql .= "SET ".$fieldtouse." = '0'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql .= " WHERE rowid = ".((int) $id); dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); @@ -640,7 +640,7 @@ class AccountingAccount extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account"; $sql .= " SET ".$fieldtouse." = '1'"; - $sql .= " WHERE rowid = ".$this->db->escape($id); + $sql .= " WHERE rowid = ".((int) $id); dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 3594bb26fc8..aeaa42154d8 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -294,14 +294,14 @@ class BookKeeping extends CommonObject $sql = "SELECT count(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; - $sql .= " AND fk_doc = ".$this->fk_doc; + $sql .= " AND fk_doc = ".((int) $this->fk_doc); if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) { // DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries. - $sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines + $sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines } $sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'"; $sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'"; - $sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features + $sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features $resql = $this->db->query($sql); @@ -312,13 +312,13 @@ class BookKeeping extends CommonObject $sqlnum = "SELECT piece_num"; $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank' - $sqlnum .= " AND fk_doc = ".$this->fk_doc; + $sqlnum .= " AND fk_doc = ".((int) $this->fk_doc); if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) { // fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ... $sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet); } $sqlnum .= " AND doc_ref = '".$this->db->escape($this->doc_ref)."'"; // ref of source object - $sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features + $sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features dol_syslog(get_class($this).":: create sqlnum=".$sqlnum, LOG_DEBUG); $resqlnum = $this->db->query($sqlnum); @@ -331,7 +331,7 @@ class BookKeeping extends CommonObject if (empty($this->piece_num)) { $sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum"; $sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element; - $sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features + $sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features $resqlnum = $this->db->query($sqlnum); if ($resqlnum) { @@ -728,7 +728,9 @@ class BookKeeping extends CommonObject $sql .= " t.code_journal,"; $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; - $sql .= " t.date_creation"; + $sql .= " t.date_creation,"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t'; $sql .= ' WHERE 1 = 1'; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -769,6 +771,9 @@ class BookKeeping extends CommonObject $this->journal_label = $obj->journal_label; $this->piece_num = $obj->piece_num; $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_export = $this->db->jdate($obj->date_export); + $this->date_validation = $this->db->jdate($obj->date_validated); + $this->date_validation = $this->db->jdate($obj->date_validation); } $this->db->free($resql); @@ -834,7 +839,8 @@ class BookKeeping extends CommonObject $sql .= " t.journal_label,"; $sql .= " t.piece_num,"; $sql .= " t.date_creation,"; - $sql .= " t.date_export"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; // Manage filter $sqlwhere = array(); if (count($filter) > 0) { @@ -853,6 +859,8 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } elseif ($key == 't.reconciled_option') { @@ -926,6 +934,8 @@ class BookKeeping extends CommonObject $line->piece_num = $obj->piece_num; $line->date_creation = $this->db->jdate($obj->date_creation); $line->date_export = $this->db->jdate($obj->date_export); + $line->date_validation = $this->db->jdate($obj->date_validated); + $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -987,7 +997,8 @@ class BookKeeping extends CommonObject $sql .= " t.date_creation,"; $sql .= " t.date_lim_reglement,"; $sql .= " t.tms as date_modification,"; - $sql .= " t.date_export"; + $sql .= " t.date_export,"; + $sql .= " t.date_validated as date_validation"; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; // Manage filter $sqlwhere = array(); @@ -1009,6 +1020,8 @@ class BookKeeping extends CommonObject $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.date_export>=' || $key == 't.date_export<=') { $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; + } elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') { + $sqlwhere[] = $key.'\''.$this->db->idate($value).'\''; } elseif ($key == 't.credit' || $key == 't.debit') { $sqlwhere[] = natural_search($key, $value, 1, 1); } else { @@ -1054,7 +1067,7 @@ class BookKeeping extends CommonObject $line->label_operation = $obj->label_operation; $line->debit = $obj->debit; $line->credit = $obj->credit; - $line->montant = $obj->amount; // deprecated + $line->montant = $obj->amount; // deprecated $line->amount = $obj->amount; $line->sens = $obj->sens; $line->lettering_code = $obj->lettering_code; @@ -1068,6 +1081,8 @@ class BookKeeping extends CommonObject $line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $line->date_modification = $this->db->jdate($obj->date_modification); $line->date_export = $this->db->jdate($obj->date_export); + $line->date_validation = $this->db->jdate($obj->date_validated); + $line->date_validation = $this->db->jdate($obj->date_validation); $this->lines[] = $line; @@ -1454,6 +1469,8 @@ class BookKeeping extends CommonObject $sql .= " AND code_journal = '".$this->db->escape($journal)."'"; } $sql .= " AND entity IN (".getEntity('accountancy').")"; + // Exclusion of validated entries at the time of deletion + $sql .= " AND date_validated IS NULL"; // TODO: In a future we must forbid deletion if record is inside a closed fiscal period. @@ -1489,6 +1506,7 @@ class BookKeeping extends CommonObject $sql = "DELETE"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE piece_num = ".(int) $piecenum; + $sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion $sql .= " AND entity IN (".getEntity('accountancy').")"; $resql = $this->db->query($sql); @@ -1603,7 +1621,8 @@ class BookKeeping extends CommonObject { global $conf; - $sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation"; + $sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,"; + $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -1620,6 +1639,10 @@ class BookKeeping extends CommonObject $this->doc_ref = $obj->doc_ref; $this->doc_type = $obj->doc_type; $this->date_creation = $obj->date_creation; + $this->date_modification = $obj->date_modification; + $this->date_export = $obj->date_export; + $this->date_validation = $obj->date_validated; + $this->date_validation = $obj->date_validation; } else { $this->error = "Error ".$this->db->lasterror(); dol_syslog(__METHOD__.$this->error, LOG_ERR); @@ -1675,7 +1698,8 @@ class BookKeeping extends CommonObject $sql = "SELECT rowid, doc_date, doc_type,"; $sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,"; $sql .= " numero_compte, label_compte, label_operation, debit, credit,"; - $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation"; + $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,"; + $sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode; $sql .= " WHERE piece_num = ".$piecenum; $sql .= " AND entity IN (".getEntity('accountancy').")"; @@ -1708,6 +1732,10 @@ class BookKeeping extends CommonObject $line->journal_label = $obj->journal_label; $line->piece_num = $obj->piece_num; $line->date_creation = $obj->date_creation; + $line->date_modification = $obj->date_modification; + $line->date_export = $obj->date_export; + $line->date_validation = $obj->date_validated; + $line->date_validation = $obj->date_validation; $this->linesmvt[] = $line; } @@ -1735,7 +1763,8 @@ class BookKeeping extends CommonObject $sql = "SELECT rowid, doc_date, doc_type,"; $sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,"; $sql .= " numero_compte, label_compte, label_operation, debit, credit,"; - $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num"; + $sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,"; + $sql .= " date_validated as date_validation"; $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql .= " WHERE entity IN (".getEntity('accountancy').")"; @@ -1770,6 +1799,8 @@ class BookKeeping extends CommonObject $line->sens = $obj->sens; $line->code_journal = $obj->code_journal; $line->piece_num = $obj->piece_num; + $line->date_validation = $obj->date_validated; + $line->date_validation = $obj->date_validation; $this->linesexport[] = $line; } @@ -2103,4 +2134,9 @@ class BookKeepingLine * @var integer|string $date_export; */ public $date_export; + + /** + * @var integer|string $date_validation; + */ + public $date_validation; } diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 390c288b606..b612762d358 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . * */ @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $socid = GETPOST('socid', 'int'); @@ -124,7 +124,11 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting- $form = new Form($db); $formaccounting = new FormAccounting($db); -llxHeader('', $langs->trans("Closure")); +$title = $langs->trans('Closure'); + +$help_url ='EN:Module_Double_Entry_Accounting'; + +llxHeader('', $title, $help_url); if ($action == 'validate_movements') { $form_question = array(); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index d33f5e12312..ede72c9d9e6 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { @@ -141,6 +141,9 @@ if ($action == 'validatehistory') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); + } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; @@ -155,6 +158,9 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; + if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { + $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; + } dol_syslog('htdocs/accountancy/customer/index.php'); $result = $db->query($sql); @@ -198,11 +204,13 @@ if ($action == 'validatehistory') { } } - // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($objp->company_code_sell)) { - $objp->code_sell_t = $objp->company_code_sell; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) + if (!empty($objp->company_code_sell)) { + $objp->code_sell_t = $objp->company_code_sell; + $objp->aarowid_suggest = $objp->aarowid_thirdparty; + $suggestedaccountingaccountfor = ''; + } } if ($objp->aarowid_suggest > 0) { @@ -319,10 +327,10 @@ if ($resql) { } print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -405,10 +413,10 @@ if ($resql) { print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -472,9 +480,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange while ($row = $db->fetch_row($resql)) { print ''.$row[0].''; for ($i = 1; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; + print ''.price($row[13]).''; print ''; } $db->free($resql); @@ -533,9 +541,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange while ($row = $db->fetch_row($resql)) { print ''.$row[0].''; for ($i = 1; $i <= 12; $i++) { - print ''.price(price2num($row[$i])).''; + print ''.price(price2num($row[$i])).''; } - print ''.price(price2num($row[13])).''; + print ''.price(price2num($row[13])).''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 1e6fb660c62..55700fe8439 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -458,8 +458,8 @@ if ($result) { $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export; $accountingaccountstatic->rowid = $objp->fk_compte; - $accountingaccountstatic->label = $objp->label; - $accountingaccountstatic->labelshort = $objp->labelshort; + $accountingaccountstatic->label = $objp->label_account; + $accountingaccountstatic->labelshort = $objp->labelshort_account; $accountingaccountstatic->account_number = $objp->account_number; print ''; @@ -492,7 +492,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print ''.price($objp->total_ht).''; + print ''.price($objp->total_ht).''; print ''.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).''; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4df8d6b9b15..5ce9f5e13e8 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -495,7 +495,7 @@ if ($result) { //print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 '); - print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1); print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder); @@ -687,7 +687,7 @@ if ($result) { print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description); print ''; - print ''; + print ''; print price($objp->total_ht); print ''; @@ -703,13 +703,13 @@ if ($result) { print ''.$thirdpartystatic->getNomUrl(1, 'customer').''; // Country - print ''; $labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label; - print $labelcountry; + print ''; + print dol_escape_htmltag($labelcountry); print ''; // VAT Num - print ''.$objp->tva_intra.''; + print ''.dol_escape_htmltag($objp->tva_intra).''; // Found accounts print ''; @@ -739,13 +739,11 @@ if ($result) { $s .= (empty($objp->code_sell_p) ? ''.$langs->trans("NotDefined").'' : length_accountg($objp->code_sell_p)); print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1); } else { - if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { - print '
'; - $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; - $shelp = ''; - $s .= $langs->trans("NotDefined"); - print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); - } + print '
'; + $s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': '; + $shelp = ''; + $s .= $langs->trans("NotDefined"); + print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1); } if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { print '
'; diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index b4e85fd517a..f06dd5f8d6f 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { @@ -210,10 +210,10 @@ if ($resql) { } print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -290,10 +290,10 @@ if ($resql) { } print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -352,9 +352,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange while ($row = $db->fetch_row($resql)) { print ''.$row[0].''; for ($i = 1; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; + print ''.price($row[13]).''; print ''; } diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index df50eaaff87..b262f85367a 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -388,7 +388,7 @@ if ($result) { print ''; // Amount without taxes - print ''.price($objp->total_ht).''; + print ''.price($objp->total_ht).''; // Vat rate print ''.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).''; diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 810f65c68df..d69e78fead2 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -434,7 +434,7 @@ if ($result) { print ''; // Amount without taxes - print ''; + print ''; print price($objp->price); print ''; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index d073139a533..1842c23f418 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -49,7 +49,7 @@ if (empty($user->rights->accounting->mouvements->lire)) { if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled) && empty($conf->asset->enabled) && empty($conf->intracommreport->enabled)) { accessforbidden(); } -if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) { +if (empty($user->rights->compta->resultat->lire) && empty($user->rights->accounting->comptarapport->lire) && empty($user->rights->accounting->mouvements->lire) && empty($user->rights->asset->read) && empty($user->rights->intracommreport->read)) { accessforbidden(); } @@ -61,7 +61,7 @@ if (empty($user->rights->compta->resultat->lire) && empty($user->rights->account if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 76984d55fba..bdda4583d54 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -177,7 +177,7 @@ $accountingjournalstatic->fetch($id_journal); $journal = $accountingjournalstatic->code; $journal_label = $accountingjournalstatic->label; - +//print $sql; dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { @@ -252,6 +252,7 @@ if ($result) { ); // Set accountancy code for user + // $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists) $compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : ''); $tabuser[$obj->rowid] = array( @@ -277,7 +278,7 @@ if ($result) { $tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60); } - // Load of url links to the line into llx_bank + // Load of url links to the line into llx_bank (so load llx_bank_url) $links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) // By default @@ -287,7 +288,7 @@ if ($result) { // get_url may return -1 which is not traversable if (is_array($links) && count($links) > 0) { - // Now loop on each link of record in bank. + // Now loop on each link of record in bank (code similar to bankentries_list.php) foreach ($links as $key => $val) { if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) { // So we excluded 'company' and 'user' here. We want only payment lines @@ -302,6 +303,7 @@ if ($result) { } } + // Special case to ask later to add more request to get information for old links without company link. if ($links[$key]['type'] == 'withdraw') { $tabmoreinfo[$obj->rowid]['withdraw'] = 1; } @@ -401,6 +403,44 @@ if ($result) { $paymentsalstatic->label = $links[$key]['label']; $tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2); $tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id; + + // This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete. + // Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after. + if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) { + $tmpsalary = new Salary($db); + $tmpsalary->fetch($paymentsalstatic->id); + $tmpsalary->fetch_user($tmpsalary->fk_user); + + $userstatic->id = $tmpsalary->user->id; + $userstatic->name = $tmpsalary->user->name; + $userstatic->email = $tmpsalary->user->email; + $userstatic->firstname = $tmpsalary->user->firstname; + $userstatic->lastname = $tmpsalary->user->lastname; + $userstatic->statut = $tmpsalary->user->statut; + $userstatic->accountancy_code = $tmpsalary->user->accountancy_code; + + if ($userstatic->id > 0) { + $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0); + } else { + $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen + } + + if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user. + $compta_user = $userstatic->accountancy_code; + if ($compta_user) { + $tabtp[$obj->rowid][$compta_user] += $obj->amount; + $tabuser[$obj->rowid] = array( + 'id' => $userstatic->id, + 'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname), + 'lastname' => $userstatic->lastname, + 'firstname' => $userstatic->firstname, + 'email' => $userstatic->email, + 'accountancy_code' => $compta_user, + 'status' => $userstatic->statut + ); + } + } + } } elseif ($links[$key]['type'] == 'payment_expensereport') { $paymentexpensereportstatic->id = $links[$key]['url_id']; $tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2); @@ -468,7 +508,7 @@ if ($result) { } } - // If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'. + // If no links were found to know the amount on thirdparty/user, we init it to account 'NotDefined'. if (empty($tabtp[$obj->rowid])) { $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank]; } @@ -1108,8 +1148,8 @@ if (empty($action) || $action == 'view') { print $reflabel; print ""; print ''.$val["type_payment"].""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } } @@ -1162,9 +1202,9 @@ if (empty($action) || $action == 'view') { if ($tabtype[$key] == 'unknown') { // We will accept writing, but into a waiting account if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') { - print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').''; + print ''.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').''; } else { - print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account + print ''.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).''; // We will use a waiting account } } else { // We will refuse writing @@ -1187,7 +1227,7 @@ if (empty($action) || $action == 'view') { if ($tabtype[$key] == 'member') { $errorstring = 'MainAccountForSubscriptionPaymentNotDefined'; } - print ''.$langs->trans($errorstring).''; + print ''.$langs->trans($errorstring).''; } } else { print $accounttoshow; @@ -1196,7 +1236,7 @@ if (empty($action) || $action == 'view') { // Subledger account print ""; - if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger + if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger $accounttoshowsubledger = length_accounta($k); if ($accounttoshow != $accounttoshowsubledger) { if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') { @@ -1205,14 +1245,14 @@ if (empty($action) || $action == 'view') { var_dump($tabbq[$key]);*/ //print ''.$langs->trans("ThirdpartyAccountNotDefined").''; if (!empty($tabcompany[$key]['code_compta'])) { - if (in_array($tabtype[$key], array('payment_various'))) { + if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) { // For such case, if subledger is not defined, we won't use subledger accounts. - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").''; + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").''; } else { - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; } } else { - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").''; + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").''; } } else { print $accounttoshowsubledger; @@ -1220,10 +1260,15 @@ if (empty($action) || $action == 'view') { } } print ""; + print "".$reflabel.""; + print ''.$val["type_payment"].""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + + print ''.($mt < 0 ? price(-$mt) : '').""; + + print ''.($mt >= 0 ? price($mt) : '').""; + print ""; } } @@ -1259,8 +1304,8 @@ if (empty($action) || $action == 'view') { print ""; print "".$reflabel.""; print ''.$val["type_payment"].""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } } @@ -1320,7 +1365,7 @@ function getSourceDocRef($val, $typerecord) if ($typerecord == 'payment') { $sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref'; $sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f"; - $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"]; + $sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]); $ref = $langs->transnoentitiesnoconv("Invoice"); } elseif ($typerecord == 'payment_supplier') { $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 0273690ae81..c1a62847b32 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -610,8 +610,8 @@ if (empty($action) || $action == 'view') { $userstatic->id = $tabuser[$key]['id']; $userstatic->name = $tabuser[$key]['name']; print "".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label.""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } } @@ -644,8 +644,8 @@ if (empty($action) || $action == 'view') { } print ''; print "".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("SubledgerAccount").""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } @@ -680,8 +680,8 @@ if (empty($action) || $action == 'view') { print ''; print "".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : ''); print ""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 2677f8569f2..71358770775 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -103,7 +103,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end)) $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false); } -$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,"; +$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,"; $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,"; $sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { @@ -911,8 +911,8 @@ if (empty($action) || $action == 'view') { } print ''; print "".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount").""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } @@ -940,8 +940,8 @@ if (empty($action) || $action == 'view') { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; print "".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$accountingaccount->label.""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } @@ -977,8 +977,8 @@ if (empty($action) || $action == 'view') { print ""; print $companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : ''); print ""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } } @@ -1005,8 +1005,8 @@ if (empty($action) || $action == 'view') { print ""; print ''; print "".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT")." NPR (counterpart)"; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index d147186a8d8..93be8e8b1b9 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -851,8 +851,8 @@ if (empty($action) || $action == 'view') { } print ''; print "".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount").""; - print ''.($mt >= 0 ? price($mt) : '').""; - print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; print ""; } @@ -880,8 +880,8 @@ if (empty($action) || $action == 'view') { $companystatic->id = $tabcompany[$key]['id']; $companystatic->name = $tabcompany[$key]['name']; print "".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$accountingaccount->label.""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } @@ -916,8 +916,8 @@ if (empty($action) || $action == 'view') { print ''; print "".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : ''); print ""; - print ''.($mt < 0 ? price(-$mt) : '').""; - print ''.($mt >= 0 ? price($mt) : '').""; + print ''.($mt < 0 ? price(-$mt) : '').""; + print ''.($mt >= 0 ? price($mt) : '').""; print ""; } } diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a69debeb0c0..f047ddf70de 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { @@ -149,6 +149,9 @@ if ($action == 'validatehistory') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; + if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) { + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); + } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; @@ -163,6 +166,9 @@ if ($action == 'validatehistory') { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; $sql .= " AND l.product_type <= 2"; + if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) { + $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'"; + } dol_syslog('htdocs/accountancy/supplier/index.php'); @@ -199,11 +205,13 @@ if ($action == 'validatehistory') { } } - // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) - if (!empty($objp->company_code_buy)) { - $objp->code_buy_t = $objp->company_code_buy; - $objp->aarowid_suggest = $objp->aarowid_thirdparty; - $suggestedaccountingaccountfor = ''; + if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) { + // Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding) + if (!empty($objp->company_code_buy)) { + $objp->code_buy_t = $objp->company_code_buy; + $objp->aarowid_suggest = $objp->aarowid_thirdparty; + $suggestedaccountingaccountfor = ''; + } } if ($objp->aarowid_suggest > 0) { @@ -314,10 +322,10 @@ if ($resql) { } print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -393,10 +401,10 @@ if ($resql) { } print ''; for ($i = 2; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; - print ''.price($row[14]).''; + print ''.price($row[13]).''; + print ''.price($row[14]).''; print ''; } $db->free($resql); @@ -456,9 +464,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange while ($row = $db->fetch_row($resql)) { print ''.$row[0].''; for ($i = 1; $i <= 12; $i++) { - print ''.price($row[$i]).''; + print ''.price($row[$i]).''; } - print ''.price($row[13]).''; + print ''.price($row[13]).''; print ''; } $db->free($resql); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 90e7213c8f9..da8bc0cd5e9 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -194,7 +194,7 @@ print ''."\n"; + print ''."\n"; +} print ''; print ''; @@ -131,7 +133,7 @@ print ''; -print img_picto('', 'globe-americas', 'class="paddingrightonly"'); +print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); @@ -139,28 +141,29 @@ if ($user->admin) { print ''."\n"; print ''; -$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print img_picto('', 'state', 'class="pictofixedwidth"'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); print ''."\n"; print ''; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); -print ''; +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; print ''; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); -print ''; +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; print ''; -print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); -print ''; +print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Web print ''; -print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); -print ''; +print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Code diff --git a/htdocs/admin/accounting.php b/htdocs/admin/accounting.php index e775f5bd8e3..ebe0712b03a 100644 --- a/htdocs/admin/accounting.php +++ b/htdocs/admin/accounting.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2018-2021 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ /** * \file htdocs/admin/accounting.php * \ingroup accounting - * \brief Setup page to configure accountanting module + * \brief Setup page to configure accounting module */ require '../main.inc.php'; @@ -32,7 +32,7 @@ $action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search // Load translation files required by the page -$langs->loadLangs(array('admin', 'companies')); +$langs->loadLangs(array('admin', 'companies', 'accountancy')); if (!$user->admin) { accessforbidden(); @@ -52,12 +52,13 @@ $error = 0; * View */ +$title = $langs->trans("ConfigAccountingExpert"); $help_url = ''; -llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url); +llxHeader('', $title, $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup'); +print load_fiche_titre($title, $linkback, 'title_setup'); print "
\n"; print ''.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."
\n"; diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 9ce55583d99..272da835741 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -3,6 +3,7 @@ * Copyright (C) 2011-2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -158,14 +159,6 @@ print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action print ''.$langs->trans("AgendaExtSitesDesc")."
\n"; print "
\n"; - -$selectedvalue = $conf->global->AGENDA_DISABLE_EXT; -if ($selectedvalue == 1) { - $selectedvalue = 0; -} else { - $selectedvalue = 1; -} - print ""; print ""; @@ -226,15 +219,15 @@ while ($i <= $MAXAGENDA) { // Nb print '"; // Name - print ''; + print ''; // URL - print ''; + print ''; // Offset TZ - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; print ""; $i++; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index b3a85d1fe4b..2b2da673202 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -226,6 +226,7 @@ if (empty($conf->cron->enabled)) { // Get the max frequency of reminder if ($job->id > 0) { if ($job->status != $job::STATUS_ENABLED) { + $langs->load("cron"); print ''.$langs->trans("JobXMustBeEnabled", $langs->transnoentitiesnoconv("sendEmailsReminder")).''; } else { print ''.img_picto($langs->trans('Enabled'), 'switch_on').''; diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 528f2f6b29f..c401c6cabf1 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -179,6 +179,7 @@ print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom'); print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', ''); +print '
'; print '
'.$langs->trans("AgendaExtNb", $key)."'; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : $conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); + print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print '
'; print ''; print ''; @@ -272,7 +273,9 @@ foreach ($dirmodels as $reldir) { } } } -print "
'.$langs->trans("Name").'

\n"; +print ""; +print ""; +print "
\n"; /* @@ -301,6 +304,7 @@ if ($resql) { } +print '
'; print "\n"; print "\n"; print ''; @@ -414,6 +418,7 @@ foreach ($dirmodels as $reldir) { } print '
'.$langs->trans("Name").'
'; +print '
'; print "
"; /* @@ -421,6 +426,8 @@ print "
"; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + +print '
'; print ''; print ''; print ''; @@ -469,6 +476,7 @@ print "\n"; print ''; print '
'.$langs->trans("Parameter").'
'; +print '
'; print '
'; diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 44629525a26..56971457f76 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -115,7 +115,7 @@ if ($action == 'add') { $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes ("; $sql .= "box_id, position, box_order, fk_user, entity"; $sql .= ") VALUES ("; - $sql .= $boxid['value'].", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity; + $sql .= ((int) $boxid['value']).", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".((int) $fk_user).", ".$conf->entity; $sql .= ")"; dol_syslog("boxes.php activate box", LOG_DEBUG); @@ -149,11 +149,6 @@ if ($action == 'delete') { if (!empty($obj->box_id)) { $db->begin(); - // Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes) - // $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param"; - // $sql.= " WHERE param LIKE 'MAIN_BOXES_%'"; - // $resql = $db->query($sql); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql .= " WHERE entity = ".$conf->entity; $sql .= " AND box_id=".((int) $obj->box_id); @@ -184,6 +179,7 @@ if ($action == 'switch') { $newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond); $newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1); } + $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid); dol_syslog($sql); $resultupdatefrom = $db->query($sql); @@ -426,12 +422,12 @@ foreach ($boxactivated as $key => $box) { $hasnext = ($key < (count($boxactivated) - 1)); $hasprevious = ($key != 0); print ''.($key + 1).''; - print ''; - print ($hasnext ? ''.img_down().' ' : ''); - print ($hasprevious ? ''.img_up().'' : ''); + print ''; + print ($hasnext ? ''.img_down().' ' : ''); + print ($hasprevious ? ''.img_up().'' : ''); print ''; print ''; - print ''.img_delete().''; + print ''.img_delete().''; print ''; print ''."\n"; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 7b1c94de1ec..09ba880dd33 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2020 Laurent Destailleur + * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,7 @@ /** * \file htdocs/admin/clicktodial.php * \ingroup clicktodial - * \brief Page to setup module clicktodial + * \brief Page to setup module ClickToDial */ require '../main.inc.php'; @@ -99,7 +99,12 @@ print ''; -print $langs->trans("Example").':
http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__'; +print '
'; +print ''; +print $langs->trans("Examples").':
'; +print 'https://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__
'; +print 'sip:__PHONETO__@my.sip.server'; +print '
'; //if (! empty($user->clicktodial_url)) //{ @@ -129,7 +134,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) { print ''; print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; - print ''; + print ''; print ''; $setupcomplete = 1; @@ -144,7 +149,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) { } if ($setupcomplete) { - print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); + print $langs->trans("LinkToTest", $user->login).':   '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL', '', 'mobile'); } else { $langs->load("errors"); print '
'.$langs->trans("WarningClickToDialUserSetupNotComplete").'
'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 89363a9027b..7407961649c 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -367,8 +367,8 @@ if ($resql) { print '
'; -print "\n"; -print "\n"; +print '
'."\n"; +print ''."\n"; print ''; print ''; print '\n"; @@ -498,6 +498,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder") print ''; print ''; +print '
'; print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."
'; print ''; @@ -584,6 +585,8 @@ if (empty($conf->facture->enabled)) { } print ""; print "
"; +print '
'; + print ""; @@ -594,6 +597,8 @@ print '
'; */ print load_fiche_titre($langs->trans("OtherOptions"), '', ''); + +print '
'; print ''; print ''; print ''; @@ -704,6 +709,8 @@ if ($conf->stock->enabled) { */ print '
'.$langs->trans("Parameter").'
'; +print '
'; + print '
'; @@ -712,6 +719,8 @@ print '
'; */ print load_fiche_titre($langs->trans("Notifications"), '', ''); + +print '
'; print ''; print ''; print ''; @@ -725,6 +734,7 @@ print '\n"; print '
'.$langs->trans("Parameter").''; print "
'; +print '
'; // End of page llxFooter(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 0c6da346285..0ca1ae7d98e 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -384,21 +384,23 @@ print "
\n"; /** * Edit parameters */ -print "\n".''."\n"; + print ''."\n"; +} print '
'; print ''; print ''; print ''; -print ''."\n"; +print ''."\n"; // Name print ''."\n"; // Currency print ''."\n"; // Phone print ''; +print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Fax print ''; +print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Email print ''; +print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Web print ''; +print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth'); +print ''; print ''."\n"; // Barcode if (!empty($conf->barcode->enabled)) { print ''; + print ''; + print ''; print ''; } // Logo print ''; // Logo (squarred) print '
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; @@ -417,8 +419,8 @@ print ''; -print img_picto('', 'globe-americas', 'class="paddingrightonly"'); -print $form->select_country($mysoc->country_id, 'country_id'); +print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); +print $form->select_country($mysoc->country_id, 'country_id', '', 0); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -430,56 +432,58 @@ if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) { $tmp = explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE); $state_id = $tmp[0]; } -$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id'); +print img_picto('', 'state', 'class="pictofixedwidth"'); +print $formcompany->select_state($state_id, $mysoc->country_code, 'state_id'); print '
'; +print img_picto('', 'multicurrency', 'class="pictofixedwidth"'); print $form->selectCurrency($conf->currency, "currency"); print '
'; -print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright'); -print '
'; -print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright'); -print '
'; -print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright'); -print '
'; -print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright'); -print '
'; print ''; - print ''; - print '
'; -print '
'; -print ''; +print '
'; +print ''; print '
'; if (!empty($mysoc->logo_small)) { if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { print '
'; - print ''; + print ''; print '
'; } elseif (!empty($mysoc->logo)) { if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -487,10 +491,12 @@ if (!empty($mysoc->logo_small)) { } $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality); print '
'; - print ''; + print ''; print '
'; } - print ''; + print ''; } elseif (!empty($mysoc->logo)) { if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { print '
'; @@ -508,8 +514,8 @@ print '
'; -print '
'; -print ''; +print '
'; +print ''; print '
'; if (!empty($mysoc->logo_squarred_small)) { if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) { @@ -551,20 +557,21 @@ print '
'; print '
'; // IDs of the company (country-specific) +print '
'; print ''; -print ''; +print ''; $langs->load("companies"); // Managing Director(s) print ''; +print ''; // GDPR contact print ''; +print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">'; // Capital print ''; +print ""; +print ''."\n"; +print ""; +print ""; -//Use draft Watermark +// Set working days +print ''; +print ""; +print '"; +print ""; -print ''."\n"; +// Set working days +print ''; +print ""; +print '"; +print ""; + +// Set working days +print ''; +print ""; +print '"; +print ""; + +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { + $substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2); + $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation"); + $htmltext = ''.$langs->trans("AvailableVariables").':
'; + foreach ($substitutionarray as $key => $val) { + $htmltext .= $key.'
'; + } + $htmltext .= '
'; + + print ''."\n"; + + //Use draft Watermark + + print ''."\n"; +} print '
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'.$langs->trans("CompanyIds").''.$langs->trans("Value").'
'; -print '
'; print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc")); print ''; -print 'global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'">
'; @@ -656,13 +663,14 @@ print ''; +// Set working days +print '
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Monday"))."'; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0); } else { - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); - print $doleditor->Create(); + if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY)) { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } } -print '
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Friday"))."'; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0); +} else { + if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY)) { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } +} +print "
'; -print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; -print '
'; -print ''; -print '
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Saturday"))."'; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1); +} else { + if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } +} +print "
".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Sunday"))."'; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1); +} else { + if (!empty($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) { + print ''.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print ''.img_picto($langs->trans("Disabled"), 'off').''; + } +} +print "
'; + print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'

'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp'); + print '
'; + $variablename = 'HOLIDAY_FREE_TEXT'; + if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + print ''; + } else { + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); + } + print '
'; + print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; + print '
'; + print ''; + print '
'; print '
'; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 0ac40741ab3..cf4c250a678 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -255,7 +255,7 @@ if ($action == 'update') { $_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer - header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); exit; } @@ -281,6 +281,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; print ''; print ''; print ''; +print ''; clearstatcache(); @@ -292,8 +293,9 @@ print ''; // Default language print ''.$langs->trans("DefaultLanguage").''; +print img_picto('', 'language', 'class="pictofixedwidth"'); print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); -print ''; +//print ''; print ''; print ''; @@ -303,12 +305,24 @@ print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0); print ''; print ''; -print '
'."\n"; +print ''."\n"; print ''; +print '
'; +print '
'; +print ''; +print '
'; + +print '

'; + // Themes and themes options showSkins(null, 1); print '
'; +print '
'; +print ''; +print '
'; + +print '

'; // Other print '
'; @@ -440,6 +454,12 @@ print '
'; print '
'; +print '
'; +print ''; +print '
'; + +print '

'; + // Other print '
'; print ''; @@ -476,7 +496,7 @@ $disabled = ''; if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { $disabled = ' disabled="disabled"'; } -print ''; +print ''; if ($disabled) { print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') '; } @@ -484,7 +504,7 @@ if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) { print '   '; - print ''; + print ''; } } else { print ''; @@ -497,7 +517,7 @@ print ''; print '
'; print '
'; -print ''; +print ''; print '
'; print ''; diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 396570b2155..c02ee501d94 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -51,6 +51,7 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('//i', '
', $conf->global->MAIN_MOTD_SETUPPAGE); if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $i = 0; + $reg = array(); while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { $tmp = explode('|', $reg[1]); if (!empty($tmp[1])) { @@ -81,7 +82,8 @@ print '

'; if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { $setupcompanynotcomplete = 1; } -print img_picto('', 'company', 'class="paddingright"').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); +print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); +print '

'.$langs->trans("SetupDescription3b"); if (!empty($setupcompanynotcomplete)) { $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"'); @@ -92,7 +94,8 @@ print '
'; print '
'; // Show info setup module -print img_picto('', 'cog', 'class="paddingright"').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); +print img_picto('', 'cog', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); +print '

'.$langs->trans("SetupDescription4b"); if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled $langs->load("errors"); $warnpicto = img_warning($langs->trans("WarningEnableYourModulesApplications"), 'style="padding-right: 6px;"'); diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 5bc994bb086..b8434773f67 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -23,32 +23,8 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; + global $langs, $user; // Libraries diff --git a/htdocs/admin/knowledgerecord_extrafields.php b/htdocs/admin/knowledgerecord_extrafields.php index 823366e1fbe..d6c94e4ceeb 100644 --- a/htdocs/admin/knowledgerecord_extrafields.php +++ b/htdocs/admin/knowledgerecord_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement.lib.php'; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 18399894ad0..26f0c28172f 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -255,11 +255,13 @@ print '
'; print "\n"; // DNAdmin +print ''; print ''; // Pass +print ''; print ''; print "\n"; // DN Pour les contacts -print ''; print ''; print ''; // List of object class used to define attributes in structure -print ''; print ''; @@ -173,7 +175,7 @@ print '
'; print '
'.$langs->trans("ForANonAnonymousAccess").'
'.$langs->trans("LDAPAdminDn").''; print ''; print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; if (!empty($conf->global->LDAP_ADMIN_PASS)) { print ''; // je le met en visible pour test diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index d21c95405a2..4fb58898a07 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -155,14 +155,16 @@ print ''.$langs->trans("LDAPSynchronizeContacts").'
'.$langs->trans("LDAPContactDn").''; +print ''; +print '
'.$langs->trans("LDAPContactDn").''; print ''; print ''.$langs->trans("LDAPContactDnExample").' 
'.$langs->trans("LDAPContactObjectClassList").''; +print ''; +print '
'.$langs->trans("LDAPContactObjectClassList").''; print ''; print ''.$langs->trans("LDAPContactObjectClassListExample").' 
'; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 13532474681..19d24ecd5db 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -99,6 +99,8 @@ if ($action == 'setvalue' && $user->admin) { * View */ +$form = new Form($db); + llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback = ''.$langs->trans("BackToModuleList").''; @@ -121,8 +123,6 @@ print '
'; print ''; print ''; -$form = new Form($db); - print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").'
'; print ''; @@ -130,20 +130,23 @@ print ''; print "\n"; // DN pour les groupes -print ''; print ''; print ''; // List of object class used to define attributes in structure -print ''; print ''; print ''; // Filter, used to filter search +print ''; print ''; @@ -151,11 +154,13 @@ print ''; print ''; print '
'.$langs->trans("LDAPSynchronizeGroups").'
'.$langs->trans("LDAPGroupDn").''; +print ''; +print '
'.$langs->trans("LDAPGroupDn").''; print ''; print ''.$langs->trans("LDAPGroupDnExample").' 
'.$langs->trans("LDAPGroupObjectClassList").''; +print ''; +print '
'.$langs->trans("LDAPGroupObjectClassList").''; print ''; print ''.$langs->trans("LDAPGroupObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPGroupFilterExample").'
'; + print '
'; + print ''; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index d64628516ca..ab1af5fcf16 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -200,20 +200,23 @@ print ''; print "\n"; // DN Pour les adherents -print ''; print ''; print ''; // List of object class used to define attributes in structure -print ''; print ''; print ''; // Filter, used to filter search +print ''; print ''; @@ -225,7 +228,7 @@ print '
'; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPSynchronizeMembers").'
'.$langs->trans("LDAPMemberDn").''; +print ''; +print '
'.$langs->trans("LDAPMemberDn").''; print ''; print ''.$langs->trans("LDAPMemberDnExample").' 
'.$langs->trans("LDAPMemberObjectClassList").''; +print ''; +print '
'.$langs->trans("LDAPMemberObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 75ed864ecf0..ae4a1794f35 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -124,25 +124,29 @@ print ''; print "\n"; // DN pour les types de membres -print ''; print ''; print ''; // List of object class used to define attributes in structure -print ''; print ''; print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPSynchronizeMembersTypes").'
'.$langs->trans("LDAPMemberTypeDn").''; +print ''; +print '
'.$langs->trans("LDAPMemberTypeDn").''; print ''; print ''.$langs->trans("LDAPMemberTypepDnExample").' 
'.$langs->trans("LDAPMemberTypeObjectClassList").''; +print ''; +print '
'.$langs->trans("LDAPMemberTypeObjectClassList").''; print ''; print ''.$langs->trans("LDAPMemberTypeObjectClassListExample").' 
'; + print '
'; + print ''; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 7e53eebc9ce..6e38eb2564e 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -190,20 +190,23 @@ print ''; print "\n"; // DN Pour les utilisateurs -print ''; print ''; print ''; // List of object class used to define attributes in structure -print ''; print ''; print ''; // Filter, used to filter search +print ''; print ''; @@ -215,7 +218,7 @@ print '
'; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("LDAPSynchronizeUsers").'
'.$langs->trans("LDAPUserDn").''; +print ''; +print '
'.$langs->trans("LDAPUserDn").''; print ''; print ''.$langs->trans("LDAPUserDnExample").' 
'.$langs->trans("LDAPUserObjectClassList").''; +print ''; +print '
'.$langs->trans("LDAPUserObjectClassList").''; print ''; print ''.$langs->trans("LDAPUserObjectClassListExample").' 
'.$langs->trans("LDAPFilterConnection").''; print ''; print ''.$langs->trans("LDAPFilterConnectionExample").'
'; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 2d3133c9fce..e86c78763ee 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -302,7 +302,7 @@ if ($action == 'edit') { // Disable print ''; // Force e-mail recipient @@ -514,7 +514,7 @@ if ($action == 'edit') { $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')'; print ''; // From @@ -529,7 +529,7 @@ if ($action == 'edit') { // Add user to select destinaries list print ''; print '
'.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPDolibarrMapping").''.$langs->trans("LDAPLdapMapping").''.$langs->trans("LDAPNamingAttribute").'
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; - print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', $conf->global->MAIN_DISABLE_ALL_MAILS, 1); + print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', getDolGlobalString('MAIN_DISABLE_ALL_MAILS'), 1); print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; - print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE, 0); + print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE', $liste, getDolGlobalString('MAIN_MAIL_DEFAULT_FROMTYPE'), 0); print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''; - print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', $conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT, 1); + print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', getDolGlobalString('MAIN_MAIL_ENABLED_USER_DEST_SELECT'), 1); print '
'; diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 44982fc3ece..d8c827337ad 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -413,8 +413,8 @@ if ($action != 'create') { print ''; */ print ''; - print ''; - print ''; + print ''; + print ''; print ''; } elseif ($value == 'type_template') { print ''; } elseif (!in_array($value, array('content', 'content_lines'))) { print ''; @@ -1229,7 +1233,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') print ''; print $obj->{$value}; } else { - print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); + print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1); } print ''; } elseif ($context == 'add' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) { diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 4d9c85a69f9..5a155d11411 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -314,14 +314,14 @@ if ($conf->use_javascript_ajax) { $entry .= ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; $entry .= ''.img_edit_add('default').' '; $entry .= ''.img_delete('default').' '; - $entry .= '     '; + $entry .= '  '; $entry .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; $entry .= '
'.$langs->trans("Label").'
'.$langs->trans("Email").'
'.$langs->trans("Label").'
'.$langs->trans("Email").'
'.$langs->trans("Signature").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%'); @@ -499,7 +499,7 @@ foreach ($object->fields as $key => $val) { if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], empty($search[$key]) ? '' : $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + print $object->showInputField($val, $key, empty($search[$key]) ? '' : $search[$key], '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { print ''; } @@ -609,6 +609,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index c2a54e31a3a..db3c45a0776 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -175,6 +175,7 @@ $elementList = array(); // We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']" $elementList = array(); // Add all and none after the sort + $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToUser')); @@ -229,6 +230,9 @@ if (!empty($conf->agenda->enabled)) { if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) { $elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization')); } +if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) { + $elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership')); +} $parameters = array('elementList'=>$elementList); $reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks @@ -824,7 +828,7 @@ if ($resql) { print ''; - print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1); + print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1); print '
'; $buttons = ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '; $buttons .= ''.img_edit_add('default').' '; $buttons .= ''.img_delete('default').' '; - $buttons .= '     '; + $buttons .= '  '; $buttons .= ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''; $data[] = array( diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 142d5accb0f..77c070ad573 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,7 @@ * \brief Page to activate/disable all modules */ -if (!defined('CSRFCHECK_WITH_TOKEN')) { +if (!defined('CSRFCHECK_WITH_TOKEN') && (empty($_GET['action']) || $_GET['action'] != 'reset')) { // We force security except to disable modules so we can do it if problem of a module define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET } @@ -246,6 +247,7 @@ if ($action == 'install') { if ($action == 'set' && $user->admin) { $resarray = activateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors'); } else { @@ -269,6 +271,7 @@ if ($action == 'set' && $user->admin) { exit; } elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); } @@ -386,7 +389,8 @@ foreach ($modulesdir as $dir) { } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); - if ($moduleposition == '50' && ($objMod->isCoreOrExternalModule() == 'external')) { + if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) { + // an external module should never return a value lower than '80'. $moduleposition = '80'; // External modules at end by default } @@ -477,7 +481,9 @@ print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup'); $deschelp = ''; if ($mode == 'common' || $mode == 'commonkanban') { $desc = $langs->trans("ModulesDesc", '{picto}'); + $desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}'); $desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc); + $desc = str_replace('{picto2}', img_picto('', 'setup'), $desc); if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled $deschelp = '
'.$desc."

\n"; } @@ -531,7 +537,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { $moreforfilter .= '
'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh"').''; + $moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh hideonsmartphone"').''; $moreforfilter .= '
'; $moreforfilter .= '
'; $moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1); @@ -822,8 +828,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { } else { $codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15'); } - } else // Module not yet activated - { + } else { // Module not yet activated // Set $codeenabledisable if (!empty($objMod->always_enabled)) { // Should never happened @@ -880,11 +885,11 @@ if ($mode == 'common' || $mode == 'commonkanban') { } else { print ''."\n"; if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) { - print ''.$linenum.''; + print ''.$linenum.''; } // Picto + Name of module - print ' '; + print ' '; $alttext = ''; //if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version); //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); @@ -916,7 +921,6 @@ if ($mode == 'common' || $mode == 'commonkanban') { if ($objMod->needUpdate) { $versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion; print ''.$versiontrans.''; - $foundoneexternalmodulewithupdate++; } else { print $versiontrans; } @@ -934,6 +938,9 @@ if ($mode == 'common' || $mode == 'commonkanban') { print "\n"; } + if ($objMod->needUpdate) { + $foundoneexternalmodulewithupdate++; + } } if ($action == 'checklastversion') { @@ -1011,7 +1018,7 @@ if ($mode == 'marketplace') {
-
+
@@ -1242,7 +1249,13 @@ if ($mode == 'develop') { print '
'; print ''; print ''.$langs->trans("TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv("ModuleBuilder")).''; - print ''.$langs->trans("SeeTopRightMenu").''; + print ''; + if (!empty($conf->modulebuilder->enabled)) { + print $langs->trans("SeeTopRightMenu"); + } else { + print ''.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("ModuleBuilder")).''; + } + print ''; print ''; print ''."\n"; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 079e55cb523..e2f123f627c 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -91,6 +91,7 @@ print dol_get_fiche_head($head, 'services', '', -1, 'technic'); print ''.$langs->trans("ListOfSupportedOauthProviders").'

'; +print '
'; print ''; $i = 0; @@ -145,6 +146,7 @@ foreach ($list as $key) { } print '
'."\n"; +print '
'; print dol_get_fiche_end(); diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 1b2886cd8ef..998b6c39c0f 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -230,7 +230,7 @@ if ($mode == 'setup' && $user->admin) { print ''; print ''; - + print '
'; print ''."\n"; print ''; @@ -262,15 +262,15 @@ if ($mode == 'setup' && $user->admin) { print $langs->trans("NoAccessToken"); } print ''; - print '
'; + print ''; // Links to delete/checks token if (is_object($tokenobj)) { //test on $storage->hasAccessToken($OAUTH_SERVICENAME) ? - print ''.$langs->trans('DeleteAccess').'
'; + print ''.$langs->trans('DeleteAccess').'
'; } // Request remote token if ($urltorenew) { - print ''.$langs->trans('RequestAccess').'
'; + print ''.$langs->trans('RequestAccess').'
'; } // Check remote access if ($urltocheckperms) { @@ -330,6 +330,7 @@ if ($mode == 'setup' && $user->admin) { } print '
'; + print '
'; if (!empty($driver)) { if ($submit_enabled) { @@ -345,6 +346,7 @@ if ($mode == 'setup' && $user->admin) { if ($mode == 'test' && $user->admin) { print $langs->trans('PrintTestDesc'.$driver)."

\n"; + print '
'; print ''; if (!empty($driver)) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; @@ -364,11 +366,13 @@ if ($mode == 'test' && $user->admin) { } print '
'; + print '
'; } if ($mode == 'userconf' && $user->admin) { print $langs->trans('PrintUserConfDesc'.$driver)."

\n"; + print '
'; print ''; print ''; print ''; @@ -395,6 +399,7 @@ if ($mode == 'userconf' && $user->admin) { print "\n"; } print '
'.$langs->trans("User").'
'; + print '
'; } print dol_get_fiche_end(); diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 7cf522abc33..43ad8c15929 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -150,42 +150,44 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ""; // Bank account (from Banks module) print ''; -print ''; /* Moved to bank account data // ICS print ''; -print ''; print ''; */ //User print ''; -print ''; print ''; /* //EntToEnd print ''; -print ''; +print ''; print ''; //USTRD print ''; -print ''; +print ''; print ''; */ @@ -195,7 +197,7 @@ print ''; +print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("BankToPayCreditTransfer").''; -$form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1); +print ''; +print img_picto('', 'bank_account', 'class="pictofixedwidth"'); +print $form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1); print '
'.$langs->trans("ICS").''; +print ''; print '
'.$langs->trans("ResponsibleUser").''; -print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print ''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500'); print '
'.$langs->trans("END_TO_END").''; -print ''; +print '
'.$langs->trans("USTRD").''; -print ''; +print '
'; if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) { $conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS = 0; } -print '
'; print '
'; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 7d7b5e36a40..cee63fd91fd 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -52,22 +52,22 @@ if ($cancel) { } if ($action == 'update') { - dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID2_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID3_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID4_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); if (!empty($conf->projet->enabled)) { if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') { @@ -82,20 +82,20 @@ if ($action == 'update') { } } - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DESC')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_REF')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE')) dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET('SHOW_SUBPRODUCT_REF_IN_PDF')) dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -371,17 +371,7 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu //} print ''; -//Desc - -print ''.$langs->trans("HideDescOnPDF").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC'); -} else { - print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); -} -print ''; - -//Ref +// Ref print ''.$langs->trans("HideRefOnPDF").''; if ($conf->use_javascript_ajax) { @@ -391,7 +381,17 @@ if ($conf->use_javascript_ajax) { } print ''; -//Details +// Desc + +print ''.$langs->trans("HideDescOnPDF").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC'); +} else { + print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1); +} +print ''; + +// Details print ''.$langs->trans("HideDetailsOnPDF").''; if ($conf->use_javascript_ajax) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index acf1dfe707e..d50476528cb 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -53,6 +53,16 @@ if ($cancel) { } if ($action == 'update') { + if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) { + dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity); + } + if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) { + dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity); + } + if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) { + dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); + } + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -78,7 +88,8 @@ $head = pdf_admin_prepare_head(); print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf'); -print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."
\n"; +$tooltiptext = ''; +print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."
\n"; print "
\n"; print load_fiche_titre($langs->trans("Proposal"), '', ''); @@ -91,7 +102,9 @@ print '
'; print ''; print ''; -print ''; +print ''; + +print ''; + /* print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE").''; +print '
'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"); +print ' ('.$langs->trans("RandomlySelectedIfSeveral").')'; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); } else { @@ -100,6 +113,26 @@ if ($conf->use_javascript_ajax) { } print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM); +} +print '
'.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE"); +print ''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE); +} +print '
'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").''; if ($conf->use_javascript_ajax) { @@ -114,10 +147,11 @@ print '
'; print '
'; - +/* print '
'; print ''; print '
'; +*/ print ''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index f08a1497181..8f4c0c6f763 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -21,7 +21,7 @@ /** * \file htdocs/admin/perms.php * \ingroup core - * \brief Page d'administration/configuration des permissions par defaut + * \brief Page to setup default permissions of a new user */ require '../main.inc.php'; @@ -64,6 +64,7 @@ if ($action == 'remove') { */ $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; + llxHeader('', $langs->trans("DefaultRights"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); @@ -121,15 +122,15 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print ''; if ($user->admin) { - print ''; + print ''; } print ''."\n"; //print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS; -$sql = "SELECT r.id, r.libelle as label, r.module, r.module_position, r.perms, r.subperms, r.bydefault"; +$sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" $sql .= " AND r.entity = ".((int) $entity); @@ -147,21 +148,32 @@ if ($result) { while ($i < $num) { $obj = $db->fetch_object($result); - // If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it + // If line is for a module that does not exist anymore (absent of includes/module), we ignore it if (empty($modules[$obj->module])) { $i++; continue; } - // Save field module_position in database if value is still zero - if (empty($obj->module_position)) { + $objMod = $modules[$obj->module]; + + // Save field module_position in database if value is wrong + if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) { if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) { // TODO Define familyposition - $family = (!empty($modules[$obj->module]->family_position) ? $modules[$obj->module]->family_position : ''); + //$familyposition = $modules[$obj->module]->family_position; $familyposition = 0; - $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $modules[$obj->module]->module_position).","; + + $newmoduleposition = $modules[$obj->module]->module_position; + + // Correct $newmoduleposition position for external modules + $objMod = $modules[$obj->module]; + if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) { + $newmoduleposition += 100000; + } + + $sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).","; $sqlupdate .= " family_position = ".((int) $familyposition); - $sqlupdate .= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'"; + $sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'"; $db->query($sqlupdate); } } @@ -203,12 +215,12 @@ if ($result) { print ''."\n"; } - $perm_libelle = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label)); - + print ''."\n"; print ''; // Picto and label of module print ''; // Tick @@ -235,11 +247,24 @@ if ($result) { } // Permission and tick - print ''; + $permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); + print ''; // Permission id if ($user->admin) { - print ''; + print ''; } print ''."\n"; @@ -252,6 +277,12 @@ if ($result) { print '
'.$langs->trans("Module").''.$langs->trans("Default").'  '.$langs->trans("Permissions").''.$langs->trans("ID").'
'; + //print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName(); print ''.$perm_libelle.''; + print $permlabel; + if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (preg_match('/_advance$/', $obj->perms)) { + print ' ('.$langs->trans("AdvancedModeOnly").')'; + } + } + print ''.$obj->id.''; + $htmltext = $langs->trans("ID").': '.$obj->id; + $htmltext .= '
'.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : ''); + print $form->textwithpicto('', $htmltext); + //print ''.$obj->id.''; + print '
'; print '
'; +$parameters = array(); +$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + print dol_get_fiche_end(); // End of page diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index db37acd8dc3..01e3b6d4913 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -153,15 +153,16 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ""; // Bank account (from Banks module) print ''; -print ''; /* Moved to bank account data @@ -179,8 +180,9 @@ print ''; //User print ''; -print ''; print ''; @@ -189,8 +191,8 @@ print ''; -print ''; +print ''; print ''; //USTRD @@ -199,16 +201,16 @@ $htmltext = $langs->trans("KeepThisEmptyInMostCases"); print $form->textwithpicto($langs->trans("USTRD"), $htmltext); print ''; print ''; +print ''; print ''; //ADDDAYS print ''; -print ''; +print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("BankToReceiveWithdraw").''; -$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1); +print ''; +print img_picto('', 'bank_account', 'class="pictofixedwidth"'); +print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1); print '
'.$langs->trans("ResponsibleUser").''; -print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print ''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500'); print '
'; $htmltext = $langs->trans("KeepThisEmptyInMostCases"); print $form->textwithpicto($langs->trans("END_TO_END"), $htmltext); print ''; -print ''; +print '
'; -print '
'.$langs->trans("ADDDAYS").''; +print ''; if (empty($conf->global->PRELEVEMENT_ADDDAYS)) { $conf->global->PRELEVEMENT_ADDDAYS = 0; } -print '
'; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index f1b74146c5e..883a6ff6f03 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -313,7 +313,7 @@ if ($mode == 'config' && $user->admin) { if ($action != 'editprinter') { print ''; - print ''; + print ''; $ret = $printer->selectTypePrinter(); print ''.$printer->resprint.''; $ret = $printer->selectProfilePrinter(); @@ -334,7 +334,7 @@ if ($mode == 'config' && $user->admin) { print ''; if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) { print ''; - print ''; + print ''; $ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']); print ''.$printer->resprint.''; $ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']); @@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin) { print ''; if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) { print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -456,7 +456,7 @@ if ($mode == 'template' && $user->admin) { if ($action != 'edittemplate') { print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 6ea6d195040..e9a4a724871 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -178,6 +178,7 @@ print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'r print load_fiche_titre($langs->trans("ReceptionsNumberingModules")); +print '
'; print ''; print ''; print ''; @@ -272,8 +273,10 @@ foreach ($dirmodels as $reldir) { } } -print '
'.$langs->trans("Name").'

'; +print ''; +print '
'; +print '
'; /* * Documents models for Receptions Receipt @@ -302,6 +305,7 @@ if ($resql) { dol_print_error($db); } +print '
'; print ''; print ''; print ''; @@ -417,6 +421,8 @@ foreach ($dirmodels as $reldir) { } print '
'.$langs->trans("Name").'
'; +print '
'; + print '
'; @@ -459,7 +465,7 @@ print "\n"; print ''; print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'
'; -print ''; +print ''; print "\n"; */ print ''; diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index b8bb566c79b..06ae59d64a3 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -74,6 +74,7 @@ print '
'; print ''; print ''; +print '
'; print ''; print ''; print ''."\n"; @@ -132,6 +133,7 @@ print ''; print ''; print '
'.$langs->trans("Parameters").'
'; +print '
'; print '
'; diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index b1dd28956dc..064fb5650a4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -39,9 +39,11 @@ if (!$user->admin) { // Allow/Disallow change to clear passwords once passwords are crypted $allow_disable_encryption = true; + /* * Actions */ + if ($action == 'setgeneraterule') { if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) { dol_print_error($db); @@ -215,6 +217,7 @@ if (is_resource($handle)) { } asort($arrayhandler); +print '
'; print ''; print ''; print ''; @@ -248,7 +251,7 @@ foreach ($arrayhandler as $key => $module) { } elseif ($tmp == 'NotConfigured') { print $langs->trans($tmp); } else { - print $tmp; + print ''.$tmp.''; } print ''."\n"; @@ -266,6 +269,8 @@ foreach ($arrayhandler as $key => $module) { } } print '
'.$langs->trans("RuleForGeneratedPasswords").'
'; +print '
'; + print ''; //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) @@ -273,45 +278,47 @@ print ''; if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { $tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN); print '
'; + + print '
'; print ''; print ''; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print ''; print '"; - print ''; + print ''; print ''; print '
'.$langs->trans("PasswordPatternDesc").' '.$langs->trans("PasswordPatternDesc").'
'.$langs->trans("MinLength")."
'.$langs->trans("NbMajMin")."
'.$langs->trans("NbNumMin")."
'.$langs->trans("NbSpeMin")."
'.$langs->trans("NbIteConsecutive")."
'.$langs->trans("NoAmbiCaracAutoGeneration")." '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).' '.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'
'; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 55d6a518250..a4a9e91e3ff 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -743,6 +743,23 @@ if ($conf->use_javascript_ajax) { } print "\n"; print "\n"; + +/* Disabled. Would be better to be managed with a user cookie +if (!empty($conf->productbatch->enabled)) { + print ''; + print '' . $langs->trans("ShowAllBatchByDefault") . ''; + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_SHOW_ALL_BATCH_BY_DEFAULT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_SHOW_ALL_BATCH_BY_DEFAULT", $arrval, $conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT); + } + print "\n"; + print "\n"; +} +*/ + print ''; print ''; diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index f307a5905b8..bc587845cda 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -59,8 +59,10 @@ $specimenthirdparty->initAsSpecimen(); if ($action == 'updateMask') { $maskconstinvoice = GETPOST('maskconstinvoice', 'alpha'); $maskconstcredit = GETPOST('maskconstcredit', 'alpha'); + $maskconstdeposit = GETPOST('maskconstdeposit', 'alpha'); $maskinvoice = GETPOST('maskinvoice', 'alpha'); $maskcredit = GETPOST('maskcredit', 'alpha'); + $maskdeposit = GETPOST('maskdeposit', 'alpha'); if ($maskconstinvoice) { $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity); @@ -68,6 +70,9 @@ if ($action == 'updateMask') { if ($maskconstcredit) { $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity); } + if ($maskconstdeposit) { + $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity); + } if (!($res > 0)) { $error++; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index d74c4d5dbf7..68066a2aebc 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -490,7 +490,7 @@ print "'; print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'
'; print ''; -print ''; +print ''; print ''; print ''; print "\n"; diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index dfdc53e0f18..10b3d1bd47b 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -180,10 +180,10 @@ if (!$defaultsyslogfacility) { if (!$defaultsyslogfile) { $defaultsyslogfile = 'dolibarr.log'; } - -if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) { +$optionmc = ''; +if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) { print '
'.$langs->trans("ContactSuperAdminForChange").'
'; - $option = 'disabled'; + $optionmc = 'disabled'; } @@ -199,7 +199,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; foreach ($syslogModules as $moduleName) { @@ -279,11 +279,11 @@ print ''; print '
'.$langs->trans("Type").''.$langs->trans("Value").'
'; print ''; print ''; -print ''; +print ''; print "\n"; print ''; -print ''; } @@ -563,7 +599,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -576,6 +612,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -601,17 +638,16 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } - if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) { - $cssforfield = 'tdoverflowmax100'; - } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -623,6 +659,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 1110bb4b0d4..f456e7ddf98 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -70,7 +70,13 @@ restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* @@ -97,45 +103,7 @@ if ($id > 0 || !empty($ref)) { $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref customer - $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 - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->bom->creer) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ + $morehtmlref .= '
'; diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 9fe0543c4cf..3996b5e49bd 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + /** * Class for BOM */ @@ -96,23 +97,23 @@ class BOM extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'autofocusoncreate'=>1), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'), //'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,), 'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'), //'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'), 'duration' => array('type'=>'duration', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'), - 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500'), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-2, 'position'=>161, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-2, 'position'=>162, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>300, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), - 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'), + 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0, 'csslist'=>'tdoverflowmax100'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Enabled', 9=>'Disabled')), @@ -614,8 +615,8 @@ class BOM extends CommonObject $sql .= " SET ref = '".$this->db->escape($num)."',"; $sql .= " status = ".self::STATUS_VALIDATED.","; $sql .= " date_valid='".$this->db->idate($now)."',"; - $sql .= " fk_user_valid = ".$user->id; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " fk_user_valid = ".((int) $user->id); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::validate()", LOG_DEBUG); $resql = $this->db->query($sql); @@ -785,8 +786,11 @@ class BOM extends CommonObject } $label .= '
'; $label .= ''.$langs->trans('Ref').': '.$this->ref; + if (isset($this->label)) { + $label .= '
'.$langs->trans('Label').': '.$this->label; + } - $url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id; + $url = DOL_URL_ROOT.'/bom/bom_card.php?id='.$this->id; if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 199944165b4..d24ba63ef55 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -45,10 +45,10 @@ function printDropdownBookmarksList() $tmpurl = ''; // No urlencode, all param $url will be urlencoded later if ($sortfield) { - $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.$sortfield; + $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.urlencode($sortfield); } if ($sortorder) { - $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.$sortorder; + $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.urlencode($sortorder); } if (is_array($_POST)) { foreach ($_POST as $key => $val) { @@ -72,15 +72,17 @@ function printDropdownBookmarksList() // Url to go on create new bookmark page $newbtn = ''; if (!empty($user->rights->bookmark->creer)) { - //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); - $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); - $newbtn .= ''; - $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) { + //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); + $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); + $newbtn .= ''; + $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + } } // Menu with list of bookmarks $sql = "SELECT rowid, title, url, target FROM ".MAIN_DB_PREFIX."bookmark"; - $sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)"; + $sql .= " WHERE (fk_user = ".((int) $user->id)." OR fk_user is NULL OR fk_user = 0)"; $sql .= " AND entity IN (".getEntity('bookmarks').")"; $sql .= " ORDER BY position"; if ($resql = $db->query($sql)) { @@ -105,9 +107,11 @@ function printDropdownBookmarksList() $searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...'; // Url to go on create new bookmark page if (!empty($user->rights->bookmark->creer)) { - $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); - $searchForm .= ''; + if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) { + $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); + $searchForm .= ''; + } } $i = 0; while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) { diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 1094eabf0c6..f7795a14f47 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -40,7 +40,7 @@ $action = GETPOST("action", "alpha"); $title = (string) GETPOST("title", "alpha"); $url = (string) GETPOST("url", "alpha"); $urlsource = GETPOST("urlsource", "alpha"); -$target = GETPOST("target", "alpha"); +$target = GETPOST("target", "int"); $userid = GETPOST("userid", "int"); $position = GETPOST("position", "int"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -169,7 +169,7 @@ if ($action == 'create') { // Target print '
'; // Owner diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 7d644d3a103..17be6be9cef 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -98,7 +98,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user $sql .= " WHERE 1=1"; $sql .= " AND b.entity IN (".getEntity('bookmark').")"; if (!$user->admin) { - $sql .= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL OR b.fk_user = 0)"; + $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)"; } $sql .= $db->order($sortfield.", position", $sortorder); diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 47a1d90b76c..94e0e7009cf 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; // Load translation files required by the page -$langs->loadLangs(array("main", "admin", "cashdesk")); +$langs->loadLangs(array("admin", "cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 734f2e89506..141e061ac20 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2006-2021 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2013 Florian Henry @@ -257,6 +257,7 @@ if ($user->rights->categorie->creer) { // Parent category print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 5f30a96c9c1..bb70b520fa1 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -34,6 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -56,6 +57,7 @@ class Categorie extends CommonObject const TYPE_WAREHOUSE = 'warehouse'; const TYPE_ACTIONCOMM = 'actioncomm'; const TYPE_WEBSITE_PAGE = 'website_page'; + const TYPE_TICKET = 'ticket'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png @@ -78,7 +80,8 @@ class Categorie extends CommonObject 'bank_line' => 8, 'warehouse' => 9, 'actioncomm' => 10, - 'website_page' => 11 + 'website_page' => 11, + 'ticket' => 12 ); /** @@ -98,7 +101,8 @@ class Categorie extends CommonObject 8 => 'bank_line', 9 => 'warehouse', 10 => 'actioncomm', - 11 => 'website_page' + 11 => 'website_page', + 12 => 'ticket' ); /** @@ -141,7 +145,8 @@ class Categorie extends CommonObject 'project' => 'Project', 'warehouse'=> 'Entrepot', 'actioncomm' => 'ActionComm', - 'website_page' => 'WebsitePage' + 'website_page' => 'WebsitePage', + 'ticket' => 'Ticket' ); /** @@ -234,6 +239,8 @@ class Categorie extends CommonObject * @see Categorie::TYPE_WAREHOUSE * @see Categorie::TYPE_ACTIONCOMM * @see Categorie::TYPE_WEBSITE_PAGE + * @see Categorie::TYPE_TICKET + */ public $type; @@ -263,15 +270,16 @@ class Categorie extends CommonObject $parameters = array(); $reshook = $hookmanager->executeHooks('constructCategory', $parameters, $this); // Note that $action and $object may have been modified by some hooks if ($reshook >= 0 && !empty($hookmanager->resArray)) { - $mapList = $hookmanager->resArray; - $mapId = $mapList['id']; - $mapCode = $mapList['code']; - self::$MAP_ID_TO_CODE[$mapId] = $mapCode; - $this->MAP_ID[$mapCode] = $mapId; - $this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk']; - $this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table']; - $this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class']; - $this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table']; + foreach ($hookmanager->resArray as $mapList) { + $mapId = $mapList['id']; + $mapCode = $mapList['code']; + self::$MAP_ID_TO_CODE[$mapId] = $mapCode; + $this->MAP_ID[$mapCode] = $mapId; + $this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk']; + $this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table']; + $this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class']; + $this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table']; + } } } } @@ -774,7 +782,7 @@ class Categorie extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]); $sql .= " WHERE fk_categorie = ".$this->id; - $sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".$obj->id; + $sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $obj->id); dol_syslog(get_class($this).'::del_type', LOG_DEBUG); if ($this->db->query($sql)) { @@ -1303,7 +1311,7 @@ class Categorie extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."categorie as c "; $sql .= " WHERE c.entity IN (".getEntity('category').")"; $sql .= " AND c.type = ".((int) $type); - $sql .= " AND c.fk_parent = ".$this->fk_parent; + $sql .= " AND c.fk_parent = ".((int) $this->fk_parent); $sql .= " AND c.label = '".$this->db->escape($this->label)."'"; dol_syslog(get_class($this)."::already_exists", LOG_DEBUG); @@ -1497,7 +1505,10 @@ class Categorie extends CommonObject } else { $sql = "SELECT ct.fk_categorie, c.label, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as ct, ".MAIN_DB_PREFIX."categorie as c"; - $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id." AND c.type = ".$this->MAP_ID[$type]; + $sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id; + // This seems useless because the table already contains id of category of 1 unique type. So commented. + // So now it works also with external added categories. + //$sql .= " AND c.type = ".$this->MAP_ID[$type]; $sql .= " AND c.entity IN (".getEntity('category').")"; $res = $this->db->query($sql); @@ -1552,7 +1563,7 @@ class Categorie extends CommonObject // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; - $sql .= " WHERE type = ".$this->MAP_ID[$type]; + $sql .= " WHERE type = ".((int) $this->MAP_ID[$type]); $sql .= " AND entity IN (".getEntity('category').")"; if ($nom) { if (!$exact) { diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index 5779558e722..065b4dfa83e 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -218,16 +218,27 @@ foreach ($fulltree as $key => $val) { } -//print_barre_liste('', 0, $_SERVER["PHP_SELF"], '', '', '', '', 0, 0, '', 0, $newcardbutton, '', 0, 1, 1); +$nbofentries = (count($data) - 1); -print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("SyslogLevel").''; print ''; + print ''; print ''; print ''; print ''; @@ -105,17 +116,28 @@ if (!$base) { $obj = $db->fetch_object($resql); print ''; - print ''; + print ''; + print ''; print ''; if (isset($obj->Engine) && $obj->Engine == "MyISAM") { - print ''; + print ''; } else { print ''; } print ''; print ''; @@ -127,7 +149,7 @@ if (!$base) { print ''; print ''; print ''; @@ -142,6 +164,8 @@ if (!$base) { print '
'; print '
#'.$langs->trans("TableName").''.$langs->trans("Type").''.$langs->trans("Format").'
'.$obj->Name.''.($i+1).''.$obj->Name.''; + $tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name); + if (dol_is_file(DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql')) { + $img = "info"; + //print img_picto($langs->trans("ExternalModule"), $img); + } else { + $img = "info_black"; + //print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql'; + print img_picto($langs->trans("ExternalModule"), $img, 'class="small"'); + } + print ''.$obj->Engine.''.$langs->trans("Convert").' InnoDb'.$langs->trans("Convert").' InnoDb '; print $obj->Row_format; if (isset($obj->Row_format) && (in_array($obj->Row_format, array("Compact")))) { - print '
'.$langs->trans("Convert").' Dynamic'; + print '
'.$langs->trans("Convert").' Dynamic'; } print '
'.$obj->Rows.''.$obj->Check_time.''.$obj->Collation; if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) { - print '
'.$langs->trans("Convert").' UTF8'; + print '
'.$langs->trans("Convert").' UTF8'; } print '
'; print ''; + + print ''; print ''; print ''; print ''; @@ -160,6 +184,7 @@ if (!$base) { while ($i < $num) { $row = $db->fetch_row($resql); print ''; + print ''; print ''; print ''; print ''; @@ -179,6 +204,7 @@ if (!$base) { print '
'; print '
#'.$langs->trans("TableName").'Nb of tuplesNb index fetcher.
'.($i+1).''.$row[0].''.$row[1].''.$row[2].'
'; print ''; + print ''; print ''; print ''; print "\n"; @@ -197,6 +223,7 @@ if (!$base) { } print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 9af09164469..58f6af55d60 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -309,57 +309,59 @@ print '
'; // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined) $configfileparameters = array( - 'dolibarr_main_url_root' => $langs->trans("URLRoot"), - '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)', - 'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"), - '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)', - 'dolibarr_main_data_root' => $langs->trans("DataRootServer"), - 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), - 'separator1' => '', - 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"), - 'dolibarr_main_db_port' => $langs->trans("DatabasePort"), - 'dolibarr_main_db_name' => $langs->trans("DatabaseName"), - 'dolibarr_main_db_type' => $langs->trans("DriverType"), - 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"), - 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"), - 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"), - 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"), - '?dolibarr_main_db_prefix' => $langs->trans("Prefix"), - 'separator2' => '', - 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"), - '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"), - 'separator'=> '', - '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute', - '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host', - '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port', - '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version', - '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn', - '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login', - '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', - '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', - 'separator3' => '', - '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', - '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', - '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', - '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', - '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH', - '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH', - '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH', - '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH', - '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', - '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR', - '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY', - '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI', - '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF', - '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', - 'separator4' => '', - 'dolibarr_main_prod' => 'Production mode (Hide all error messages)', - 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups', - 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only', - '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page', - '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli', - '?dolibarr_strict_mode' => 'Strict mode is on/off', - '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks' + 'dolibarr_main_prod' => 'Production mode (Hide all error messages)', + 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"), + 'separator0' => '', + 'dolibarr_main_url_root' => $langs->trans("URLRoot"), + '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)', + 'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"), + '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)', + 'dolibarr_main_data_root' => $langs->trans("DataRootServer"), + 'separator1' => '', + 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"), + 'dolibarr_main_db_port' => $langs->trans("DatabasePort"), + 'dolibarr_main_db_name' => $langs->trans("DatabaseName"), + 'dolibarr_main_db_type' => $langs->trans("DriverType"), + 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"), + 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"), + 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"), + 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"), + '?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"), + 'dolibarr_main_db_readonly' => $langs->trans("ReadOnlyMode"), + 'separator2' => '', + 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"), + '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"), + 'separator'=> '', + '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute', + '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host', + '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port', + '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version', + '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn', + '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login', + '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass', + '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug', + 'separator3' => '', + '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH', + '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH', + '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH', + '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH', + '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH', + '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH', + '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH', + '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH', + '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', + '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR', + '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY', + '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI', + '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF', + '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', + 'separator4' => '', + 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups', + 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only', + '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page', + '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli', + '?dolibarr_strict_mode' => 'Strict mode is on/off', + '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks' ); print '
'; @@ -400,8 +402,10 @@ foreach ($configfileparameters as $key => $value) { if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) { if (empty($dolibarr_main_prod)) { print ''; + print showValueWithClipboardCPButton(${$newkey}, 0, '********'); + } else { + print '**********'; } - print '**********'; } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) { print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT'); } elseif ($newkey == 'dolibarr_main_document_root_alt') { @@ -420,9 +424,14 @@ foreach ($configfileparameters as $key => $value) { } } elseif ($newkey == 'dolibarr_main_instance_unique_id') { //print $conf->file->instance_unique_id; - global $dolibarr_main_cookie_cryptkey; - $valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey - print $valuetoshow; + global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id; + $valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey + if (empty($dolibarr_main_prod)) { + print ''; + print showValueWithClipboardCPButton($valuetoshow, 0, '********'); + } else { + print '**********'; + } if (empty($valuetoshow)) { print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id'); } @@ -441,6 +450,13 @@ foreach ($configfileparameters as $key => $value) { if (!empty($valuetoshow)) { print img_warning($langs->trans('SwitchThisForABetterSecurity', 0)); } + } elseif ($newkey == 'dolibarr_main_db_readonly') { + print ${$newkey}; + + $valuetoshow = ${$newkey}; + if (!empty($valuetoshow)) { + print img_warning($langs->trans('ReadOnlyMode', 1)); + } } else { print (empty(${$newkey}) ? '' : ${$newkey}); } diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 50b27b30964..272ac8d8f19 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -79,7 +79,12 @@ $file_list = array('missing' => array(), 'updated' => array()); // Local file to compare to $xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT)); + $xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile; +if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) { + $xmlfile = $xmlfile.'.zip'; +} + // Remote file to compare to $xmlremote = GETPOST('xmlremote', 'alphanohtml'); if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) { @@ -122,7 +127,7 @@ if (dol_is_file($xmlfile)) { print ''."\n"; if ($enableremotecheck) { print ' = '; - print '
'; + print '
'; } else { print ' '.$langs->trans("RemoteSignature").' = '.dol_escape_htmltag($xmlremote); if (!GETPOST('xmlremote')) { @@ -150,6 +155,10 @@ if (GETPOST('target') == 'local') { } } $xml = simplexml_load_file($xmlfile); + if ($xml === false) { + print '
'.$langs->trans('XmlCorrupted').': '.$xmlfile.''; + $error++; + } } else { print '
'.$langs->trans('XmlNotFound').': '.$xmlfile.''; $error++; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index f3892e105bb..150ca10a359 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -65,6 +65,7 @@ $arrayfields = array( ); $arrayfields = dol_sort_array($arrayfields, 'position'); +$param = ''; /* diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index b1014cc98c7..758a93a765d 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -75,7 +75,7 @@ print '
'; print ''.$langs->trans("Syslog").': '; $test = empty($conf->syslog->enabled); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); + print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' '.$langs->trans("NotSlowedDownByThis").''; } else { if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog")); @@ -91,7 +91,7 @@ print '
'; print ''.$langs->trans("DebugBar").': '; $test = empty($conf->debugbar->enabled); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis"); + print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' '.$langs->trans("NotSlowedDownByThis").''; } else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -111,7 +111,7 @@ if ($test) { print ' Memcached module admin page'; } } else { - print img_picto('', 'warning').' '.$langs->trans("MemcachedNotAvailable"); + print $langs->trans("MemcachedNotAvailable"); } print '
'; @@ -172,7 +172,8 @@ jQuery(document).ready(function() { var compphpstring; getphpurl = $.ajax({ type: "GET", - url: \''.DOL_URL_ROOT.'/index.php\', + data: { token: \''.currentToken().'\' }, + url: \''.DOL_URL_ROOT.'/public/notice.php\', cache: false, /* async: false, */ /* crossDomain: true,*/ @@ -211,10 +212,11 @@ jQuery(document).ready(function() { var compcssstring; getcssurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\', cache: false, /* async: false, */ - /*crossDomain: true, */ + /* crossDomain: true, */ success: function () { cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\'); /* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */ @@ -250,10 +252,11 @@ jQuery(document).ready(function() { var compcssphpstring; getcssphpurl = $.ajax({ type: "GET", + data: { token: \''.currentToken().'\' }, url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\', cache: false, /* async: false, */ - /*crossDomain: true,*/ + /* crossDomain: true,*/ success: function () { cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\'); /* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */ @@ -289,10 +292,11 @@ jQuery(document).ready(function() { var compimgstring; getimgurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\', cache: false, /* async: false, */ - /*crossDomain: true,*/ + /* crossDomain: true,*/ success: function () { cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\'); /* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */ @@ -328,6 +332,7 @@ jQuery(document).ready(function() { var compjsstring; getjsurl = $.ajax({ type: "GET", + data: { token: \'notrequired\' }, url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\', cache: false, /* async: false, */ @@ -367,6 +372,7 @@ jQuery(document).ready(function() { var compjsphpstring; getjsphpurl = $.ajax({ type: "GET", + data: { token: \''.currentToken().'\' }, url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\', cache: false, /* async: false, */ @@ -464,11 +470,99 @@ if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') { print '
'; } -// Product search +print '
'; +print ''.$langs->trans("ComboListOptim").': '; +print '
'; +// Product combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."product as p"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUIT_USE_SEARCH_TO_SELECT', $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); + } + print '
'; + $db->free($resql); +} +// Thirdparty combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_USE_SEARCH_TO_SELECT', $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties")); + } + print '
'; + $db->free($resql); +} +// Contact combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->CONTACT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Contacts"), 'CONTACT_USE_SEARCH_TO_SELECT', $conf->global->CONTACT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Contacts")); + } + print '
'; + $db->free($resql); +} +// Contact combo list +$sql = "SELECT COUNT(*) as nb"; +$sql .= " FROM ".MAIN_DB_PREFIX."projet as s"; +$resql = $db->query($sql); +if ($resql) { + $limitforoptim = 5000; + $num = $db->num_rows($resql); + $obj = $db->fetch_object($resql); + $nb = $obj->nb; + if ($nb > $limitforoptim) { + if (empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) { + print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseComboOptim", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT'); + } else { + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("Projects"), 'PROJECT_USE_SEARCH_TO_SELECT', $conf->global->PROJECT_USE_SEARCH_TO_SELECT); + } + } else { + print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("Projects")); + } + print '
'; + $db->free($resql); +} + + print '
'; print ''.$langs->trans("SearchOptim").': '; print '
'; -$tab = array(); +// Product search $sql = "SELECT COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $resql = $db->query($sql); @@ -480,8 +574,9 @@ if ($resql) { if ($nb > $limitforoptim) { if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) { print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE'); + print $langs->trans("YouHaveXObjectUseSearchOptimDesc"); } else { - print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ProductsOrServices"), 'PRODUCT_DONOTSEARCH_ANYWHERE', $conf->global->PRODUCT_DONOTSEARCH_ANYWHERE); } } else { print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ProductsOrServices")); @@ -491,20 +586,20 @@ if ($resql) { } // Thirdparty search -$tab = array(); $sql = "SELECT COUNT(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $resql = $db->query($sql); if ($resql) { - $limitforoptim = 10000; + $limitforoptim = 100000; $num = $db->num_rows($resql); $obj = $db->fetch_object($resql); $nb = $obj->nb; if ($nb > $limitforoptim) { if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) { print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE'); + print $langs->trans("YouHaveXObjectUseSearchOptimDesc"); } else { - print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties")); + print img_picto('', 'tick.png').' '.$langs->trans("YouHaveXObjectAndSearchOptimOn", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE', $conf->global->COMPANY_DONOTSEARCH_ANYWHERE); } } else { print img_picto('', 'tick.png').' '.$langs->trans("NbOfObjectIsLowerThanNoPb", $nb, $langs->transnoentitiesnoconv("ThirdParties")); diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 36f08309e02..f2df395060b 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php'; // Load translation files required by the page -$langs->loadLangs(array("install", "other", "admin")); +$langs->loadLangs(array("install", "other", "admin", "errors")); if (!$user->admin) { accessforbidden(); @@ -65,14 +65,37 @@ if (function_exists('php_ini_loaded_file')) { } print "
\n"; -// Get versionof web server -print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; +// Get version of web server +print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; +print ''.$langs->trans("DataRootServer").": ".DOL_DATA_ROOT."
\n"; +// Web user group by default +$labeluser = dol_getwebuser('user'); +$labelgroup = dol_getwebuser('group'); +if ($labeluser && $labelgroup) { + print ''.$langs->trans("WebUserGroup")." (env vars) : ".$labeluser.':'.$labelgroup; + if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) { + $arrayofinfoofuser = posix_getpwuid(posix_geteuid()); + print ' (POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')
'."\n"; + } +} +// Web user group real (detected by 'id' external command) +if (function_exists('exec')) { + $arrayout = array(); $varout = 0; + exec('id', $arrayout, $varout); + if (empty($varout)) { // Test command is ok. Work only on Linux OS. + print ''.$langs->trans("WebUserGroup")." (real, 'id' command) : ".join(',', $arrayout)."
\n"; + } +} print '
'; -print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
\n"; -print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath")).')')."
\n"; +print "PHP session.use_strict_mode = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", '1').")
\n"; +print "PHP session.use_only_cookies = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", '1').")
\n"; +print "PHP session.cookie_httponly = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').'   ('.$langs->trans("RecommendedValueIs", '1').")
\n"; +print "PHP session.cookie_samesite = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None').'   ('.$langs->trans("RecommendedValueIs", 'Strict').")
\n"; +print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')')."
\n"; print "PHP allow_url_fopen = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
\n"; print "PHP allow_url_include = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).'   ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")
\n"; +//print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).'   '.$langs->trans("Deprecated")." (removed in PHP 5.4)
\n"; print "PHP disable_functions = "; $arrayoffunctionsdisabled = explode(',', ini_get('disable_functions')); $arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals'); @@ -155,8 +178,8 @@ print ''.$langs->trans("PermissionsOnFilesInWebRoot").': '; $arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/custom'), 'name', SORT_ASC, 4, 1, '', 1); $fileswithwritepermission = array(); foreach ($arrayoffilesinroot as $fileinroot) { - // Test permission on file - if ($fileinroot['perm'] & 0222) { + // Test if there is at least one write permission file. If yes, add the entry into array $fileswithwritepermission + if (isset($fileinroot['perm']) && ($fileinroot['perm'] & 0222)) { $fileswithwritepermission[] = $fileinroot['relativename']; } } @@ -179,6 +202,7 @@ if (empty($fileswithwritepermission)) { } } print '
'; +print '
'; print ''.$langs->trans("PermissionsOnFile", $conffile).': '; // $conffile is defined into filefunc.inc.php $perms = fileperms($dolibarr_main_document_root.'/'.$conffile); @@ -200,6 +224,16 @@ if ($perms) { print img_warning().' '.$langs->trans("FailedToReadFile", $conffile); } print '
'; +print '
'; + +$installlock = DOL_DATA_ROOT.'/install.lock'; +print ''.$langs->trans("DolibarrSetup").': '; +if (file_exists($installlock)) { + print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock); +} else { + print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT); +} +print '
'; // File conf.php @@ -209,15 +243,15 @@ print '
'; print '
'; print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', '', 'folder'); -print '$dolibarr_main_prod: '.$dolibarr_main_prod; +print '$dolibarr_main_prod: '.($dolibarr_main_prod ? $dolibarr_main_prod : '0'); if (empty($dolibarr_main_prod)) { print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1); } print '
'; -print '$dolibarr_nocsrfcheck: '.$dolibarr_nocsrfcheck; +print '$dolibarr_nocsrfcheck: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck); if (!empty($dolibarr_nocsrfcheck)) { - print img_picto('', 'warning').'   '.$langs->trans("IfYouAreOnAProductionSetThis", 0); + print '   '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0); } print '
'; @@ -226,59 +260,42 @@ if (empty($dolibarr_main_restrict_ip)) { print ''.$langs->trans("None").''; //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; } + print '
'; +if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) { + print '$dolibarr_main_db_pass: '; + if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) { + print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").'   ('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')'; + //print ' ('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')'; + } else { + print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated"); + } + + print '
'; +} + + // Menu security print '
'; print '
'; print '
'; + print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder'); -//print ''.$langs->trans("PasswordEncryption").': '; -print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; -if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { - print '     If unset: \'md5\''; -} + +print ''.$langs->trans("UseCaptchaCode").': '; +print empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? '' : img_picto('', 'tick').' '; +print yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1); print '
'; -if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
'; -} -if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { - print '
The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; - print 'If you really want to switch, you must:
'; - print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'
'; - print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password
'; - print '- You can now logout and login with this new password. You must now reset password of all other users.
'; - print '

'; -} -print '
'; - - -print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
"; -print '
'; - - -print 'MAIN_EXEC_USE_POPEN = '; -if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { - print ''.$langs->trans("Undefined").'   '; -} else { - print $conf->global->MAIN_EXEC_USE_POPEN.'   '; -} -if ($execmethod == 1) { - print ' --> "exec" PHP method will be used for shell commands.'; -} -if ($execmethod == 2) { - print ' --> "popen" PHP method will be used for shell commands.'; -} -print "
"; print '
'; print ''.$langs->trans("AntivirusEnabledOnUpload").': '; print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; -print yn($conf->global->MAIN_ANTIVIRUS_COMMAND ? 1 : 0); +print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1); if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; if (defined('MAIN_ANTIVIRUS_COMMAND')) { @@ -292,6 +309,7 @@ $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; print ''.$langs->trans("AuditedSecurityEvents").': '; +$out = ''; if (!empty($eventstolog) && is_array($eventstolog)) { // Loop on each event type $i = 0; @@ -301,18 +319,85 @@ if (!empty($eventstolog) && is_array($eventstolog)) { $value = empty($conf->global->$key) ? '' : $conf->global->$key; if ($value) { if ($i > 0) { - print ', '; + $out .= ', '; } - print ''.$key.''; + $out .= ''.$key.''; $i++; } } } - print '
'; -} else { - print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'
'; + print $out; } +if (empty($out)) { + print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security").' - '.$langs->transnoentities("Audit")).'
'; +} + +print '
'; +print '
'; +print '
'; +print '
'; + + +print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder'); + + +//print ''.$langs->trans("PasswordEncryption").': '; +print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_HASH_ALGO)."   "; +if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) { + print '     If unset: \'md5\''; +} +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print '
MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_SECURITY_SALT).'
'; +} else { + print '('.$langs->trans("Recommended").': password_hash)'; + print '
'; +} +if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') { + print '
The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.
'; + print 'If you really want to switch, you must:
'; + print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'
'; + print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password
'; + print '- You can now logout and login with this new password. You must now reset password of all other users.
'; + print '

'; +} +print '
'; + +print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."
"; +print '
'; + +print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).'   ('.$langs->trans("Recommended").': 0)
'; +print '
'; + +print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").'' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).'   ('.$langs->trans("Recommended").': 1)
'; +print '
'; + +print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."
"; +print '
'; + +print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Recommended").': 1)' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."
"; +print '
'; + +print 'MAIN_EXEC_USE_POPEN = '; +if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { + print ''.$langs->trans("Undefined").''; +} else { + print $conf->global->MAIN_EXEC_USE_POPEN; +} +if ($execmethod == 1) { + print ', "exec" PHP method will be used for shell commands'; + print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; + print ''; +} +if ($execmethod == 2) { + print ', "popen" PHP method will be used for shell commands'; + print '   ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)'; + print ''; +} +print "
"; +print '
'; + + // Modules/Applications @@ -363,7 +448,7 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) { print '
'; } if (!empty($conf->api->enabled)) { - print 'API_ENDPOINT_RULES = '.(empty($conf->global->API_ENDPOINT_RULES) ? ''.$langs->trans("Undefined").'' : $conf->global->API_ENDPOINT_RULES)."
\n"; + print 'API_ENDPOINT_RULES = '.(empty($conf->global->API_ENDPOINT_RULES) ? ''.$langs->trans("Undefined").'   ('.$langs->trans("Example").': endpoint1:1,endpoint2:1,...)' : $conf->global->API_ENDPOINT_RULES)."
\n"; print '
'; } } diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 428c80676a2..4f6977ffb41 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -136,7 +136,7 @@ $title = $langs->trans("Backup"); print load_fiche_titre($title, '', 'title_setup'); //print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup'); -print '
'; +print '
'; print $langs->trans("BackupDesc", DOL_DATA_ROOT); print '
'; print '
'; @@ -147,8 +147,11 @@ print ''; print ''; print '
1'; +print ''; print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'
'; //print $langs->trans("BackupDescY").'
'; +print '
'; + print '
'; print '
'; @@ -157,7 +160,7 @@ $title = $langs->trans("BackupDumpWizard"); print load_fiche_titre($title); -print '
#'.$langs->trans("TableName").''.$langs->trans("NbOfRecord").'
'.($i+1).''.$row[0].''.$count.'
'; +print '
'; print ''; print '\n"; diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 61d2b1cea58..10a38fb59a1 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -22,9 +22,14 @@ * \brief List of PHP sessions */ +if (! defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; + // Load translation files required by the page $langs->loadLangs(array("companies", "install", "users", "other")); @@ -185,14 +190,14 @@ print '
'; if (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { - print ''.$langs->trans("LockNewSessions").''; + print ''.$langs->trans("LockNewSessions").''; } else { - print ''.$langs->trans("UnlockNewSessions").''; + print ''.$langs->trans("UnlockNewSessions").''; } if ($savehandler == 'files') { if (count($listofsessions)) { - print ''.$langs->trans("PurgeSessions").''; + print ''.$langs->trans("PurgeSessions").''; } } diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index e20b9c2b13a..09647549c8b 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -21,15 +21,15 @@ * \brief Page to purge files (temporary or not) */ +if (! defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("admin"); -if (!$user->admin) { - accessforbidden(); -} - $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $choice = GETPOST('choice', 'aZ09'); @@ -42,10 +42,15 @@ if (!empty($conf->syslog->enabled)) { $filelog = preg_replace('/DOL_DATA_ROOT/i', DOL_DATA_ROOT, $filelog); } +if (!$user->admin) { + accessforbidden(); +} + /* * Actions */ + if ($action == 'purge' && !preg_match('/^confirm/i', $choice) && ($choice != 'allfiles' || $confirm == 'yes')) { // Increase limit of time. Works only if we are not in safe mode $ExecTimeLimit = 600; diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 5a6ff94ce57..821bcd9e3f3 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -22,6 +22,10 @@ * \brief Page to make a Dolibarr online upgrade */ +if (! defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -100,7 +104,7 @@ if (function_exists('curl_init')) { print $langs->trans("LastStableVersion").' : '.$langs->trans("UpdateServerOffline").'
'; } } else { - print $langs->trans("LastStableVersion").' : '.$langs->trans("Check").'
'; + print $langs->trans("LastStableVersion").' : '.$langs->trans("Check").'
'; } } @@ -113,14 +117,14 @@ print '
'; print $langs->trans("ThisIsProcessToFollow").'
'; print ''.$langs->trans("StepNb", 1).': '; $fullurl = ''.$urldolibarr.''; -print $langs->trans("DownloadPackageFromWebSite", $fullurl).'
'; +print str_replace('{s}', $fullurl, $langs->trans("DownloadPackageFromWebSite", '{s}')).'
'; print ''.$langs->trans("StepNb", 2).': '; -print $langs->trans("UnpackPackageInDolibarrRoot", $dolibarrroot).'
'; +print str_replace('{s}', $dolibarrroot, $langs->trans("UnpackPackageInDolibarrRoot", '{s}')).'
'; print ''.$langs->trans("StepNb", 3).': '; print $langs->trans("RemoveLock", $dolibarrdataroot.'/install.lock').'
'; print ''.$langs->trans("StepNb", 4).': '; $fullurl = ''.DOL_URL_ROOT.'/install/'; -print $langs->trans("CallUpdatePage", $fullurl).'
'; +print str_replace('{s}', $fullurl, $langs->trans("CallUpdatePage", '{s}')).'
'; print ''.$langs->trans("StepNb", 5).': '; print $langs->trans("RestoreLock", $dolibarrdataroot.'/install.lock').'
'; @@ -133,8 +137,9 @@ print '
'; print $langs->trans("AddExtensionThemeModuleOrOther").'
'; print '
'; - -print $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules")); +$texttoshow = $langs->trans("GoModuleSetupArea", DOL_URL_ROOT.'/admin/modules.php?mode=deploy', '{s2}'); +$texttoshow = str_replace('{s2}', img_picto('', 'tools', 'class="pictofixedwidth"').$langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Modules"), $texttoshow); +print $texttoshow; // End of page llxFooter(); diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 2ede168b601..3fa2e5d0af9 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -188,7 +188,7 @@ if ($action == 'delete') { $form = new Form($db); $formadmin = new FormAdmin($db); -$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración'; +$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción'; llxHeader('', $langs->trans("Setup"), $wikihelp); $param = '&mode='.urlencode($mode); @@ -296,19 +296,8 @@ if ($mode == 'overwrite') { print '
'; - // Limit to superadmin - /*if (! empty($conf->multicompany->enabled) && !$user->entity) - { - print ''; - print '\n"; print ''; @@ -500,7 +489,7 @@ if ($mode == 'searchkey') { //} print ''; // Action column - print ''; @@ -563,6 +552,21 @@ if ($mode == 'searchkey') { print '   '.img_picto($langs->trans('FixOnTransifex'), 'globe').''; } } else { + // retrieve rowid + $sql = "SELECT rowid"; + $sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; + $sql .= " WHERE entity IN (".getEntity('overwrite_trans').")"; + $sql .= " AND transkey = '".$db->escape($key)."'"; + dol_syslog("translation::select from table", LOG_DEBUG); + $result = $db->query($sql); + if ($result) { + $obj = $db->fetch_object($result); + } + print ''.img_edit().''; + print ' '; + print ''.img_delete().''; + print '  '; + $htmltext = $langs->trans("TransKeyWithoutOriginalValue", $key); print $form->textwithpicto('', $htmltext, 1, 'warning'); } diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 0dccf65e5e7..da3a1913d64 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -109,6 +109,7 @@ if ($action == 'set_default') { } } + /* * View */ @@ -126,6 +127,7 @@ $head = user_admin_prepare_head(); print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); +print '
'; print '
'; print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; @@ -554,8 +557,10 @@ print ''; print '
2'; +print ''; print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'
'; print $langs->trans("BackupDescX").'

'; +print '
'; print '
'; diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index 1fc0ca49221..29bfe5c12a4 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2006-2021 Laurent Destailleur * Copyright (C) 2006-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -22,6 +22,10 @@ * \brief Page to import database */ +if (! defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; // Load translation files required by the page @@ -72,7 +76,7 @@ jQuery(document).ready(function() { print load_fiche_titre($langs->trans("Restore"), '', 'title_setup'); -print '
'; +print '
'; print $langs->trans("RestoreDesc", DOL_DATA_ROOT); print '
'; print '
'; @@ -81,7 +85,9 @@ print '
';
1 '; print $langs->trans("RestoreDesc2", DOL_DATA_ROOT).'

'; +print ''; ?>
@@ -90,7 +96,9 @@ print $langs->trans("RestoreDesc2", DOL_DATA_ROOT).'

';
2 '; print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'

'; +print ''; ?> trans("DatabaseName").' : '.$dolibarr_main_db_name.''; ?>

diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 34685676320..384b08e19cf 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -22,6 +22,10 @@ * \brief Page to export documents into a compressed file */ +if (! defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index fbc2412a9df..d09551a5478 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -68,6 +68,7 @@ $search_user = GETPOST("search_user", "alpha"); $search_desc = GETPOST("search_desc", "alpha"); $search_ua = GETPOST("search_ua", "restricthtml"); $search_prefix_session = GETPOST("search_prefix_session", "restricthtml"); +$optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' except when 'print') $now = dol_now(); $nowarray = dol_getdate($now); @@ -372,7 +373,7 @@ if ($result) { print_liste_field_titre("UserAgent", $_SERVER["PHP_SELF"], "e.user_agent", "", $param, '', $sortfield, $sortorder); } if (!empty($arrayfields['e.prefix_session']['checked'])) { - print_liste_field_titre("PrefixSession", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder); + print_liste_field_titre("SuffixSessionName", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder); } print_liste_field_titre(''); print "
'; print ''; print ''; - print ''; - print ''; - } - else - {*/ - print ''; - print ''; - //} + print ''; + print ''; print ''; print "
'; + print ''; $searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1); print $searchpicto; print '
'; print ''; print ''; @@ -171,6 +173,7 @@ if ($conf->use_javascript_ajax) { print ''; print '
'.$langs->trans("Parameter").'
'; +print ''; print '
'; @@ -197,6 +200,7 @@ if ($resql) { print load_fiche_titre($langs->trans("UsersDocModules"), '', ''); +print '
'; print ''; print ''; print ''; @@ -264,7 +268,7 @@ foreach ($dirmodels as $reldir) { // Defaut print '
'.$langs->trans("Name").''; - if ($conf->global->USER_ADDON_PDF == $name) { + if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) { print img_picto($langs->trans("Default"), 'on'); } else { print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; @@ -306,7 +310,9 @@ foreach ($dirmodels as $reldir) { } print '
'; -print "
"; +print '
'; + +print '
'; print dol_get_fiche_end(); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 09156e08588..1b6fa5bebe7 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -91,15 +91,21 @@ $workflowcodes = array( ), // Automatic classification of order - 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( + 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), 'picto'=>'order' ), - 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( + 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, + 'enabled'=>(!empty($conf->expedition->enabled) && !empty($conf->commande->enabled)), + 'picto'=>'order' + ), + 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( + 'family'=>'classify_order', + 'position'=>42, 'enabled'=>(!empty($conf->facture->enabled) && !empty($conf->commande->enabled)), 'picto'=>'order', 'warning'=>'' diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 15d31140874..f5f301e9c16 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -200,7 +200,7 @@ class Setup extends DolibarrApi $sql = "SELECT id, code, type, libelle as label, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_paiement as t"; $sql .= " WHERE t.entity IN (".getEntity('c_paiement').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1013,7 +1013,7 @@ class Setup extends DolibarrApi $list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed; $list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique; $list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired; - $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? unserialize($tab->param) : ''); + $list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode() $list[$tab->elementtype][$tab->name]['pos'] = $tab->pos; $list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable; $list[$tab->elementtype][$tab->name]['perms'] = $tab->perms; @@ -1055,7 +1055,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid AS id, zip, town, fk_county, fk_pays AS fk_country"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ziptown as t"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); if ($zipcode) { $sql .= " AND t.zip LIKE '%".$this->db->escape($zipcode)."%'"; } @@ -1125,7 +1125,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid as id, code, sortorder, libelle as label, libelle_facture as descr, type_cdr, nbjour, decalage, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_payment_term as t"; $sql .= " WHERE t.entity IN (".getEntity('c_payment_term').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1183,7 +1183,7 @@ class Setup extends DolibarrApi $sql = "SELECT rowid as id, code, libelle as label, description, tracking, module"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t"; $sql .= " WHERE t.entity IN (".getEntity('c_shipment_mode').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -1307,7 +1307,7 @@ class Setup extends DolibarrApi $sql = "SELECT t.rowid, t.entity, t.code, t.label, t.url, t.icon, t.active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_socialnetworks as t"; $sql .= " WHERE t.entity IN (".getEntity('c_socialnetworks').")"; - $sql .= " AND t.active = ".$active; + $sql .= " AND t.active = ".((int) $active); // Add sql filters if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index 36c654c28ba..335cd63115a 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -332,7 +332,7 @@ class AssetType extends CommonObject /** * Return array of Asset objects for asset type this->id (or all if this->id not defined) * - * @param string $excludefilter Filter to exclude. This parameter must not be provided by input of users + * @param string $excludefilter Filter string to exclude. This parameter must not be provided by input of users * @param int $mode 0=Return array of asset instance * 1=Return array of asset instance without extra data * 2=Return array of asset id only @@ -347,7 +347,7 @@ class AssetType extends CommonObject $sql = "SELECT a.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."asset as a"; $sql .= " WHERE a.entity IN (".getEntity('asset').")"; - $sql .= " AND a.fk_asset_type = ".$this->id; + $sql .= " AND a.fk_asset_type = ".((int) $this->id); if (!empty($excludefilter)) { $sql .= ' AND ('.$excludefilter.')'; } diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index e6f5ed9b353..b4ee3a0a175 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -40,12 +40,6 @@ $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result=restrictedArea($user, 'asset', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -69,6 +63,14 @@ if ($object->fetch($id)) { $upload_dir = $conf->asset->dir_output."/".dol_sanitizeFileName($object->ref); } +$permissiontoadd = $user->rights->asset->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result=restrictedArea($user, 'asset', $id, ''); + /* * Actions @@ -126,7 +128,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'asset'; - $permission = $user->rights->asset->write; + $permissiontoadd = $user->rights->asset->write; $permtoedit = $user->rights->asset->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 1e906677e7d..1d994e25177 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -103,7 +103,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -305,21 +305,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; @@ -542,6 +527,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index 752591ade9e..16af18d8277 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -70,8 +70,13 @@ $permissionnote = 1; * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* * View diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 6b59c009ae7..265c12dd49c 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -613,8 +613,10 @@ jQuery(document).ready(function () { var fk_block = $(this).attr("data-blockid"); $.ajax({ - url:"../ajax/block-info.php?id="+fk_block - ,dataType:"html" + method: "GET", + data: { token: \''.currentToken().'\' }, + url: "'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block, + dataType: "html" }).done(function(data) { jQuery("#dialogforpopup").html(data); }); @@ -630,10 +632,11 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->glob '; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewBOM"), '', 'bom'); @@ -548,10 +532,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea */ if (!empty($object->table_element_line)) { - print '
+ print ' + '; diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index c0196670cfb..dd0227e4305 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -76,7 +76,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 if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/bom/".get_exdir(0, 0, 0, 1, $object); + $upload_dir = $conf->bom->multidir_output[$object->entity ? $object->entity : 1]."/".get_exdir(0, 0, 0, 1, $object); } // Security check - Protection if external user @@ -85,6 +85,8 @@ if ($id > 0 || !empty($ref)) { $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft); +$permissiontoadd = $user->rights->bom->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions @@ -145,12 +147,12 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'bom'; - $permission = $user->rights->bom->write; + $permissiontoadd = $user->rights->bom->write; $permtoedit = $user->rights->bom->write; $param = '&id='.$object->id; //$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/'; + $relativepathwithnofile = dol_sanitizeFileName($object->ref).'/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 2fa59d8d6ef..2cd7492395d 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -83,37 +83,38 @@ foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } } // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } -// Definition of fields for list +// Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} +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'); @@ -134,7 +135,8 @@ $result = restrictedArea($user, 'bom'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -154,8 +156,12 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } } - $toselect = ''; + $toselect = array(); $search_array_options = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -279,22 +285,19 @@ $form = new Form($db); $now = dol_now(); $help_url = 'EN:Module_BOM'; - $title = $langs->trans('ListOfBOMs'); - -llxHeader('', $title, $help_url); +$morejs = array(); +$morecss = array(); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.' ' : ''); } } // Add fields from hooks @@ -303,33 +306,52 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } +//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear); // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks @@ -338,18 +360,20 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY " +$sql.= " GROUP BY "; foreach($object->fields as $key => $val) { $sql.='t.'.$key.', '; } // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -395,7 +419,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -// llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -420,6 +444,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -435,7 +463,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -444,11 +472,12 @@ print ''; print ''; print ''; +print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendBillOfMaterialsRef"; @@ -508,11 +537,18 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '
'; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth150', 1); - } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
'; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; } print '
'.$langs->trans("BehaviourOnClick").''; $liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow")); - print $form->selectarray('target', $liste, 1); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1); print ''.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("AddIn").''; + print img_picto($langs->trans("ParentCategory"), 'category', 'class="pictofixedwidth"'); print $form->select_all_categories($type, $catorigin, 'parent'); print ajax_combobox('parent'); print '
'; +$morethan1level = 0; +foreach ($data as $record) { + if (!empty($record['fk_menu']) && $record['fk_menu'] > 0) { + $morethan1level = 1; + } +} + + +print '
'; print ''; -$nbofentries = (count($data) - 1); if ($nbofentries > 0) { print ''; // Done by - if ($conf->global->AGENDA_ENABLE_DONEBY) { + if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { print '\n"; /* - echo '
'; - echo '
'; - echo '
'; - echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1); - echo '
'."\n"; - echo "
\n"; - */ + echo '
'; + echo '
'; + echo '
'; + echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1); + echo '
'."\n"; + echo "
\n"; + */ echo '
'.$langs->trans("Categories").''; -if (!empty($conf->use_javascript_ajax)) { - print ''; +if ($morethan1level && !empty($conf->use_javascript_ajax)) { + print ''; } print '
'; tree_recur($data, $data[0], 0); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index eeca990ef28..8ebb9f43b1e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -142,6 +142,11 @@ if ($id > 0 && $removeelem > 0) { $tmpobject = new User($db); $result = $tmpobject->fetch($removeelem); $elementtype = 'user'; + } elseif ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $tmpobject = new Ticket($db); + $result = $tmpobject->fetch($removeelem); + $elementtype = 'ticket'; } $result = $object->del_type($tmpobject, $elementtype); @@ -167,7 +172,8 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi if ($elemid && $action == 'addintocategory' && (($type == Categorie::TYPE_PRODUCT && ($user->rights->produit->creer || $user->rights->service->creer)) || ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer) || - ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) + ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer) || + ($type == Categorie::TYPE_TICKET && $user->rights->ticket->write) )) { if ($type == Categorie::TYPE_PRODUCT) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -181,6 +187,10 @@ if ($elemid && $action == 'addintocategory' && require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $newobject = new Societe($db); $elementtype = 'supplier'; + } elseif ($type == Categorie::TYPE_TICKET) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $newobject = new Ticket($db); + $elementtype = 'ticket'; } $result = $newobject->fetch($elemid); @@ -1024,6 +1034,78 @@ if ($type == Categorie::TYPE_WAREHOUSE) { } } +if ($type == Categorie::TYPE_TICKET) { + $permission = ($user->rights->categorie->creer || $user->rights->categorie->creer); + + $tickets = $object->getObjectsInCateg($type, 0, $limit, $offset); + if ($tickets < 0) { + dol_print_error($db, $object->error, $object->errors); + } else { + // Form to add record into a category + $showclassifyform = 1; + if ($showclassifyform) { + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print $langs->trans("AddTicketIntoCategory").'  '; + $form->selectTickets('', 'elemid'); + print '
'; + print '
'; + } + + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + print '
'; + $param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($tickets); $nbtotalofrecords = ''; $newcardbutton = ''; + print_barre_liste($langs->trans("Ticket"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'ticket', 0, $newcardbutton, '', $limit); + + + print ''."\n"; + print ''."\n"; + + if (count($tickets) > 0) { + $i = 0; + foreach ($tickets as $ticket) { + $i++; + if ($i > $limit) break; + + print "\t".''."\n"; + print '\n"; + print '\n"; + // Link to delete from category + print ''; + print "\n"; + } + } else { + print ''; + } + print "
'.$langs->trans("Ref").'
'; + print $ticket->getNomUrl(1); + print "'.$ticket->label."'; + if ($permission) { + print ""; + print $langs->trans("DeleteFromCat"); + print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft'); + print ""; + } + print '
'.$langs->trans("ThisCategoryHasNoItems").'
\n"; + + print '
'."\n"; + } +} // End of page llxFooter(); diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index f368378a281..245f90edf72 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -937,6 +937,7 @@ if ($action == 'create') { print ''; print ''; print ''; + print ''; if ($backtopage) { print ''; } @@ -1183,7 +1184,7 @@ if ($action == 'create') { $projectid = GETPOST('projectid', 'int'); print '
'.$langs->trans("Project").''; - print img_picto('', 'project', 'class="paddingrightonly"'); + print img_picto('', 'project', 'class="pictofixedwidth"'); print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' '; @@ -1430,6 +1431,7 @@ if ($id > 0) { print ''; print ''; print ''; + print ''; if ($backtopage) { print ''; } @@ -1821,7 +1823,7 @@ if ($id > 0) { $linkback = ''; // Link to other agenda views - $linkback .= img_picto($langs->trans("BackToList"), 'object_list-alt', 'class="hideonsmartphone pictoactionview"'); + $linkback .= img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"'); $linkback .= ''.$langs->trans("BackToList").''; $linkback .= ''; $linkback .= '
  • '; @@ -1984,7 +1986,7 @@ if ($id > 0) { print '
  • '.$langs->trans("ActionDoneBy").''; if ($object->userdoneid > 0) { $tmpuser = new User($db); @@ -2078,10 +2080,10 @@ if ($id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Reminders - if ($conf->global->AGENDA_REMINDER_EMAIL || $conf->global->AGENDA_REMINDER_BROWSER) { - $filtreuserid = $user->id; + if (!empty($conf->global->AGENDA_REMINDER_EMAIL) || !empty($conf->global->AGENDA_REMINDER_BROWSER)) { + $filteruserid = $user->id; if ($user->rights->agenda->allactions->read) { - $filtreuserid = 0; + $filteruserid = 0; } $object->loadReminders('', $filteruserid, false); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index d8bcd0efb1b..bbf86d87c59 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -261,7 +261,7 @@ class ActionComm extends CommonObject /** * @var int socpeople id linked to action */ - public $contactid; + public $contact_id; /** * @var Societe|null Company linked to action (optional) @@ -273,7 +273,7 @@ class ActionComm extends CommonObject /** * @var Contact|null Contact linked to action (optional) * @deprecated - * @see $contactid + * @see $contact_id */ public $contact; @@ -382,6 +382,7 @@ class ActionComm extends CommonObject */ const EVENT_FINISHED = 100; + /** * Constructor * @@ -738,6 +739,11 @@ class ActionComm extends CommonObject { global $langs; + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + dol_syslog(get_class($this)."::fetch Bad parameters", LOG_WARNING); + return -1; + } + $sql = "SELECT a.id,"; $sql .= " a.ref as ref,"; $sql .= " a.entity,"; @@ -747,7 +753,7 @@ class ActionComm extends CommonObject $sql .= " a.durationp,"; // deprecated $sql .= " a.datec,"; $sql .= " a.tms as datem,"; - $sql .= " a.code, a.label, a.note,"; + $sql .= " a.code, a.label, a.note as note_private,"; $sql .= " a.fk_soc,"; $sql .= " a.fk_project,"; $sql .= " a.fk_user_author, a.fk_user_mod,"; @@ -806,8 +812,8 @@ class ActionComm extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); - $this->note = $obj->note; // deprecated - $this->note_private = $obj->note; + $this->note = $obj->note_private; // deprecated + $this->note_private = $obj->note_private; $this->percentage = $obj->percentage; $this->authorid = $obj->fk_user_author; @@ -1817,7 +1823,7 @@ class ActionComm extends CommonObject $sql .= " a.datep2,"; // End $sql .= " a.durationp,"; // deprecated $sql .= " a.datec, a.tms as datem,"; - $sql .= " a.label, a.code, a.note, a.fk_action as type_id,"; + $sql .= " a.label, a.code, a.note as note_private, a.fk_action as type_id,"; $sql .= " a.fk_soc,"; $sql .= " a.fk_user_author, a.fk_user_mod,"; $sql .= " a.fk_user_action,"; @@ -1896,11 +1902,17 @@ class ActionComm extends CommonObject $userforfilter = new User($this->db); $result = $userforfilter->fetch('', $logint); if ($result > 0) { - $sql .= " AND ar.fk_element = ".$userforfilter->id; + $sql .= " AND ar.fk_element = ".((int) $userforfilter->id); } elseif ($result < 0 || $condition == '=') { $sql .= " AND ar.fk_element = 0"; } } + if ($key == 'module') { + $sql .= " AND c.module LIKE '%".$this->db->escape($value)."'"; + } + if ($key == 'status') { + $sql .= " AND a.status =".((int) $value); + } } $sql .= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import @@ -1938,7 +1950,8 @@ class ActionComm extends CommonObject $duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0; $event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : ""); - $event['desc'] = $obj->note; + + $event['desc'] = $obj->note_private; $event['startdate'] = $datestart; $event['enddate'] = $dateend; // Not required with type 'journal' $event['duration'] = $duration; // Not required with type 'journal' @@ -2327,7 +2340,7 @@ class ActionComm extends CommonObject $sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray); //Topic - $sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->trans('EventReminder')); + $sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder')); // Recipient $recipient = new User($this->db); @@ -2403,7 +2416,7 @@ class ActionComm extends CommonObject // Delete also very old past events (we do not keep more than 1 month record in past) $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; $sql .= " WHERE dateremind < '".$this->db->idate($now - (3600 * 24 * 32))."'"; - $sql .= " AND status = ".$actionCommReminder::STATUS_DONE; + $sql .= " AND status = ".((int) $actionCommReminder::STATUS_DONE); $resql = $this->db->query($sql); if (!$resql) { diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index f521fa2ab59..eb1ac59cfe0 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -88,6 +88,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$permissiontoadd = $user->rights->agenda->myactions->read; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php + /* * Actions @@ -145,7 +147,7 @@ if ($object->id > 0) { $out = ''; $out .= '
  • '.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewPerUser").''; - $out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"'); + $out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewCal").''; $out .= '
  • '.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewWeek").''; @@ -285,7 +287,7 @@ if ($object->id > 0) { $modulepart = 'actions'; - $permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; + $permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index d5457447100..c87af9558e8 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -138,16 +138,18 @@ if (empty($action) && !GETPOSTISSET('action')) { if ($action == 'default') { // When action is default, we want a calendar view and not the list $action = (($defaultview != 'show_list') ? $defaultview : 'show_month'); } -if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { +if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') { $action = 'show_month'; $day = ''; } // View by month -if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') { +if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') { $action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); } // View by week -if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') { +if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') { $action = 'show_day'; $day = ($day ? $day : date("d")); } // View by day +$object = new ActionComm($db); + // Load translation files required by the page $langs->loadLangs(array('agenda', 'other', 'commercial')); @@ -197,6 +199,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') { exit; } +/* if ($action == 'delete_action') { $event = new ActionComm($db); $event->fetch($actionid); @@ -206,6 +209,7 @@ if ($action == 'delete_action') { $result = $event->delete(); } +*/ /* @@ -363,9 +367,9 @@ if ($action == 'show_day') { //print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour'); /*$title = $langs->trans("DoneAndToDoActions"); -if ($status == 'done') $title = $langs->trans("DoneActions"); -if ($status == 'todo') $title = $langs->trans("ToDoActions"); -*/ + if ($status == 'done') $title = $langs->trans("DoneActions"); + if ($status == 'todo') $title = $langs->trans("ToDoActions"); + */ $param = ''; if ($actioncode || GETPOSTISSET('search_actioncode')) { @@ -454,13 +458,13 @@ $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : ''); /*$tabactive = ''; -if ($action == 'show_month') $tabactive = 'cardmonth'; -if ($action == 'show_week') $tabactive = 'cardweek'; -if ($action == 'show_day') $tabactive = 'cardday'; -if ($action == 'show_list') $tabactive = 'cardlist'; -if ($action == 'show_pertuser') $tabactive = 'cardperuser'; -if ($action == 'show_pertype') $tabactive = 'cardpertype'; -*/ + if ($action == 'show_month') $tabactive = 'cardmonth'; + if ($action == 'show_week') $tabactive = 'cardweek'; + if ($action == 'show_day') $tabactive = 'cardday'; + if ($action == 'show_list') $tabactive = 'cardlist'; + if ($action == 'show_pertuser') $tabactive = 'cardperuser'; + if ($action == 'show_pertype') $tabactive = 'cardpertype'; + */ $paramnoaction = preg_replace('/action=[a-z_]+/', '', $param); $paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate); @@ -480,36 +484,34 @@ print ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewPerUser").''; -$viewmode .= ''; - // Add more views from hooks $parameters = array(); $object = null; $reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action); @@ -519,6 +521,8 @@ if (empty($reshook)) { $viewmode = $hookmanager->resPrint; } +$viewmode .= ''; // To add a space before the navigation tools + $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { @@ -741,10 +745,10 @@ if ($status == 'todo') { if ($filtert > 0 || $usergroup > 0) { $sql .= " AND ("; if ($filtert > 0) { - $sql .= "ar.fk_element = ".$filtert; + $sql .= "ar.fk_element = ".((int) $filtert); } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } @@ -925,13 +929,13 @@ if ($showbirthday) { $eventarray[$daykey][] = $event; /*$loop = true; - $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee); - do { - $eventarray[$daykey][] = $event; - $daykey += 60 * 60 * 24; - if ($daykey > $event->date_end_in_calendar) $loop = false; - } while ($loop); - */ + $daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee); + do { + $eventarray[$daykey][] = $event; + $daykey += 60 * 60 * 24; + if ($daykey > $event->date_end_in_calendar) $loop = false; + } while ($loop); + */ $i++; } } else { @@ -939,6 +943,7 @@ if ($showbirthday) { } } +// LEAVE CALENDAR $sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = x.fk_user"; @@ -1543,13 +1548,13 @@ if (empty($action) || $action == 'show_month') { // View by month echo "
  • '; print '
    '; @@ -1793,7 +1798,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { if ($user->rights->agenda->allactions->create || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { - $cssclass .= " movable cursormove"; + $cssclass .= " movable cursormove"; } else { $cssclass .= " unmovable"; } @@ -1877,7 +1882,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cacheusers[$tmpid] = $newuser; } - $listofusertoshow .= '
    '.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); + $listofusertoshow = ''; + $listofusertoshow .= '
    '.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom'); print $listofusertoshow; } else { // Other calendar // Picto diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index f5d1c65b267..071d6409176 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -73,7 +73,7 @@ $linkback .= ''.$langs->trans(" $out = ''; $out .= '
  • '.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewPerUser").''; -$out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"'); +$out .= '
  • '.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewCal").''; $out .= '
  • '.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"'); $out .= ''.$langs->trans("ViewWeek").''; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 96a69403289..9c587a934e2 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -47,7 +47,7 @@ $massaction = GETPOST('massaction', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search $resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); $pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); -$search_status = (GETPOST("search_status", 'alpha') != '') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); $optioncss = GETPOST('optioncss', 'alpha'); $year = GETPOST("year", 'int'); @@ -106,7 +106,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if ($page == -1 || $page == null) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } $offset = $limit * $page; @@ -320,7 +321,7 @@ if ($search_title != '') { $param .= '&search_title='.urlencode($search_title); } if ($search_note != '') { - $param .= '&search_note='.$search_note; + $param .= '&search_note='.urlencode($search_note); } if (GETPOST('datestartday', 'int')) { $param .= '&datestartday='.GETPOST('datestartday', 'int'); @@ -390,7 +391,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) "; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object)"; if (!$user->rights->societe->client->voir && !$socid) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; } @@ -520,6 +521,7 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + // TODO Set and use an optimized request in $sqlforcount with no fields and no useless join to caluclate nb of records $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 @@ -576,8 +578,8 @@ if ($resql) { //print dol_get_fiche_end(); // Add link to show birthdays - $link = ''; /* + $link = ''; if (empty($conf->use_javascript_ajax)) { $newparam=$param; // newparam is for birthday links @@ -606,13 +608,13 @@ if ($resql) { $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; - $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); + $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; - $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); + $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; @@ -829,13 +831,17 @@ if ($resql) { $actionstatic->location = $obj->location; $actionstatic->note_private = dol_htmlentitiesbr($obj->note); - $actionstatic->fetchResources(); + // Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid + // but only if we need it + if (!empty($arrayfields['a.fk_contact']['checked'])) { + $actionstatic->fetchResources(); + } print ''; // Ref if (!empty($arrayfields['a.id']['checked'])) { - print ''; + print ''; print $actionstatic->getNomUrl(1, -1); print ''; } @@ -1006,7 +1012,7 @@ if ($resql) { } if (!empty($arrayfields['a.percent']['checked'])) { // Status/Percent - $datep = $db->jdate($obj->datep); + $datep = $db->jdate($obj->dp); print ''.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).''; } // Action column diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 19f8a8ce31c..b39d6c3141d 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -416,13 +416,13 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; @@ -616,7 +616,7 @@ if ($filtert > 0 || $usergroup > 0) { $sql .= "ar.fk_element = ".$filtert; } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 62af33b34ee..10d9871c4c9 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -426,13 +426,13 @@ $massactionbutton = ''; $viewmode = ''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; $viewmode .= ''; //$viewmode .= ''; -$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); +$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; @@ -637,7 +637,7 @@ if ($filtert > 0 || $usergroup > 0) { $sql .= "ar.fk_element = ".$filtert; } if ($usergroup > 0) { - $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup; + $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".((int) $usergroup); } $sql .= ")"; } @@ -899,7 +899,7 @@ while ($currentdaytoshow < $lastdaytoshow) { } $sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")"; if ($usergroup > 0) { - $sql .= " AND ug.fk_usergroup = ".$usergroup; + $sql .= " AND ug.fk_usergroup = ".((int) $usergroup); } //print $sql; $resql = $db->query($sql); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index a90bc1cf5a3..9b6238ca0de 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -43,7 +43,8 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if ($page == -1 || $page == null) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; } $offset = $limit * $page; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..fefee1c07dd 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -184,6 +184,15 @@ if (empty($reshook)) { } } + // transport mode + if ($action == 'settransportmode' && $user->rights->societe->creer) { + $object->fetch($id); + $result = $object->setTransportMode(GETPOST('transport_mode_id', 'alpha')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // Bank account if ($action == 'setbankaccount' && $user->rights->societe->creer) { $object->fetch($id); @@ -531,6 +540,7 @@ if ($object->id > 0) { print ""; print ''; } + // Warehouse if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) { $langs->load('stocks'); @@ -543,11 +553,15 @@ if ($object->id > 0) { if ($action == 'editwarehouse') { $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'fk_warehouse', 1); } else { + if ($object->fk_warehouse > 0) { + print img_picto('', 'stock', 'class="paddingrightonly"'); + } $formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'none'); } print ''; print ''; } + // Preferred shipping Method if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { print ''; @@ -580,9 +594,9 @@ if ($object->id > 0) { print ''; print ''; if ($action == 'edittransportmode') { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->transport_mode_id) ? $object->transport_mode_id : ''), 'transport_mode_id', 1); } else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'none'); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->transport_mode_id) ? $object->transport_mode_id : ''), 'none'); } print ""; print ''; @@ -874,6 +888,7 @@ if ($object->id > 0) { $sql .= ", c.total_ttc"; $sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture"; $sql .= ", c.date_commande as dc"; + $sql .= ", c.facture as billed"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 9945ca0e186..1d74cba61cd 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -104,23 +104,15 @@ if ($type == "f") { if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } - -if (dol_strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=".$db->escape($stcomm); -} - if (!empty($search_lastname)) { $sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'"; } - if (!empty($search_firstname)) { $sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'"; } - if (!empty($search_company)) { $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } - if (!empty($contactname)) { // acces a partir du module de recherche $sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') "; $sortfield = "p.name"; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 0a39e596ba3..48e08ce3c0d 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -65,6 +65,8 @@ $socid = GETPOST("socid", 'int'); if ($user->socid > 0) { $action = ''; $id = $user->socid; +} else { + $id = 0; } restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); @@ -180,7 +182,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''; print ''.$propalstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'customer').''; - print ''.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).''; + print ''.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).''; print ''; $i++; @@ -276,7 +278,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa print ''; print ''.$supplierproposalstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'supplier').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -373,7 +375,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''; print ''.$orderstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'customer').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -470,7 +472,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''; print ''.$supplierorderstatic->getNomUrl(1).''; print ''.$companystatic->getNomUrl(1, 'supplier').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''; $i++; @@ -495,6 +497,50 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU } } + +/* + * Draft interventionals + */ +if (!empty($conf->ficheinter->enabled)) { + $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; + $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql .= " AND f.fk_soc = s.rowid"; + $sql .= " AND f.fk_statut = 0"; + if ($socid) { + $sql .= " AND f.fk_soc = ".((int) $socid); + } + if (!$user->rights->societe->client->voir && !$socid) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + } + + $resql = $db->query($sql); + if ($resql) { + print '
    '; + print ''; + print ''; + print ''; + $langs->load("fichinter"); + $num = $db->num_rows($resql); + if ($num) { + $i = 0; + while ($i < $num) { + $obj = $db->fetch_object($resql); + print ''; + print '"; + print ''; + $i++; + } + } + print "
    '.$langs->trans("DraftFichinter").'
    '; + print "rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'
    "; + } +} + print '
  • '; print '
    '; @@ -860,7 +906,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { print ''.$companystatic->getNomUrl(1, 'customer', 44).''; print ''.dol_print_date($db->jdate($obj->dp), 'day').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$propalstatic->LibStatut($obj->fk_statut, 3).''; print ''; @@ -977,7 +1023,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { print ''.$companystatic->getNomUrl(1, 'customer', 44).''; print ''.dol_print_date($db->jdate($obj->dv), 'day').''; - print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; + print ''.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).''; print ''.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).''; print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 86aff8a36e0..e03d13c29e8 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -48,6 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $urlfrom = GETPOST('urlfrom'); $object = new Mailing($db); + $result = $object->fetch($id); $extrafields = new ExtraFields($db); @@ -78,7 +79,7 @@ $listofmethods['mail'] = 'PHP mail function'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; // Security check -if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { +if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { accessforbidden(); } @@ -408,7 +409,7 @@ if (empty($reshook)) { dol_syslog($db->error()); dol_print_error($db); } - + $object->fetch($id); $action = ''; } } @@ -576,7 +577,6 @@ if (empty($reshook)) { if (!$isupload) { $mesgs = array(); - $object->sujet = (string) GETPOST("sujet"); $object->body = (string) GETPOST("bodyemail", 'restricthtml'); $object->bgcolor = (string) GETPOST("bgcolor"); @@ -743,7 +743,7 @@ if ($action == 'create') { print '
    '; // wysiwyg editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtml'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); + $doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%'); $doleditor->Create(); print '
    '; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index afd6273d6c0..3f2cfc2974c 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2016 Laurent Destailleur + * Copyright (C) 2005-2021 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2014 Florian Henry * @@ -68,6 +68,8 @@ $modulesdir = dolGetModulesDirs('/mailings'); $object = new Mailing($db); $result = $object->fetch($id); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ciblescard', 'globalcard')); // Security check if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { @@ -335,6 +337,7 @@ if ($object->fetch($id) >= 0) { if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') { + $reg = array(); if (preg_match("/(.*)\.modules\.php$/i", $file, $reg)) { if ($reg[1] == 'example') { continue; @@ -438,6 +441,10 @@ if ($object->fetch($id) >= 0) { } } // End foreach dir + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + print '
    '; print '

    '; @@ -528,9 +535,9 @@ if ($object->fetch($id) >= 0) { $morehtmlcenter = ''; if ($allowaddtarget) { - $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").' id.'" class="button reposition">'.$langs->trans("TargetsReset").''; + $morehtmlcenter = ''.$langs->trans("ToClearAllRecipientsClickHere").' id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").''; } - $morehtmlcenter .= ' id.'">'.$langs->trans("Download").''; + $morehtmlcenter .= '   id.'">'.$langs->trans("Download").''; print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index aed8bd1431f..d281fcb1a3a 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -208,6 +208,12 @@ class Mailing extends CommonObject { global $conf, $langs; + // Check properties + if ($this->body === 'InvalidHTMLString') { + $this->error = 'InvalidHTMLString'; + return -1; + } + $this->db->begin(); $this->title = trim($this->title); @@ -257,6 +263,12 @@ class Mailing extends CommonObject */ public function update($user) { + // Check properties + if ($this->body === 'InvalidHTMLString') { + $this->error = 'InvalidHTMLString'; + return -1; + } + $sql = "UPDATE ".MAIN_DB_PREFIX."mailing "; $sql .= " SET titre = '".$this->db->escape($this->title)."'"; $sql .= ", sujet = '".$this->db->escape($this->sujet)."'"; @@ -493,22 +505,44 @@ class Mailing extends CommonObject /** * Delete emailing * - * @param int $rowid id du mailing a supprimer - * @return int 1 en cas de succes + * @param int $rowid Id if emailing to delete + * @param int $notrigger Disable triggers + * @return int >0 if OK, <0 if KO */ - public function delete($rowid) + public function delete($rowid, $notrigger = 0) { + global $user; + + $this->db->begin(); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing"; $sql .= " WHERE rowid = ".((int) $rowid); dol_syslog("Mailing::delete", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - return $this->delete_targets(); + $res = $this->delete_targets(); + if ($res <= 0) { + $this->db->rollback(); + $this->error = $this->db->lasterror(); + return -1; + } } else { + $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } + + if (!$notrigger) { + $result = $this->call_trigger('MAILING_DELETE', $user); + if ($result < 0) { + $this->db->rollback(); + return -1; + } + } + + $this->db->commit(); + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 026acfc43b8..01abc1e5ef1 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -21,7 +21,7 @@ /** * \file htdocs/comm/mailing/index.php * \ingroup mailing - * \brief Page accueil de la zone mailing + * \brief Home page for emailing area */ require '../../main.inc.php'; @@ -34,8 +34,9 @@ $hookmanager = new HookManager($db); $hookmanager->initHooks(array('mailingindex')); // Load translation files required by the page -$langs->loadLangs(array('commercial', 'orders')); +$langs->loadLangs(array('commercial', 'orders', 'mails')); +$object = new Mailing($db); // Security check $result = restrictedArea($user, 'mailing'); @@ -46,9 +47,11 @@ $result = restrictedArea($user, 'mailing'); */ $help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; -llxHeader('', 'EMailing', $help_url); +$title = $langs->trans('MailingArea'); -print load_fiche_titre($langs->trans("MailingArea")); +llxHeader('', $title, $help_url); + +print load_fiche_titre($title); //print ''; //print '
    '; @@ -190,19 +193,9 @@ if ($result) { } -//print '
    '; print '
    '; -if ($langs->file_exists("html/spam.html", 0)) { - print "



    ".$langs->trans("Note")."
    "; - print '
    '; - dol_print_file($langs, "html/spam.html", 0); - print '
    '; - - print '
    '; -} - $parameters = array('user' => $user); $reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 984d77e7263..163581221a8 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -843,16 +843,16 @@ if (empty($reshook)) { } } - if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal. + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); $error++; } @@ -871,7 +871,7 @@ if (empty($reshook)) { } } - if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) { + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $pu_ht = 0; $pu_ttc = 0; $price_min = 0; @@ -885,7 +885,7 @@ if (empty($reshook)) { // Ecrase $desc par celui du produit // Ecrase $tva_tx par celui du produit // Replaces $fk_unit with the product unit - if (!empty($idprod)) { + if (!empty($idprod) && $idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -1436,11 +1436,9 @@ if (empty($reshook)) { */ $form = new Form($db); -$formother = new FormOther($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -$companystatic = new Societe($db); if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } @@ -1582,7 +1580,7 @@ if ($action == 'create') { //$warehouse_id = $soc->warehouse_id; } else { print ''; - print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500'); + print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); // reload page to retrieve customer informations if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; @@ -382,7 +376,9 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); -//if ($user->rights->monmodule->delete) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +//if ($permissiontodelete) { +// $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +//} if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } @@ -450,24 +446,24 @@ print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -538,6 +534,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -563,14 +560,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status'))) { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } + //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -582,6 +582,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } @@ -599,14 +605,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (in_array($object->id, $arrayofselected)) { $selected = 1; } - print ''; + print ''; } print ''; if (!$i) { $totalarray['nbfield']++; } - print ''; + print ''."\n"; $i++; } diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index a59816eebd7..dccfc852213 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -80,7 +80,7 @@ class CashControl extends CommonObject * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>10), + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>10), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>15), 'ref' =>array('type'=>'varchar(64)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>18), 'posmodule' =>array('type'=>'varchar(30)', 'label'=>'Module', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>19), @@ -93,10 +93,12 @@ class CashControl extends CommonObject 'year_close' =>array('type'=>'integer', 'label'=>'Year close', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>50, 'css'=>'center'), 'month_close' =>array('type'=>'integer', 'label'=>'Month close', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'css'=>'center'), 'day_close' =>array('type'=>'integer', 'label'=>'Day close', 'enabled'=>1, 'visible'=>1, 'position'=>60, 'css'=>'center'), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>490), 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), + 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>502), 'tms' =>array('type'=>'timestamp', 'label'=>'Tms', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>505), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>510), + 'fk_user_creat' =>array('type'=>'integer:User', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>600), + 'fk_user_valid' =>array('type'=>'integer:User', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>602), + 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>0, 'position'=>700), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated')), ); @@ -115,21 +117,24 @@ class CashControl extends CommonObject public $cheque; public $card; - /** - * @var integer|string $date_valid - */ - public $date_valid; - /** * @var integer|string date_creation */ public $date_creation; + public $fk_user_creat; /** * @var integer|string $date_modification */ public $date_modification; + /** + * @var integer|string $date_valid + */ + public $date_valid; + public $fk_user_valid; + + const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; const STATUS_CLOSED = 1; // For the moment CLOSED = VALIDATED @@ -409,7 +414,7 @@ class CashControl extends CommonObject $newref = ($this->ref ? $this->ref : $this->id); - $label = ''.$langs->trans("CashFence").''; + $label = ''.$langs->trans("CashControl").''; $label .= '
    '; $label .= ''.$langs->trans('Ref').': '.($this->ref ? $this->ref : $this->id); diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 653161ca3bc..0bc18e31bde 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -26,7 +26,7 @@ /** * \file htdocs/compta/cashcontrol/report.php * \ingroup cashdesk|takepos - * \brief List of bank transactions + * \brief List of sales from POS */ if (!defined('NOREQUIREMENU')) { @@ -36,6 +36,8 @@ if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); // Disable browser notification } +$_GET['optioncss'] = "print"; + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; @@ -48,10 +50,8 @@ $langs->loadLangs(array("bills", "banks")); $id = GETPOST('id', 'int'); -$_GET['optioncss'] = "print"; - -$cashcontrol = new CashControl($db); -$cashcontrol->fetch($id); +$object = new CashControl($db); +$object->fetch($id); //$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit; $sortorder = 'ASC'; @@ -67,19 +67,19 @@ $arrayfields = array( 'b.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1, 'position'=>605), ); -$syear = $cashcontrol->year_close; -$smonth = $cashcontrol->month_close; -$sday = $cashcontrol->day_close; +$syear = $object->year_close; +$smonth = $object->month_close; +$sday = $object->day_close; -$posmodule = $cashcontrol->posmodule; -$terminalid = $cashcontrol->posnumber; +$posmodule = $object->posmodule; +$terminalid = $object->posnumber; // Security check if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) { +if (empty($user->rights->cashdesk->run) && empty($user->rights->takepos->run)) { accessforbidden(); } @@ -106,8 +106,8 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON bu.url_id = f.rowid"; $sql.= " WHERE b.fk_account = ba.rowid"; // Define filter on invoice -$sql.= " AND f.module_source = '".$db->escape($cashcontrol->posmodule)."'"; -$sql.= " AND f.pos_source = '".$db->escape($cashcontrol->posnumber)."'"; +$sql.= " AND f.module_source = '".$db->escape($object->posmodule)."'"; +$sql.= " AND f.pos_source = '".$db->escape($object->posnumber)."'"; $sql.= " AND f.entity IN (".getEntity('facture').")"; // Define filter on data if ($syear && ! $smonth) $sql.= " AND dateo BETWEEN '".$db->idate(dol_get_first_day($syear, 1))."' AND '".$db->idate(dol_get_last_day($syear, 12))."'"; @@ -126,7 +126,7 @@ $sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = $sql .= " AND f.module_source = '".$db->escape($posmodule)."'"; $sql .= " AND f.pos_source = '".$db->escape($terminalid)."'"; $sql .= " AND f.paye = 1"; -$sql .= " AND p.entity = ".$conf->entity; // Never share entities for features related to accountancy +$sql .= " AND p.entity = ".$conf->entity; // Never share entities for features related to accountancy /*if ($key == 'cash') $sql.=" AND cp.code = 'LIQ'"; elseif ($key == 'cheque') $sql.=" AND cp.code = 'CHQ'"; elseif ($key == 'card') $sql.=" AND cp.code = 'CB'"; @@ -151,19 +151,33 @@ if ($resql) { $i = 0; print "\n"; - print "

    "; - if ($cashcontrol->status != $cashcontrol::STATUS_DRAFT) { - print $langs->trans("CashControl")." ".$cashcontrol->id; + print '
    '; + print '

    '; + if ($object->status != $object::STATUS_DRAFT) { + print $langs->trans("CashControl")." ".$object->id; } else { print $langs->trans("CashControl")." - ".$langs->trans("Draft"); } - print "
    ".$langs->trans("DateCreationShort").": ".dol_print_date($cashcontrol->date_creation, 'dayhour'); - print "

    "; + print "

    "; + print $mysoc->name; + print '
    '.$langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour'); + $userauthor = $object->fk_user_valid; + if (empty($userauthor)) { + $userauthor = $object->fk_user_creat; + } + + $uservalid = new User($db); + if ($userauthor > 0) { + $uservalid->fetch($userauthor); + print '
    '.$langs->trans("Author").': '.$uservalid->getFullName($langs); + } + print '
    '.$langs->trans("Period").': '.$object->year_close.($object->month_close ? '-'.$object->month_close : '').($object->day_close ? '-'.$object->day_close : ''); + print '
    '; $invoicetmp = new Facture($db); print "

    "; - print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash")." : ".price($cashcontrol->opening); + print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").' :
    '.price($object->opening).'
    '; print "

    "; print '
    '; @@ -182,15 +196,23 @@ if ($resql) { print "\n"; // Loop on each record - $sign = 1; $cash = $bank = $cheque = $other = 0; - $totalarray = array(); + $totalqty = 0; + $totalvat = 0; + $totalvatperrate = array(); + $totallocaltax1 = 0; + $totallocaltax2 = 0; $cachebankaccount = array(); + $cacheinvoiceid = array(); + $transactionspertype = array(); $amountpertype = array(); + + $totalarray = array(); while ($i < $num) { $objp = $db->fetch_object($resql); + // Load bankaccount if (empty($cachebankaccount[$objp->bankid])) { $bankaccounttmp = new Account($db); $bankaccounttmp->fetch($objp->bankid); @@ -202,14 +224,21 @@ if ($resql) { $invoicetmp->fetch($objp->facid); - /*if ($first == "yes") - { - print '
    '; - print ''; - print ''; - print ''; - $first = "no"; - }*/ + if (empty($cacheinvoiceid[$objp->facid])) { + $cacheinvoiceid[$objp->facid] = $objp->facid; // First time this invoice is found into list of invoice x payments + foreach ($invoicetmp->lines as $line) { + $totalqty += $line->qty; + $totalvat += $line->total_tva; + if ($line->tva_tx) { + if (empty($totalvatperrate[$line->tva_tx])) { + $totalvatperrate[$line->tva_tx] = 0; + } + $totalvatperrate[$line->tva_tx] += $line->total_tva; + } + $totallocaltax1 += $line->total_localtax1; + $totallocaltax2 += $line->total_localtax2; + } + } print ''; @@ -229,25 +258,42 @@ if ($resql) { $totalarray['nbfield']++; } - // Bank account - print '\n"; @@ -305,48 +351,60 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; print "
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print ''; } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
    '; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -505,7 +501,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -519,13 +515,13 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$ $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; print '
    '.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").''.price($cashcontrol->opening).'
    '; - print $bankaccount->getNomUrl(1); - if ($cashcontrol->posmodule == "takepos") { - $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$cashcontrol->posnumber; + if ($object->posmodule == "takepos") { + $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$object->posnumber; } else { $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'; } + + // Bank account + print ''; + print $bankaccount->getNomUrl(1); if ($objp->code == 'CHQ') { $cheque += $objp->amount; + if (empty($transactionspertype[$objp->code])) { + $transactionspertype[$objp->code] = 0; + } + $transactionspertype[$objp->code] += 1; } elseif ($objp->code == 'CB') { $bank += $objp->amount; + if (empty($transactionspertype[$objp->code])) { + $transactionspertype[$objp->code] = 0; + } + $transactionspertype[$objp->code] += 1; } else { if ($conf->global->$var1 == $bankaccount->id) { $cash += $objp->amount; // } elseif ($conf->global->$var2 == $bankaccount->id) $bank+=$objp->amount; //elseif ($conf->global->$var3 == $bankaccount->id) $cheque+=$objp->amount; + if (empty($transactionspertype['CASH'])) { + $transactionspertype['CASH'] = 0; + } + $transactionspertype['CASH'] += 1; } else { $other += $objp->amount; + if (empty($transactionspertype['OTHER'])) { + $transactionspertype['OTHER'] = 0; + } + $transactionspertype['OTHER'] += 1; } } print "
    "; + print ""; - //$cash = $amountpertype['LIQ'] + $cashcontrol->opening; - $cash = price2num($cash + $cashcontrol->opening, 'MT'); + //$cash = $amountpertype['LIQ'] + $object->opening; + $cash = price2num($cash + $object->opening, 'MT'); - print '

    '; - print $langs->trans("Cash").": ".price($cash); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cash != $cashcontrol->cash) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->cash).''; + print '
    '; + print '

    '; + + print $langs->trans("Cash").($transactionspertype['CASH'] ? ' ('.$transactionspertype['CASH'].')' : '').' :
    '.price($cash).'
    '; + if ($object->status == $object::STATUS_VALIDATED && $cash != $object->cash) { + print ' <>
    '.$langs->trans("Declared").': '.price($object->cash).'
    '; } - print "

    "; + print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCHQ").": ".price($cheque); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $cheque != $cashcontrol->cheque) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->cheque).''; + print $langs->trans("PaymentTypeCHQ").($transactionspertype['CHQ'] ? ' ('.$transactionspertype['CHQ'].')' : '').' :
    '.price($cheque).'
    '; + if ($object->status == $object::STATUS_VALIDATED && $cheque != $object->cheque) { + print ' <>
    '.$langs->trans("Declared").' : '.price($object->cheque).'
    '; } - print "

    "; + print "
    "; //print '
    '; - print $langs->trans("PaymentTypeCB").": ".price($bank); - if ($cashcontrol->status == $cashcontrol::STATUS_VALIDATED && $bank != $cashcontrol->card) { - print ' <> '.$langs->trans("Declared").': '.price($cashcontrol->card).''; + print $langs->trans("PaymentTypeCB").($transactionspertype['CB'] ? ' ('.$transactionspertype['CB'].')' : '').' :
    '.price($bank).'
    '; + if ($object->status == $object::STATUS_VALIDATED && $bank != $object->card) { + print ' <>
    '.$langs->trans("Declared").': '.price($object->card).'
    '; } - print "

    "; + print "
    "; // print '
    '; if ($other) { - print '
    '.$langs->trans("Other").": ".price($other)."

    "; + print ''.$langs->trans("Other").($transactionspertype['OTHER'] ? ' ('.$transactionspertype['OTHER'].')' : '').' :
    '.price($other)."
    "; + print '
    '; } - print "

    "; - //save totals to DB - /* - $sql = "UPDATE ".MAIN_DB_PREFIX."pos_cash_fence "; - $sql .= "SET"; - $sql .= " cash='".$db->escape($cash)."'"; - $sql .= ", card='".$db->escape($bank)."'"; - $sql .= " where rowid = ".((int) $id); - $db->query($sql); - */ + print $langs->trans("Total").' ('.$totalqty.' '.$langs->trans("Articles").') :
    '.price($cash + $cheque + $bank + $other).'
    '; - print "

    "; + print '
    '.$langs->trans("TotalVAT").' :
    '.price($totalvat).'
    '; + + if ($mysoc->useLocalTax(1)) { + print '
    '.$langs->trans("TotalLT1").' :
    '.price($totallocaltax1).'
    '; + } + if ($mysoc->useLocalTax(1)) { + print '
    '.$langs->trans("TotalLT2").' :
    '.price($totallocaltax2).'
    '; + } + + if (!empty($totalvatperrate) && is_array($totalvatperrate)) { + print '

    '.$langs->trans("VATRate").'
    '; + foreach ($totalvatperrate as $keyrate => $valuerate) { + print '
    '.$langs->trans("VATRate").' '.vatrate($keyrate, 1).' :
    '.price($valuerate).'
    '; + } + } + + print ''; + print ''; print ''; diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f171546f6c1..be7c88c0a1a 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -227,9 +227,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; @@ -348,9 +349,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 60924dae644..b0a4716b7e1 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -71,7 +71,7 @@ llxHeader(); $thirdpartystatic = new Societe($db); if ($action == 'note') { - $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($note)."' WHERE rowid=".$socid; + $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET note='".$db->escape($note)."' WHERE rowid=".((int) $socid); $result = $db->query($sql); } @@ -107,29 +107,21 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (dol_strlen($stcomm)) { - $sql .= " AND s.fk_stcomm=".$stcomm; + $sql .= " AND s.fk_stcomm=".((int) $stcomm); } -if ($socname) { - $sql .= natural_search("s.nom", $socname); - $sortfield = "s.nom"; - $sortorder = "ASC"; -} -if ($_GET["search_nom"]) { +if (GETPOST("search_nom")) { $sql .= natural_search("s.nom", GETPOST("search_nom")); } -if ($_GET["search_compta"]) { +if (GETPOST("search_compta")) { $sql .= natural_search("s.code_compta", GETPOST("search_compta")); } -if ($_GET["search_code_client"]) { +if (GETPOST("search_code_client")) { $sql .= natural_search("s.code_client", GETPOST("search_code_client")); } -if (dol_strlen($begin)) { - $sql .= natural_search("s.nom", $begin); -} if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } -$sql .= " ORDER BY $sortfield $sortorder "; +$sql .= " ORDER BY $sortfield $sortorder"; $sql .= $db->plimit($conf->liste_limit + 1, $offset); //print $sql; diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index bd4437715d8..cdb4b5f0f0f 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -126,7 +126,7 @@ if ($object->id) { print ''; $modulepart = 'deplacement'; - $permission = $user->rights->deplacement->creer; + $permissiontoadd = $user->rights->deplacement->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 673cd7c1972..edc590119ef 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -63,8 +63,7 @@ if ($userid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $mode = GETPOST("mode") ?GETPOST("mode") : 'customer'; @@ -243,7 +242,8 @@ print ''.$langs->tra // Company print ''.$langs->trans("ThirdParty").''; $filter = ''; -print $form->select_company($socid, 'socid', $filter, 1, 1, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 1, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print ''; // User print ''.$langs->trans("User").''; @@ -251,7 +251,8 @@ $include = ''; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) { $include = 'hierarchy'; } -print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Year print ''.$langs->trans("Year").''; @@ -261,7 +262,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

    '; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 9341197c312..affdd2e8991 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->loadLangs(array('bills', 'compta', 'admin', 'other', 'products', 'banks')); +$langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks')); $action = GETPOST('action', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); @@ -193,11 +193,11 @@ if (empty($reshook)) { $action = "create"; $error++; } - if ($nb_gen_max === '') { + /*if ($nb_gen_max === '') { setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("MaxPeriodNumber")), null, 'errors'); $action = "create"; $error++; - } + }*/ } if (!$error) { @@ -447,15 +447,15 @@ if (empty($reshook)) { } } - if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { + if ((empty($idprod) || $idprod < 0) && ($price_ht < 0) && ($qty < 0)) { setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) { // Unit price can be 0 but not '' setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -463,7 +463,7 @@ if (empty($reshook)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) { + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors'); $error++; } @@ -473,7 +473,7 @@ if (empty($reshook)) { $error++; } - if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) { + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $ret = $object->fetch($id); if ($ret < 0) { dol_print_error($db, $object->error); @@ -495,7 +495,7 @@ if (empty($reshook)) { // Ecrase $tva_tx par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (!empty($idprod)) { + if (!empty($idprod) && $idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -964,7 +964,7 @@ if ($action == 'create') { // Title print ''.$langs->trans("Title").''; - print ''; + print ''; print ''; // Third party diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e5b4b2d2398..5c21f2b9539 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -112,7 +112,12 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object if ($id > 0 || !empty($ref)) { if ($action != 'add') { - $ret = $object->fetch($id, $ref, '', '', $conf->global->INVOICE_USE_SITUATION); + if (empty($conf->global->INVOICE_USE_SITUATION)) { + $fetch_situation = false; + } else { + $fetch_situation = true; + } + $ret = $object->fetch($id, $ref, '', '', $fetch_situation); } } @@ -193,7 +198,7 @@ if (empty($reshook)) { exit(); } else { $langs->load("errors"); - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($objectutil->error, $objectutil->errors, 'errors'); $action = ''; } } elseif ($action == 'reopen' && $usercanreopen) { @@ -607,7 +612,7 @@ if (empty($reshook)) { } // Check for mandatory fields in invoice - $array_to_check = array('REF_CUSTOMER'=>'RefCustomer'); + $array_to_check = array('REF_CLIENT'=>'RefCustomer'); foreach ($array_to_check as $key => $val) { $keymin = strtolower($key); $vallabel = $object->$keymin; @@ -1364,7 +1369,7 @@ if (empty($reshook)) { $object->note_private = trim(GETPOST('note_private', 'restricthtml')); $object->ref_client = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); - $object->fk_project = GETPOST('projectid'); + $object->fk_project = GETPOST('projectid', 'int'); $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); @@ -1995,7 +2000,7 @@ if (empty($reshook)) { } } - if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { + if ((empty($idprod) || $idprod < 0) && ($price_ht < 0) && ($qty < 0)) { setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors'); $error++; } @@ -2005,11 +2010,11 @@ if (empty($reshook)) { $error++; } } - if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) { + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error++; } - if (($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) { // Unit price can be 0 but not '' + if (($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) { // Unit price can be 0 but not '' if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) { $langs->load("errors"); if ($object->type == $object::TYPE_DEPOSIT) { @@ -2052,7 +2057,7 @@ if (empty($reshook)) { } } - if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) { + if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { $ret = $object->fetch($id); if ($ret < 0) { dol_print_error($db, $object->error); @@ -2074,7 +2079,7 @@ if (empty($reshook)) { // Ecrase $tva_tx par celui du produit // Ecrase $base_price_type par celui du produit // Replaces $fk_unit with the product's - if (!empty($idprod)) { + if (!empty($idprod) && $idprod > 0) { $prod = new Product($db); $prod->fetch($idprod); @@ -2232,6 +2237,14 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { + // Add batchinfo if the detail_batch array is defined + if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + $langs->load('productbatch'); + foreach ($lines[$i]->detail_batch as $batchline) { + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; + } + } + // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise); @@ -2354,25 +2367,26 @@ if (empty($reshook)) { $line = new FactureLigne($db); $line->fetch(GETPOST('lineid', 'int')); $percent = $line->get_prev_progress($object->id); + $progress = price2num(GETPOST('progress', 'alpha')); if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->situation_cycle_ref > 0) { // in case of situation credit note - if (GETPOST('progress') >= 0) { + if ($progress >= 0) { $mesg = $langs->trans("CantBeNullOrPositive"); setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; - } elseif (GETPOST('progress') < $line->situation_percent) { // TODO : use a modified $line->get_prev_progress($object->id) result + } elseif ($progress < $line->situation_percent) { // TODO : use a modified $line->get_prev_progress($object->id) result $mesg = $langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $error++; $result = -1; + } elseif ($progress < $percent) { + $mesg = '
    '.$langs->trans("CantBeLessThanMinPercent").'
    '; + setEventMessages($mesg, null, 'warnings'); + $error++; + $result = -1; } - } elseif (GETPOST('progress') < $percent) { - $mesg = '
    '.$langs->trans("CantBeLessThanMinPercent").'
    '; - setEventMessages($mesg, null, 'warnings'); - $error++; - $result = -1; } // Check minimum price @@ -3053,7 +3067,7 @@ if ($action == 'create') { } else { print ''.$langs->trans('Customer').''; print ''; - print img_picto('', 'company').$form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print img_picto('', 'company').$form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); // Option to reload page to retrieve customer informations. if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) { print ''."\n"; } if (!GETPOSTISSET("no_email") && !empty($object->email)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } print ''; print ''; - print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1)).''; + print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS), 1, false, ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == -1)).''; print ''; } @@ -821,11 +849,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Other attributes $parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); - } + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print "
    "; @@ -996,6 +1020,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : $object->state_id, $object->country_code, 'state_id'); print ''; } @@ -1055,8 +1080,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; } if (!GETPOSTISSET("no_email") && !empty($object->email)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1133,11 +1158,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Other attributes $parameters = array('colspan' => ' colspan="3"', 'cols'=> '3'); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit', $parameters); - } + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; $object->load_ref_elements(); @@ -1294,8 +1315,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Unsubscribe opt-out if (!empty($conf->mailing->enabled)) { - $result=$object->getNoEmail(); - if ($result<0) { + $result = $object->getNoEmail(); + if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } print ''.$langs->trans("No_Email").''.yn($object->no_email).''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 78e4ffae99b..165a7bf7bc3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -100,15 +100,15 @@ class Contact extends CommonObject 'firstname' =>array('type'=>'varchar(50)', 'label'=>'Firstname', 'enabled'=>1, 'visible'=>1, 'position'=>50, 'showoncombobox'=>1, 'searchall'=>1), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>1, 'position'=>60), - 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>1, 'position'=>65), + 'town' =>array('type'=>'text', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'fk_departement' =>array('type'=>'integer', 'label'=>'Fk departement', 'enabled'=>1, 'visible'=>3, 'position'=>70), 'fk_pays' =>array('type'=>'integer', 'label'=>'Fk pays', 'enabled'=>1, 'visible'=>3, 'position'=>75), 'birthday' =>array('type'=>'date', 'label'=>'Birthday', 'enabled'=>1, 'visible'=>3, 'position'=>80), 'poste' =>array('type'=>'varchar(80)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'phone' =>array('type'=>'varchar(30)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>1, 'position'=>90, 'searchall'=>1), - 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'searchall'=>1), + 'phone_perso' =>array('type'=>'varchar(30)', 'label'=>'PhonePerso', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'searchall'=>1), 'phone_mobile' =>array('type'=>'varchar(30)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'searchall'=>1), - 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>1, 'position'=>105, 'searchall'=>1), + 'fax' =>array('type'=>'varchar(30)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'searchall'=>1), 'email' =>array('type'=>'varchar(255)', 'label'=>'Email', 'enabled'=>1, 'visible'=>1, 'position'=>110, 'searchall'=>1), 'socialnetworks' =>array('type'=>'text', 'label'=>'SocialNetworks', 'enabled'=>1, 'visible'=>3, 'position'=>115), 'photo' =>array('type'=>'varchar(255)', 'label'=>'Photo', 'enabled'=>1, 'visible'=>3, 'position'=>170), @@ -455,18 +455,18 @@ class Contact extends CommonObject $sql .= ") VALUES ("; $sql .= "'".$this->db->idate($now)."',"; if ($this->socid > 0) { - $sql .= " ".$this->db->escape($this->socid).","; + $sql .= " ".((int) $this->socid).","; } else { $sql .= "null,"; } $sql .= "'".$this->db->escape($this->lastname)."',"; $sql .= "'".$this->db->escape($this->firstname)."',"; - $sql .= " ".($user->id > 0 ? "'".$this->db->escape($user->id)."'" : "null").","; - $sql .= " ".$this->db->escape($this->priv).","; + $sql .= " ".($user->id > 0 ? ((int) $user->id) : "null").","; + $sql .= " ".((int) $this->priv).","; $sql .= " 0,"; - $sql .= " ".$this->db->escape($this->statut).","; + $sql .= " ".((int) $this->statut).","; $sql .= " ".(!empty($this->canvas) ? "'".$this->db->escape($this->canvas)."'" : "null").","; - $sql .= " ".$this->db->escape($this->entity).","; + $sql .= " ".((int) $this->entity).","; $sql .= "'".$this->db->escape($this->ref_ext)."',"; $sql .= " ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= ")"; @@ -539,14 +539,13 @@ class Contact extends CommonObject $this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity); // Clean parameters + $this->ref_ext = trim($this->ref_ext); $this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname); $this->firstname = trim($this->firstname); $this->email = trim($this->email); $this->phone_pro = trim($this->phone_pro); $this->phone_perso = trim($this->phone_perso); $this->phone_mobile = trim($this->phone_mobile); - $this->jabberid = trim($this->jabberid); - $this->skype = trim($this->skype); $this->photo = trim($this->photo); $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); @@ -561,18 +560,19 @@ class Contact extends CommonObject } $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET "; + $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; if ($this->socid > 0) { - $sql .= " fk_soc='".$this->db->escape($this->socid)."',"; + $sql .= " fk_soc = ".((int) $this->socid).","; } elseif ($this->socid == -1) { - $sql .= " fk_soc=null,"; + $sql .= " fk_soc = NULL,"; } - $sql .= " civility='".$this->db->escape($this->civility_code)."'"; + $sql .= " civility='".$this->db->escape($this->civility_code)."'"; $sql .= ", lastname='".$this->db->escape($this->lastname)."'"; $sql .= ", firstname='".$this->db->escape($this->firstname)."'"; $sql .= ", address='".$this->db->escape($this->address)."'"; $sql .= ", zip='".$this->db->escape($this->zip)."'"; $sql .= ", town='".$this->db->escape($this->town)."'"; + $sql .= ", ref_ext = ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "NULL"); $sql .= ", fk_pays=".($this->country_id > 0 ? $this->country_id : 'NULL'); $sql .= ", fk_departement=".($this->state_id > 0 ? $this->state_id : 'NULL'); $sql .= ", poste='".$this->db->escape($this->poste)."'"; @@ -581,21 +581,21 @@ class Contact extends CommonObject $sql .= ", socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; $sql .= ", photo='".$this->db->escape($this->photo)."'"; $sql .= ", birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null"); - $sql .= ", note_private = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null"); - $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null"); - $sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "null"); - $sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "null"); - $sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "null"); + $sql .= ", note_private = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "NULL"); + $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "NULL"); + $sql .= ", phone = ".(isset($this->phone_pro) ? "'".$this->db->escape($this->phone_pro)."'" : "NULL"); + $sql .= ", phone_perso = ".(isset($this->phone_perso) ? "'".$this->db->escape($this->phone_perso)."'" : "NULL"); + $sql .= ", phone_mobile = ".(isset($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "NULL"); $sql .= ", priv = '".$this->db->escape($this->priv)."'"; $sql .= ", fk_prospectcontactlevel = '".$this->db->escape($this->fk_prospectlevel)."'"; if (isset($this->stcomm_id)) { $sql .= ", fk_stcommcontact = ".($this->stcomm_id > 0 || $this->stcomm_id == -1 ? $this->stcomm_id : "0"); } - $sql .= ", statut = ".$this->db->escape($this->statut); + $sql .= ", statut = ".((int) $this->statut); $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$this->db->escape($user->id)."'" : "NULL"); $sql .= ", default_lang=".($this->default_lang ? "'".$this->db->escape($this->default_lang)."'" : "NULL"); - $sql .= ", entity = ".$this->db->escape($this->entity); - $sql .= " WHERE rowid=".$this->db->escape($id); + $sql .= ", entity = ".((int) $this->entity); + $sql .= " WHERE rowid=".((int) $id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $result = $this->db->query($sql); @@ -885,30 +885,32 @@ class Contact extends CommonObject $this->error = $this->db->lasterror(); } - // Mis a jour alerte birthday - if (!empty($this->birthday_alert)) { - //check existing - $sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id; - $result_check = $this->db->query($sql_check); - if (!$result_check || ($this->db->num_rows($result_check) < 1)) { - //insert - $sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type,fk_contact,fk_user) "; - $sql .= "VALUES (1,".$this->db->escape($id).",".$user->id.")"; + if ($user) { + // Update birthday alert + if (!empty($this->birthday_alert)) { + //check existing + $sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type = 1 AND fk_contact = " . ((int) $id) . " AND fk_user = " . ((int) $user->id); + $result_check = $this->db->query($sql_check); + if (!$result_check || ($this->db->num_rows($result_check) < 1)) { + //insert + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type, fk_contact, fk_user) "; + $sql .= "VALUES (1," . ((int) $id) . "," . ((int) $user->id) . ")"; + $result = $this->db->query($sql); + if (!$result) { + $error++; + $this->error = $this->db->lasterror(); + } + } else { + $result = true; + } + } else { + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert "; + $sql .= "WHERE type=1 AND fk_contact=" . ((int) $id) . " AND fk_user=" . ((int) $user->id); $result = $this->db->query($sql); if (!$result) { $error++; $this->error = $this->db->lasterror(); } - } else { - $result = true; - } - } else { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; - $sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id; - $result = $this->db->query($sql); - if (!$result) { - $error++; - $this->error = $this->db->lasterror(); } } @@ -1190,10 +1192,11 @@ class Contact extends CommonObject } /** - * Efface le contact de la base + * Delete a contact from database + * // TODO Add $user as first param * - * @param int $notrigger Disable all trigger - * @return int <0 if KO, >0 if OK + * @param int $notrigger Disable all trigger + * @return int <0 if KO, >0 if OK */ public function delete($notrigger = 0) { @@ -1221,7 +1224,7 @@ class Contact extends CommonObject $obj = $this->db->fetch_object($resql); $sqldel = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; - $sqldel .= " WHERE rowid = ".$obj->rowid; + $sqldel .= " WHERE rowid = ".((int) $obj->rowid); dol_syslog(__METHOD__, LOG_DEBUG); $result = $this->db->query($sqldel); if (!$result) { @@ -1324,7 +1327,7 @@ class Contact extends CommonObject $sql = "SELECT c.rowid, c.datec as datec, c.fk_user_creat,"; $sql .= " c.tms as tms, c.fk_user_modif"; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c"; - $sql .= " WHERE c.rowid = ".$this->db->escape($id); + $sql .= " WHERE c.rowid = ".((int) $id); $resql = $this->db->query($sql); if ($resql) { @@ -1770,10 +1773,10 @@ class Contact extends CommonObject $sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact"; $sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc"; $sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc"; - $sql .= " WHERE sc.fk_soc =".$this->socid; + $sql .= " WHERE sc.fk_soc =".((int) $this->socid); $sql .= " AND sc.fk_c_type_contact=tc.rowid"; - $sql .= " AND tc.element='".$this->db->escape($element)."'"; - $sql .= " AND tc.active=1"; + $sql .= " AND tc.element = '".$this->db->escape($element)."'"; + $sql .= " AND tc.active = 1"; dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index e980b0ee94c..3005c6b7827 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -182,7 +182,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'contact'; - $permission = $user->rights->societe->contact->creer; + $permissiontoadd = $user->rights->societe->contact->creer; $permtoedit = $user->rights->societe->contact->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 74e3c704739..e5a9ab3f0d6 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -375,13 +375,13 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_stcommcontact as st ON st.id = p.fk_stcommcontact"; -if (!empty($search_categ)) { +if (!empty($search_categ) && $search_categ != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cc ON p.rowid = cc.fk_socpeople"; // We need this table joined to the select in order to filter by categ } -if (!empty($search_categ_thirdparty)) { +if (!empty($search_categ_thirdparty) && $search_categ_thirdparty != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_soc"; // We need this table joined to the select in order to filter by categ } -if (!empty($search_categ_supplier)) { +if (!empty($search_categ_supplier) && $search_categ_supplier != '-1') { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs2 ON s.rowid = cs2.fk_soc"; // We need this table joined to the select in order to filter by categ } if (!$user->rights->societe->client->voir && !$socid) { @@ -392,7 +392,7 @@ if (!$user->rights->societe->client->voir && !$socid) { //restriction $sql .= " AND (sc.fk_user = ".$user->id." OR p.fk_soc IS NULL)"; } if (!empty($userid)) { // propre au commercial - $sql .= " AND p.fk_user_creat=".$db->escape($userid); + $sql .= " AND p.fk_user_creat=".((int) $userid); } if ($search_level) { $sql .= natural_search("p.fk_prospectcontactlevel", join(',', $search_level), 3); @@ -414,19 +414,19 @@ if ($search_priv != '0' && $search_priv != '1') { } if ($search_categ > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ); } if ($search_categ == -2) { $sql .= " AND cc.fk_categorie IS NULL"; } if ($search_categ_thirdparty > 0) { - $sql .= " AND cs.fk_categorie = ".$db->escape($search_categ_thirdparty); + $sql .= " AND cs.fk_categorie = ".((int) $search_categ_thirdparty); } if ($search_categ_thirdparty == -2) { $sql .= " AND cs.fk_categorie IS NULL"; } if ($search_categ_supplier > 0) { - $sql .= " AND cs2.fk_categorie = ".$db->escape($search_categ_supplier); + $sql .= " AND cs2.fk_categorie = ".((int) $search_categ_supplier); } if ($search_categ_supplier == -2) { $sql .= " AND cs2.fk_categorie IS NULL"; @@ -495,10 +495,10 @@ if (count($search_roles) > 0) { $sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".$db->sanitize(implode(',', $search_roles))."))"; } if ($search_no_email != '' && $search_no_email >= 0) { - $sql .= " AND p.no_email = ".$db->escape($search_no_email); + $sql .= " AND p.no_email = ".((int) $search_no_email); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND p.statut = ".$db->escape($search_status); + $sql .= " AND p.statut = ".((int) $search_status); } if ($search_import_key) { $sql .= natural_search("p.import_key", $search_import_key); @@ -1097,28 +1097,28 @@ while ($i < min($num, $limit)) { } // Phone if (!empty($arrayfields['p.phone']['checked'])) { - print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + print ''.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; if (!$i) { $totalarray['nbfield']++; } } // Phone perso if (!empty($arrayfields['p.phone_perso']['checked'])) { - print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; + print ''.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').''; if (!$i) { $totalarray['nbfield']++; } } // Phone mobile if (!empty($arrayfields['p.phone_mobile']['checked'])) { - print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; + print ''.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').''; if (!$i) { $totalarray['nbfield']++; } } // Fax if (!empty($arrayfields['p.fax']['checked'])) { - print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; + print ''.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index c301ef02276..1cb76b5336e 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -49,13 +49,20 @@ if ($id > 0) { $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('contactcard')); +// $hookmanager->initHooks(array('contactcard')); -> Name conflict with product/card.php +$hookmanager->initHooks(array('contactnote')); + /* * Actions */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 628c73b0afc..261ffebf29c 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -60,8 +60,8 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->societe->contact $result = $object->update_perso($id, $user); if ($result > 0) { - $object->old_name = ''; - $object->old_firstname = ''; + $object->oldcopy = clone $object; + // Logo/Photo save $dir = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos'; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 05c7436c22e..d5187c6a040 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -386,7 +386,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors'); $error++; } - if (GETPOST('prod_entry_mode', 'alpha') == 'free' && empty($idprod) && empty($product_desc)) { + if (GETPOST('prod_entry_mode', 'alpha') == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors'); $error++; } @@ -1003,7 +1003,7 @@ if ($action == 'create') { $soc->fetch($socid); } - if (GETPOST('origin') && GETPOST('originid')) { + if (GETPOST('origin') && GETPOST('originid', 'int')) { // Parse element/subelement (ex: project_task) $regs = array(); $element = $subelement = GETPOST('origin'); @@ -1013,7 +1013,7 @@ if ($action == 'create') { } if ($element == 'project') { - $projectid = GETPOST('originid'); + $projectid = GETPOST('originid', 'int'); } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1094,7 +1094,8 @@ if ($action == 'create') { print ''; } else { print ''; - print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); + print img_picto('', 'company', 'class="pictofixedwidth"'); + print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500'); print ' '; print ''; } @@ -1121,11 +1122,13 @@ if ($action == 'create') { // Commercial suivi print ''.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").''; + print img_picto('', 'user', 'class="pictofixedwidth"'); print $form->select_dolusers(GETPOST("commercial_suivi_id") ?GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, ''); print ''; // Commercial signature print ''.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").''; + print img_picto('', 'user', 'class="pictofixedwidth"'); print $form->select_dolusers(GETPOST("commercial_signature_id") ?GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, ''); print ''; @@ -1686,7 +1689,7 @@ if ($action == 'create') { $colspan++; } - // Ligne dates prevues + // Line dates planed print ''; print ''; print $langs->trans("DateStartPlanned").' '; @@ -1786,7 +1789,7 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print '\n"; $totalarray = array(); +$totalarray['nbfield'] = 0; $typenArray = array(); $cacheCountryIDCode = array(); diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index eab56b97a16..46a710a754d 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -44,6 +44,10 @@ $ref = GETPOST('ref', 'alpha'); if ($user->socid) { $socid = $user->socid; } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +//$hookmanager->initHooks(array('contractcard', 'globalcard')); -> Conflict with contrat\card.php +$hookmanager->initHooks(array('contractnote')); + $result = restrictedArea($user, 'contrat', $id); $object = new Contrat($db); @@ -51,16 +55,18 @@ $object->fetch($id, $ref); $permissionnote = $user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('contractcard', 'globalcard')); - - /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index a0ecc6b4be8..8368bffbab2 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -257,7 +257,7 @@ if ($search_product_category > 0) { $sql .= " WHERE c.entity = ".$conf->entity; $sql .= " AND c.rowid = cd.fk_contrat"; if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } $sql .= " AND c.fk_soc = s.rowid"; if (!$user->rights->societe->client->voir && !$socid) { diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index a7ac035506f..fbecacce515 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -27,17 +27,42 @@ // $permissiondellink must be defined $dellinkid = GETPOST('dellinkid', 'int'); +$addlink = GETPOST('addlink', 'alpha'); $addlinkid = GETPOST('idtolinkto', 'int'); +$addlinkref = GETPOST('reftolinkto', 'alpha'); +$cancellink = GETPOST('cancel', 'alpha'); // Link invoice to order -if ($action == 'addlink' && !empty($permissiondellink) && !GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0) { +if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id > 0 && $addlinkid > 0) { $object->fetch($id); $object->fetch_thirdparty(); - $result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid); + $result = $object->add_object_linked($addlink, $addlinkid); +} + +// Link by reference +if ($action == 'addlinkbyref' && ! empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) { + $element_prop = getElementProperties($addlink); + if (is_array($element_prop)) { + dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php'); + + $objecttmp = new $element_prop['classname']($db); + $ret = $objecttmp->fetch(0, $addlinkref); + if ($ret > 0) { + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked($addlink, $objecttmp->id); + if (isset($_POST['reftolinkto'])) unset($_POST['reftolinkto']); + } elseif ($ret < 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + } else { + $langs->load('errors'); + setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors'); + } + } } // Delete link -if ($action == 'dellink' && !empty($permissiondellink) && !GETPOST('cancel', 'alpha') && $dellinkid > 0) { +if ($action == 'dellink' && !empty($permissiondellink) && !$cancellink && $dellinkid > 0) { $result = $object->deleteObjectLinked(0, '', 0, '', $dellinkid); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index b03c2c3d192..1ca04a00c8b 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -137,7 +137,7 @@ if ($action == 'add') { // Check reserved keyword with more than 3 characters if (!$error) { - if (in_array(GETPOST('attrname', 'aZ09'), array('and', 'keyword', 'table', 'index', 'integer', 'float', 'double', 'position'))) { + if (in_array(GETPOST('attrname', 'aZ09'), array('and', 'keyword', 'table', 'index', 'int', 'integer', 'float', 'double', 'real', 'position'))) { $error++; $langs->load("errors"); $mesg[] = $langs->trans("ErrorReservedKeyword", GETPOST('attrname', 'aZ09')); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 13814511297..3e2438f63d3 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -21,13 +21,23 @@ // Variable $upload_dir must be defined when entering here. // Variable $upload_dirold may also exists. // Variable $confirm must be defined. +// If variable $permissiontoadd is defined, we check it is true. Note: A test on permission should already have been done into the restrictedArea() method called by parent page. //var_dump($upload_dir); //var_dump($upload_dirold); +// Protection to understand what happen when submitting files larger than post_max_size +if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) { + dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty."); + $langs->loadLangs(array("errors", "install")); + print $langs->trans("ErrorFileSizeTooLarge").' '; + print $langs->trans("ErrorGoBackAndCorrectParameters"); + die; +} + // Submit file/link -if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { +if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { if (!empty($_FILES)) { if (is_array($_FILES['userfile']['tmp_name'])) { $userfiles = $_FILES['userfile']['tmp_name']; @@ -65,7 +75,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { } } } -} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC)) { +} elseif (GETPOST('linkit', 'restricthtml') && !empty($conf->global->MAIN_UPLOAD_DOC) && (!isset($permissiontoadd) || $permissiontoadd)) { $link = GETPOST('link', 'alpha'); if ($link) { if (substr($link, 0, 7) != 'http://' && substr($link, 0, 8) != 'https://' && substr($link, 0, 7) != 'file://' && substr($link, 0, 7) != 'davs://') { @@ -77,7 +87,7 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) { // Delete file/link -if ($action == 'confirm_deletefile' && $confirm == 'yes') { +if ($action == 'confirm_deletefile' && $confirm == 'yes' && (!isset($permissiontoadd) || $permissiontoadd)) { $urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). if (GETPOST('section', 'alpha')) { // For a delete from the ECM module, upload_dir is ECM root dir and urlfile contains relative path from upload_dir @@ -149,7 +159,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { exit; } } -} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha')) { +} elseif ($action == 'confirm_updateline' && GETPOST('save', 'alpha') && GETPOST('link', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $langs->load('link'); $link = new Link($db); @@ -167,7 +177,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { } else { //error fetching } -} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha')) { +} elseif ($action == 'renamefile' && GETPOST('renamefilesave', 'alpha') && (!isset($permissiontoadd) || $permissiontoadd)) { // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile. if (!empty($upload_dir)) { $filenamefrom = dol_sanitizeFileName(GETPOST('renamefilefrom', 'alpha'), '_', 0); // Do not remove accents diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 85725b16547..8d70f7c3042 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2019-2021 Frédéric France @@ -593,8 +593,10 @@ if (!$error && $massaction == 'confirm_presend') { if ($mailfile->error) { $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); $resaction .= '
    '.$mailfile->error.'
    '; - } else { + } elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { $resaction .= '
    No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
    '; + } else { + $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '
    (unhandled error)
    '; } } } @@ -710,7 +712,7 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders. for ($i = 0; $i < $num; $i++) { $desc = ($lines[$i]->desc ? $lines[$i]->desc : ''); - // If we build one invoice for several order, we must put the invoice of order on the line + // If we build one invoice for several orders, we must put the ref of order on the invoice line if (!empty($createbills_onebythird)) { $desc = dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day')); } @@ -770,6 +772,8 @@ if ($massaction == 'confirm_createbills') { // Create bills from orders. $array_options = $lines[$i]->array_options; } + $objecttmp->context['createfromclone']; + $result = $objecttmp->addline( $desc, $lines[$i]->subprice, @@ -1049,9 +1053,9 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { $newlang = GETPOST('lang_id', 'aZ09'); } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { - $newlang = $objecttmp->thirdparty->default_lang; - } + //elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($objecttmp->thirdparty)) { // On massaction, we can have several values for $objecttmp->thirdparty + // $newlang = $objecttmp->thirdparty->default_lang; + //} if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); @@ -1265,7 +1269,7 @@ if (!$error && $massaction == 'validate' && $permissiontoadd) { if ($nbok > 1) { setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); } else { - setEventMessages($langs->trans("RecordsModified", $nbok), null, 'mesgs'); + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } $db->commit(); } else { @@ -1328,7 +1332,7 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' if ($nbok > 1) { setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs'); } else { - setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs'); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); } $db->commit(); } else { @@ -1466,10 +1470,84 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd } } +if (!$error && ($massaction == 'enable' || ($action == 'enable' && $confirm == 'yes')) && $permissiontoadd) { + $db->begin(); + + $objecttmp = new $objectclass($db); + $nbok = 0; + foreach ($toselect as $toselectid) { + $result = $objecttmp->fetch($toselectid); + if ($result>0) { + if (in_array($objecttmp->element, array('societe'))) { + $result =$objecttmp->setStatut(1); + } + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else { + $nbok++; + } + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsEnabled", $nbok), null, 'mesgs'); + } else { + setEventMessages($langs->trans("RecordEnabled"), null, 'mesgs'); + } + $db->commit(); + } else { + $db->rollback(); + } +} + +if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm == 'yes')) && $permissiontoadd) { + $db->begin(); + + $objecttmp = new $objectclass($db); + $nbok = 0; + foreach ($toselect as $toselectid) { + $result = $objecttmp->fetch($toselectid); + if ($result>0) { + if (in_array($objecttmp->element, array('societe'))) { + $result =$objecttmp->setStatut(0); + } + if ($result <= 0) { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } else { + $nbok++; + } + } else { + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); + $error++; + break; + } + } + + if (!$error) { + if ($nbok > 1) { + setEventMessages($langs->trans("RecordsDisabled", $nbok), null, 'mesgs'); + } else { + setEventMessages($langs->trans("RecordDisabled"), null, 'mesgs'); + } + $db->commit(); + } else { + $db->rollback(); + } +} + $parameters['toselect'] = $toselect; $parameters['uploaddir'] = $uploaddir; $parameters['massaction'] = $massaction; -$parameters['diroutputmassaction'] = $diroutputmassaction; +$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null; $reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index b4e583387c9..e5c75a2e7c3 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -182,10 +182,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST $tmparray = array(); if (trim($_POST['sendto'])) { - // Recipients are provided into free text + // Recipients are provided into free text field $tmparray[] = trim($_POST['sendto']); } + if (trim($_POST['tomail'])) { + // Recipients are provided into free hidden text field + $tmparray[] = trim($_POST['tomail']); + } + if (count($receiver) > 0) { // Recipient was provided from combo list foreach ($receiver as $key => $val) { @@ -345,7 +350,7 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST $subject = make_substitutions($subject, $substitutionarray); $message = make_substitutions($message, $substitutionarray); - if (method_exists($object, 'makeSubstitution')) { + if (is_object($object) && method_exists($object, 'makeSubstitution')) { $subject = $object->makeSubstitution($subject); $message = $object->makeSubstitution($message); } diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index cf619f70de6..09292dd4991 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -54,8 +54,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; - $sortfield = GETPOST("sortfield", 'alpha'); - $sortorder = GETPOST("sortorder", 'alpha'); + $sortfield = GETPOST("sortfield", 'aZ09comma'); + $sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; @@ -82,8 +82,8 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call //exit; } } -} else // For no ajax call -{ +} else { + // For no ajax call $rootdirfordoc = $conf->ecm->dir_output; $ecmdir = new EcmDirectory($db); @@ -376,7 +376,7 @@ if ($type == 'directory') { // When we show list of files for ECM files, $filearray contains file list, and directory is defined with modulepart + section into $param // When we show list of files for a directory, $filearray ciontains file list, and directory is defined with modulepart + $relativepath //var_dump("section=".$section." title=".$title." modulepart=".$modulepart." useinecm=".$useinecm." perm=".$perm." relativepath=".$relativepath." param=".$param." url=".$url); - $formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm); + $formfile->list_of_documents($filearray, '', $modulepart, $param, 1, $relativepath, $perm, $useinecm, $textifempty, $maxlengthname, $title, $url, 0, $perm, '', $sortfield, $sortorder); } } @@ -430,6 +430,7 @@ if ($useajax || $action == 'delete') { } if ($useajax) { + print ''."\n"; print ''."\n"; } - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'").click(function(){'."\n"; - $out .= ' console.log("We click on collapse/uncollapse .trextrafields_collapse'.$extrafields_collapse_num.'");'."\n"; - $out .= ' jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").toggle(300, function(){'."\n"; - $out .= ' if (jQuery(".trextrafields_collapse'.$extrafields_collapse_num.'").is(":hidden")) {'."\n"; - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-plus-square").removeClass("fa-minus-square");'."\n"; - $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=0; path='.$_SERVER["PHP_SELF"].'"'."\n"; - $out .= ' } else {'."\n"; - $out .= ' jQuery("#trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').' '.$tagtype_dyn.' span").addClass("fa-minus-square").removeClass("fa-plus-square");'."\n"; - $out .= ' document.cookie = "DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key.'=1; path='.$_SERVER["PHP_SELF"].'"'."\n"; - $out .= ' }'."\n"; - $out .= ' });'."\n"; - $out .= ' });'."\n"; - $out .= '});'."\n"; - $out .= ''."\n"; } } } @@ -2215,7 +2217,11 @@ class ExtraFields continue; // Value was not provided, we should not set it. } $value_arr = GETPOST($keysuffix."options_".$key.$keyprefix); - $value_key = price2num($value_arr); + if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150' + $value_key = price2num($value_arr); + } else { + $value_key = $value_arr; + } } else { if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) { continue; // Value was not provided, we should not set it. diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index cef41497381..45643e26e4c 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -193,6 +193,7 @@ class HookManager 'getFormatedSupplierRef', 'getIdProfUrl', 'getInputIdProf', + 'menuLeftMenuItems', 'moveUploadedFile', 'moreHtmlStatus', 'pdf_build_address', @@ -272,8 +273,10 @@ class HookManager $parameters['currentcontext'] = $context; // Hooks that must return int (hooks with type 'addreplace') if ($hooktype == 'addreplace') { - $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) - if ($resaction < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { + $resactiontmp = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + $resaction += $resactiontmp; + + if ($resactiontmp < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) { $error++; $this->error = $actionclassinstance->error; $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors); @@ -281,13 +284,22 @@ class HookManager } if (isset($actionclassinstance->results) && is_array($actionclassinstance->results)) { - $this->resArray = array_merge($this->resArray, $actionclassinstance->results); + if ($resactiontmp > 0) { + $this->resArray = $actionclassinstance->results; + } else { + $this->resArray = array_merge($this->resArray, $actionclassinstance->results); + } } if (!empty($actionclassinstance->resprints)) { - $this->resPrint .= $actionclassinstance->resprints; + if ($resactiontmp > 0) { + $this->resPrint = $actionclassinstance->resprints; + } else { + $this->resPrint .= $actionclassinstance->resprints; + } } } else { // Generic hooks that return a string or array (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...) + // TODO. this test should be done into the method of hook by returning nothing if (is_array($parameters) && !empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) { continue; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 9b90ed0b30a..8e69a4b49df 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -589,6 +589,7 @@ class Form if (!$htmltext) { return $text; } + $direction = (int) $direction; // For backward compatibility when $direction was set to '' instead of 0 $tag = 'td'; if ($notabs == 2) { @@ -957,7 +958,7 @@ class Form if ($row['code_iso']) { $labeltoshow .= ' ('.$row['code_iso'].')'; if (empty($hideflags)) { - $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium marginrightonly"'); + $tmpflag = picto_from_langcode($row['code_iso'], 'class="saturatemedium paddingrightonly"', 1); $labeltoshow = $tmpflag.' '.$labeltoshow; } } @@ -968,7 +969,7 @@ class Form $out .= ''; + $out .= ''."\n"; } } $out .= ''; @@ -978,7 +979,7 @@ class Form // Make select dynamic include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox('select'.$htmlname); + $out .= ajax_combobox('select'.$htmlname, array(), 0, 0, 'resolve'); return $out; } @@ -1025,7 +1026,7 @@ class Form $out .= ''; } - $out .= ''; $out .= ''; $num = $this->db->num_rows($resql); $i = 0; @@ -1251,6 +1252,9 @@ class Form if (is_null($ajaxoptions)) { $ajaxoptions = array(); } + + require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + // No immediate load of all database $placeholder = ''; if ($selected && empty($selected_input_value)) { @@ -1263,16 +1267,17 @@ class Form // mode 1 $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : ''); $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); - $out .= ''; + + $out .= ''; if (empty($hidelabel)) { print $langs->trans("RefOrLabel").' : '; } elseif ($hidelabel > 1) { - $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; + $placeholder = $langs->trans("RefOrLabel"); if ($hidelabel == 2) { $out .= img_picto($langs->trans("Search"), 'search'); } } - $out .= 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + $out .= 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; if ($hidelabel == 3) { $out .= img_picto($langs->trans("Search"), 'search'); } @@ -1328,7 +1333,7 @@ class Form } // We search companies - $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; + $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $sql .= ", s.address, s.zip, s.town"; $sql .= ", dictp.code as country_code"; @@ -1380,6 +1385,7 @@ class Form $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; } $sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + $sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'"; $sql .= ")"; } $sql .= $this->db->order("nom", "ASC"); @@ -1849,7 +1855,7 @@ class Form * @param string $force_entity '0' or Ids of environment to force * @param int $maxlength Maximum length of string into list (0=no limit) * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status - * @param string $morefilter Add more filters into sql request (Example: 'employee = 1') + * @param string $morefilter Add more filters into sql request (Example: 'employee = 1'). This value must not come from user input. * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css @@ -1903,9 +1909,9 @@ class Form } $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entity as e ON e.rowid=u.entity"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."entity as e ON e.rowid = u.entity"; if ($force_entity) { - $sql .= " WHERE u.entity IN (0, ".$force_entity.")"; + $sql .= " WHERE u.entity IN (0, ".$this->db->sanitize($force_entity).")"; } else { $sql .= " WHERE u.entity IS NOT NULL"; } @@ -1919,7 +1925,7 @@ class Form } } if (!empty($user->socid)) { - $sql .= " AND u.fk_soc = ".$user->socid; + $sql .= " AND u.fk_soc = ".((int) $user->socid); } if (is_array($exclude) && $excludeUsers) { $sql .= " AND u.rowid NOT IN (".$this->db->sanitize($excludeUsers).")"; @@ -1947,15 +1953,12 @@ class Form } dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG); + $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); $i = 0; if ($num) { - // Enhance with select2 - include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname); - // do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined $out .= ''; + + if ($num) { + // Enhance with select2 + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname); + } } else { dol_print_error($this->db); } @@ -2131,7 +2140,7 @@ class Form $out .= ' ('.$langs->trans("Owner").')'; } if ($nbassignetouser > 1 && $action != 'view') { - $out .= ' '; + $out .= ' '; } // Show my availability if ($showproperties) { @@ -2162,7 +2171,7 @@ class Form $out .= '});'; $out .= '})'; $out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter); - $out .= ' '; + $out .= ' '; $out .= '
    '; } @@ -2176,7 +2185,7 @@ class Form * * @param int $selected Preselected products * @param string $htmlname Name of HTML select field (must be unique in page). - * @param int $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param int|string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) * @param int $limit Limit on number of returned lines * @param int $price_level Level of price to show * @param int $status Sell status -1=Return all products, 0=Products not on sell, 1=Products on sell @@ -2497,18 +2506,18 @@ class Form } if ($finished == 0) { - $sql .= " AND p.finished = ".$finished; + $sql .= " AND p.finished = ".((int) $finished); } elseif ($finished == 1) { - $sql .= " AND p.finished = ".$finished; + $sql .= " AND p.finished = ".((int) $finished); if ($status >= 0) { - $sql .= " AND p.tosell = ".$status; + $sql .= " AND p.tosell = ".((int) $status); } } elseif ($status >= 0) { - $sql .= " AND p.tosell = ".$status; + $sql .= " AND p.tosell = ".((int) $status); } // Filter by product type if (strval($filtertype) != '') { - $sql .= " AND p.fk_product_type = ".$filtertype; + $sql .= " AND p.fk_product_type = ".((int) $filtertype); } elseif (empty($conf->product->enabled)) { // when product module is disabled, show services only $sql .= " AND p.fk_product_type = 1"; } elseif (empty($conf->service->enabled)) { // when service module is disabled, show products only @@ -2604,7 +2613,7 @@ class Form } } if ($showempty) { - $out .= ''; + $out .= ''; } $i = 0; @@ -3025,6 +3034,10 @@ class Form global $langs, $conf; global $price_level, $status, $finished; + if (!isset($status)) { + $status = 1; + } + $selected_input_value = ''; if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { if ($selected > 0) { @@ -3040,7 +3053,7 @@ class Form print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').''; } else { - print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); + print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', $status, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); } } @@ -3048,20 +3061,20 @@ class Form /** * Return list of suppliers products * - * @param int $socid Id societe fournisseur (0 pour aucun filtre) - * @param int $selected Product price pre-selected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD') - * @param string $htmlname Nom de la zone select - * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) - * @param string $filtre Pour filtre sql - * @param string $filterkey Filtre des produits - * @param int $statut -1=Return all products, 0=Products not on sell, 1=Products on sell (not used here, a filter on tobuy is already hard coded in request) - * @param int $outputmode 0=HTML select string, 1=Array - * @param int $limit Limit of line number + * @param int $socid Id of supplier thirdparty (0 = no filter) + * @param int $selected Product price pre-selected (must be 'id' in product_fournisseur_price or 'idprod_IDPROD') + * @param string $htmlname Name of HTML select + * @param string $filtertype Filter on product type (''=nofilter, 0=product, 1=service) + * @param string $filtre Generic filter. Data must not come from user input. + * @param string $filterkey Filter of produdts + * @param int $statut -1=Return all products, 0=Products not on buy, 1=Products on buy + * @param int $outputmode 0=HTML select string, 1=Array + * @param int $limit Limit of line number * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices - * @param string $morecss Add more CSS + * @param string $morecss Add more CSS * @param int $showstockinlist Show stock information (slower). - * @param string $placeholder Placeholder - * @return array Array of keys for json + * @param string $placeholder Placeholder + * @return array Array of keys for json */ public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '') { @@ -3098,8 +3111,8 @@ class Form } $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON ( p.rowid = pfp.fk_product AND pfp.entity IN (".getEntity('product').") )"; - if ($socid) { - $sql .= " AND pfp.fk_soc = ".$socid; + if ($socid > 0) { + $sql .= " AND pfp.fk_soc = ".((int) $socid); } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid"; // Units @@ -3107,9 +3120,11 @@ class Form $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units u ON u.rowid = p.fk_unit"; } $sql .= " WHERE p.entity IN (".getEntity('product').")"; - $sql .= " AND p.tobuy = 1"; + if ($statut != -1) { + $sql .= " AND p.tobuy = ".((int) $statut); + } if (strval($filtertype) != '') { - $sql .= " AND p.fk_product_type=".$this->db->escape($filtertype); + $sql .= " AND p.fk_product_type = ".((int) $filtertype); } if (!empty($filtre)) { $sql .= " ".$filtre; @@ -3670,13 +3685,14 @@ class Form /** * Retourne la liste des types de delais de livraison possibles * - * @param int $selected Id du type de delais pre-selectionne - * @param string $htmlname Nom de la zone select - * @param string $filtertype To add a filter + * @param int $selected Id du type de delais pre-selectionne + * @param string $htmlname Nom de la zone select + * @param string $filtertype To add a filter * @param int $addempty Add empty entry + * @param string $morecss More CSS * @return void */ - public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0) + public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0, $morecss = '') { global $langs, $user; @@ -3684,7 +3700,7 @@ class Form dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); - print ''; if ($addempty) { print ''; } @@ -3694,7 +3710,7 @@ class Form } else { print ''; } print ''; @@ -3821,7 +3837,6 @@ class Form $sql = "SELECT id, code, libelle as label, type, active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_paiement"; $sql .= " WHERE entity IN (".getEntity('c_paiement').")"; - //if ($active >= 0) $sql.= " AND active = ".$active; $resql = $this->db->query($sql); if ($resql) { @@ -4054,7 +4069,6 @@ class Form $sql = "SELECT rowid, code, label, active"; $sql .= " FROM ".MAIN_DB_PREFIX."c_transport_mode"; $sql .= " WHERE entity IN (".getEntity('c_transport_mode').")"; - //if ($active >= 0) $sql.= " AND active = ".$active; $resql = $this->db->query($sql); if ($resql) { @@ -4154,15 +4168,16 @@ class Form /** * Return a HTML select list of shipping mode * - * @param string $selected Id shipping mode pre-selected - * @param string $htmlname Name of select zone - * @param string $filtre To filter list. This parameter must not come from input of users - * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. - * @param string $moreattrib To add more attribute on select + * @param string $selected Id shipping mode pre-selected + * @param string $htmlname Name of select zone + * @param string $filtre To filter list. This parameter must not come from input of users + * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib To add more attribute on select * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss More CSS * @return void */ - public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0) + public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0, $morecss = '') { global $langs, $conf, $user; @@ -4183,7 +4198,7 @@ class Form $num = $this->db->num_rows($result); $i = 0; if ($num) { - print ''; if ($useempty == 1 || ($useempty == 2 && $num > 1)) { print ''; } @@ -4444,7 +4459,6 @@ class Form */ public function selectEstablishments($selected = '', $htmlname = 'entity', $status = 0, $filtre = '', $useempty = 0, $moreattrib = '') { - // phpcs:enable global $langs, $conf; $langs->load("admin"); @@ -4676,7 +4690,7 @@ class Form { global $langs, $conf; - $more = ''; + $more = ''; $formconfirm = ''; $inputok = array(); $inputko = array(); @@ -4710,7 +4724,7 @@ class Form $more .= '
    '."\n"; foreach ($formquestion as $key => $input) { if (is_array($input) && !empty($input)) { - $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); + $size = (!empty($input['size']) ? ' size="'.$input['size'].'"' : ''); // deprecated. Use morecss instead. $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); @@ -4887,7 +4901,7 @@ class Form var more = ""; var inputvalue; if ($("input[name=\'" + inputname + "\']").attr("type") == "radio") { - inputvalue = $("input[name=\'" + inputname + "\']").val(); + inputvalue = $("input[name=\'" + inputname + "\']:checked").val(); } else { if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; } inputvalue = $("#" + inputname + more).val(); @@ -4946,16 +4960,18 @@ class Form $formconfirm .= '
    '.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline - 1]->getLibStatut(4).''.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline - 1]->getLibStatut(4).''; if ($user->socid == 0) { if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 186e4ee5761..5436c55faeb 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1546,11 +1546,11 @@ class Contrat extends CommonObject $sql .= ") VALUES ("; $sql .= $this->id.", '', '".$this->db->escape($desc)."',"; $sql .= ($fk_product > 0 ? $fk_product : "null").","; - $sql .= " ".$qty.","; - $sql .= " ".$txtva.","; + $sql .= " ".((float) $qty).","; + $sql .= " ".((float) $txtva).","; $sql .= " ".($vat_src_code ? "'".$this->db->escape($vat_src_code)."'" : "null").","; - $sql .= " ".$txlocaltax1.","; - $sql .= " ".$txlocaltax2.","; + $sql .= " ".((float) $txlocaltax1).","; + $sql .= " ".((float) $txlocaltax2).","; $sql .= " '".$this->db->escape($localtax1_type)."',"; $sql .= " '".$this->db->escape($localtax2_type)."',"; $sql .= " ".price2num($remise_percent).","; @@ -1559,7 +1559,7 @@ class Contrat extends CommonObject $sql .= " '".$this->db->escape($info_bits)."',"; $sql .= " ".price2num($price).",".price2num($remise).","; if (isset($fk_fournprice)) { - $sql .= ' '.$fk_fournprice.','; + $sql .= ' '.((int) $fk_fournprice).','; } else { $sql .= ' null,'; } @@ -3066,9 +3066,9 @@ class ContratLigne extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET"; - $sql .= " fk_contrat=".$this->fk_contrat.","; + $sql .= " fk_contrat=".((int) $this->fk_contrat).","; $sql .= " fk_product=".($this->fk_product ? "'".$this->db->escape($this->fk_product)."'" : 'null').","; - $sql .= " statut=".$this->statut.","; + $sql .= " statut=".((int) $this->statut).","; $sql .= " label='".$this->db->escape($this->label)."',"; $sql .= " description='".$this->db->escape($this->description)."',"; $sql .= " date_commande=".($this->date_commande != '' ? "'".$this->db->idate($this->date_commande)."'" : "null").","; @@ -3373,11 +3373,11 @@ class ContratLigne extends CommonObjectLine $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".ContratLigne::STATUS_CLOSED.","; + $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".((int) ContratLigne::STATUS_CLOSED).","; $sql .= " date_cloture = '".$this->db->idate($date_end)."',"; $sql .= " fk_user_cloture = ".$user->id.","; $sql .= " commentaire = '".$this->db->escape($comment)."'"; - $sql .= " WHERE rowid = ".$this->id." AND statut = ".ContratLigne::STATUS_OPEN; + $sql .= " WHERE rowid = ".$this->id." AND statut = ".((int) ContratLigne::STATUS_OPEN); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 1dd87fd75e3..0d66204f81d 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -192,7 +192,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'contract'; - $permission = $user->rights->contrat->creer; + $permissiontoadd = $user->rights->contrat->creer; $permtoedit = $user->rights->contrat->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index aed4cba2fe1..a5e3da943b7 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -250,7 +250,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $resql = $db->query($sql); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 51b61c41830..a744b2c1bf7 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -133,10 +133,10 @@ $arrayfields = array( 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30), 's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31), - 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32), + 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1, 'position'=>32), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34), - 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80), + 'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>-1, 'position'=>80), 'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45), 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -265,10 +265,10 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')'; } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid) { - $sql .= " AND s.rowid = ".$db->escape($socid); + $sql .= " AND s.rowid = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -289,14 +289,20 @@ if (!empty($search_ref_customer)) { if (!empty($search_ref_supplier)) { $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier); } +if ($search_zip) { + $sql .= natural_search(array('s.zip'), $search_zip); +} +if ($search_town) { + $sql .= natural_search(array('s.town'), $search_town); +} if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_user > 0) { - $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; + $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user); } // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; @@ -488,24 +494,24 @@ $moreforfilter = ''; if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '
    '; - $tmpttile = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmpttile, 'maxwidth250'); + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'widthcentpercentminusx maxwidth300'); $moreforfilter .= '
    '; } // If the user can view other users if ($user->rights->user->user->lire) { $moreforfilter .= '
    '; - $tmpttile = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmpttile, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); + $tmptitle = $langs->trans('LinkedToSpecificUsers'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); $moreforfilter .= '
    '; } // If the user can view categories of products if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
    '; - $tmpttile = $langs->trans('IncludingProductWithTag'); + $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmpttile, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'widthcentpercentminusx maxwidth300', 1); $moreforfilter .= '
    '; } @@ -700,6 +706,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "
    '."\n"; // Line title - $formconfirm .= ''."\n"; + $formconfirm .= ''."\n"; // Line text if (is_array($formquestion) && !empty($formquestion['text'])) { - $formconfirm .= ''."\n"; + $formconfirm .= ''."\n"; } // Line form fields if ($more) { - $formconfirm .= ''."\n"; } @@ -4963,10 +4979,10 @@ class Form // Line with question $formconfirm .= ''; $formconfirm .= ''; - $formconfirm .= ''; - $formconfirm .= ''; $formconfirm .= ''."\n"; $formconfirm .= '
    '.img_picto('', 'recent').' '.$title.'
    '; + $formconfirm .= img_picto('', 'recent').' '.$title; + $formconfirm .= '
    '.$formquestion['text'].'
    '.$formquestion['text'].'
    '."\n"; + $formconfirm .= '
    '."\n"; $formconfirm .= $more; $formconfirm .= '
    '.$question.''; - $formconfirm .= $this->selectyesno("confirm", $newselectedchoice); + $formconfirm .= ''; + $formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly'); + $formconfirm .= ''; $formconfirm .= '
    '."\n"; @@ -5077,7 +5093,12 @@ class Form } else { if ($selected) { $this->load_cache_conditions_paiements(); - print $this->cache_conditions_paiements[$selected]['label']; + if (isset($this->cache_conditions_paiements[$selected])) { + print $this->cache_conditions_paiements[$selected]['label']; + } else { + $langs->load('errors'); + print $langs->trans('ErrorNotInDictionaryPaymentConditions'); + } } else { print " "; } @@ -5279,9 +5300,9 @@ class Form global $langs; if ($htmlname != "none") { print '
    '; - print ''; + print ''; print ''; - $this->selectTransportMode($selected, $htmlname, 2, $addempty, 0, 0, $active); + $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); print ''; print '
    '; } else { @@ -6565,6 +6586,213 @@ class Form return; } + /** + * Return list of tickets in Ajax if Ajax activated or go to selectTicketsList + * + * @param int $selected Preselected tickets + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param string $filtertype To add a filter + * @param int $limit Limit on number of returned lines + * @param int $status Ticket status + * @param string $selected_input_value Value of preselected input text (for use with ajax) + * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after) + * @param array $ajaxoptions Options for ajax_autocompleter + * @param int $socid Thirdparty Id (to get also price dedicated to this customer) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) + * @param string $nooutput No print, return the output into a string + * @return void|string + */ + public function selectTickets($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 0, $status = 1, $selected_input_value = '', $hidelabel = 0, $ajaxoptions = array(), $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $selected_combinations = null, $nooutput = 0) + { + global $langs, $conf; + + $out = ''; + + // check parameters + if (is_null($ajaxoptions)) $ajaxoptions = array(); + + if (!empty($conf->use_javascript_ajax) && !empty($conf->global->TICKET_USE_SEARCH_TO_SELECT)) { + $placeholder = ''; + + if ($selected && empty($selected_input_value)) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + $tickettmpselect = new Ticket($this->db); + $tickettmpselect->fetch($selected); + $selected_input_value = $tickettmpselect->ref; + unset($tickettmpselect); + } + + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/ticket/ajax/tickets.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); + + if (empty($hidelabel)) $out .= $langs->trans("RefOrLabel").' : '; + elseif ($hidelabel > 1) { + $placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"'; + if ($hidelabel == 2) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } + $out .= 'global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />'; + if ($hidelabel == 3) { + $out .= img_picto($langs->trans("Search"), 'search'); + } + } else { + $out .= $this->selectTicketsList($selected, $htmlname, $filtertype, $limit, $status, 0, $socid, $showempty, $forcecombo, $morecss); + } + + if (empty($nooutput)) print $out; + else return $out; + } + + + /** + * Return list of tickets. + * Called by selectTickets. + * + * @param int $selected Preselected ticket + * @param string $htmlname Name of select html + * @param string $filtertype Filter on ticket type + * @param int $limit Limit on number of returned lines + * @param string $filterkey Filter on product + * @param int $status Ticket status + * @param int $outputmode 0=HTML select string, 1=Array + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param int $forcecombo Force to use combo box + * @param string $morecss Add more css on select + * @return array Array of keys for json + */ + public function selectTicketsList($selected = '', $htmlname = 'ticketid', $filtertype = '', $limit = 20, $filterkey = '', $status = 1, $outputmode = 0, $showempty = '1', $forcecombo = 0, $morecss = '') + { + global $langs, $conf, $user, $db; + + $out = ''; + $outarray = array(); + + $selectFields = " p.rowid, p.ref, p.message"; + + $sql = "SELECT "; + $sql .= $selectFields; + $sql .= " FROM ".MAIN_DB_PREFIX."ticket as p"; + $sql .= ' WHERE p.entity IN ('.getEntity('ticket').')'; + + // Add criteria on ref/label + if ($filterkey != '') { + $sql .= ' AND ('; + $prefix = empty($conf->global->TICKET_DONOTSEARCH_ANYWHERE) ? '%' : ''; // Can use index if PRODUCT_DONOTSEARCH_ANYWHERE is on + // For natural search + $scrit = explode(' ', $filterkey); + $i = 0; + if (count($scrit) > 1) $sql .= "("; + foreach ($scrit as $crit) { + if ($i > 0) $sql .= " AND "; + $sql .= "(p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%'"; + $sql .= ")"; + $i++; + } + if (count($scrit) > 1) $sql .= ")"; + $sql .= ')'; + } + + $sql .= $this->db->plimit($limit, 0); + + // Build output string + dol_syslog(get_class($this)."::selectTicketsList search tickets", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) { + require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php'; + + $num = $this->db->num_rows($result); + + $events = null; + + if (!$forcecombo) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, $events, $conf->global->TICKET_USE_SEARCH_TO_SELECT); + } + + $out .= ''; + + $this->db->free($result); + + if (empty($outputmode)) return $out; + return $outarray; + } else { + dol_print_error($db); + } + } + + /** + * constructTicketListOption. + * This define value for &$opt and &$optJson. + * + * @param resource $objp Result set of fetch + * @param string $opt Option (var used for returned value in string option format) + * @param string $optJson Option (var used for returned value in json format) + * @param string $selected Preselected value + * @param string $filterkey Filter key to highlight + * @return void + */ + protected function constructTicketListOption(&$objp, &$opt, &$optJson, $selected, $filterkey = '') + { + global $langs, $conf, $user, $db; + + $outkey = ''; + $outval = ''; + $outref = ''; + $outlabel = ''; + $outtype = ''; + + $label = $objp->label; + + $outkey = $objp->rowid; + $outref = $objp->ref; + $outlabel = $objp->label; + $outtype = $objp->fk_product_type; + + $opt = '\n"; + $optJson = array('key'=>$outkey, 'value'=>$outref, 'type'=>$outtypem); + } + /** * Generic method to select a component from a combo list. @@ -6644,11 +6872,8 @@ class Form $urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter); // Activate the auto complete using ajax call. $out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array()); - $out .= ''; - if ($placeholder) { - $placeholder = ' placeholder="'.$placeholder.'"'; - } - $out .= ''; + $out .= ''; + $out .= ''; } else { // Immediate load of table record. Note: filter is inside $objecttmp->filter $out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled); @@ -6751,13 +6976,15 @@ class Form // Search data $sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t"; - if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { - $tmparray = explode('@', $objecttmp->ismultientitymanaged); - $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0]; - } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + if (isset($objecttmp->ismultientitymanaged)) { + if (!is_numeric($objecttmp->ismultientitymanaged)) { + $tmparray = explode('@', $objecttmp->ismultientitymanaged); + $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0]; + } + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if (!$user->rights->societe->client->voir && !$user->socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } } } @@ -6768,27 +6995,29 @@ class Form $sql .= $hookmanager->resPrint; } else { $sql .= " WHERE 1=1"; - if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) { - $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; - } - if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { - $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; - } - if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { - if ($objecttmp->element == 'societe') { - $sql .= " AND t.rowid = ".$user->socid; - } else { - $sql .= " AND t.fk_soc = ".$user->socid; + if (isset($objecttmp->ismultientitymanaged)) { + if ($objecttmp->ismultientitymanaged == 1) { + $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; + } + if (!is_numeric($objecttmp->ismultientitymanaged)) { + $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; + } + if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { + if ($objecttmp->element == 'societe') { + $sql .= " AND t.rowid = ".$user->socid; + } else { + $sql .= " AND t.fk_soc = ".$user->socid; + } + } + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if (!$user->rights->societe->client->voir && !$user->socid) { + $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + } } } if ($searchkey != '') { $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); } - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) { - $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; - } - } if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" /*if (! DolibarrApi::_checkFilters($objecttmp->filter)) { @@ -6830,9 +7059,12 @@ class Form $obj = $this->db->fetch_object($resql); $label = ''; $tmparray = explode(',', $fieldstoshow); + $oldvalueforshowoncombobox = 0; foreach ($tmparray as $key => $val) { $val = preg_replace('/t\./', '', $val); - $label .= (($label && $obj->$val) ? ' - ' : '').$obj->$val; + $label .= (($label && $obj->$val) ? ($oldvalueforshowoncombobox != $objecttmp->fields[$val]['showoncombobox'] ? ' - ' : ' ') : ''); + $label .= $obj->$val; + $oldvalueforshowoncombobox = $objecttmp->fields[$val]['showoncombobox']; } if (empty($outputmode)) { if ($preselectedvalue > 0 && $preselectedvalue == $obj->rowid) { @@ -6920,7 +7152,7 @@ class Form if ($addjscombo && $jsbeautify) { // Enhance with select2 include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; - $out .= ajax_combobox($htmlname); + $out .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', $show_empty < 0 ? (string) $show_empty : '-1'); } $out .= ''; - $tmpplugin = 'select2'; - $outdelayed = "\n".' - '; + }); + '; + } if ($acceptdelayedhtml) { $delayedhtmlcontent .= $outdelayed; @@ -7148,7 +7383,7 @@ class Form public static function selectArrayFilter($htmlname, $array, $id = '', $moreparam = '', $disableFiltering = 0, $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0) { global $conf, $langs; - global $delayedhtmlcontent; + global $delayedhtmlcontent; // Will be used later outside of this function // TODO Use an internal dolibarr component instead of select2 if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && !defined('REQUIRE_JQUERY_MULTISELECT')) { @@ -7167,74 +7402,77 @@ class Form $formattedarrayresult[] = $o; } - $tmpplugin = 'select2'; - $outdelayed = "\n".' - '; + '.($callurlonselect ? ' + /* Code to execute a GET when we select a value */ + $(".'.$htmlname.'").change(function() { + var selected = $(".'.$htmlname.'").val(); + console.log("We select "+selected) + + $(".'.$htmlname.'").val(""); /* reset visible combo value */ + $.each( saveRemoteData, function( key, value ) { + if (key == selected) + { + console.log("selectArrayFilter - Do a redirect to "+value.url) + location.assign(value.url); + } + }); + });' : '').' + + }); + '; + } if ($acceptdelayedhtml) { $delayedhtmlcontent .= $outdelayed; @@ -7277,7 +7515,7 @@ class Form } // Add code for jquery to use multiselect - if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { + if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { $out .= "\n".''; $out .= "\n".''; $out .= ''; $out .= ''; @@ -110,7 +113,7 @@ class FormOther * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches * @param int $useempty Show an empty value in list - * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) + * @param int $fk_user User we want templates * @return void */ public function select_export_model($selected = '', $htmlname = 'exportmodelid', $type = '', $useempty = 0, $fk_user = null) @@ -121,8 +124,8 @@ class FormOther $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; $sql .= " WHERE type = '".$this->db->escape($type)."'"; - if (!empty($fk_user)) { - $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $fk_user).")"; } $sql .= " ORDER BY label"; $result = $this->db->query($sql); @@ -132,6 +135,8 @@ class FormOther print ''; } + $tmpuser = new User($this->db); + $num = $this->db->num_rows($result); $i = 0; while ($i < $num) { @@ -140,8 +145,7 @@ class FormOther $label = $obj->label; if ($obj->fk_user == 0) { $label .= ' ('.$langs->trans("Everybody").')'; - } elseif (!empty($conf->global->EXPORTS_SHARE_MODELS) && empty($fk_user) && is_object($user) && $user->id != $obj->fk_user) { - $tmpuser = new User($this->db); + } elseif ($obj->fk_user > 0) { $tmpuser->fetch($obj->fk_user); $label .= ' ('.$tmpuser->getFullName($langs).')'; } @@ -171,7 +175,7 @@ class FormOther * @param string $htmlname Nom de la zone select * @param string $type Type des modeles recherches * @param int $useempty Affiche valeur vide dans liste - * @param int $fk_user User that has created the template (this is set to null to get all export model when EXPORTS_SHARE_MODELS is on) + * @param int $fk_user User that has created the template * @return void */ public function select_import_model($selected = '', $htmlname = 'importmodelid', $type = '', $useempty = 0, $fk_user = null) @@ -182,10 +186,10 @@ class FormOther $sql = "SELECT rowid, label, fk_user"; $sql .= " FROM ".MAIN_DB_PREFIX."import_model"; $sql .= " WHERE type = '".$this->db->escape($type)."'"; - if (!empty($fk_user)) { - $sql .= " AND fk_user IN (0, ".$fk_user.")"; // An export model + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $fk_user).")"; } - $sql .= " ORDER BY rowid"; + $sql .= " ORDER BY label"; $result = $this->db->query($sql); if ($result) { print ''; $selectboxlist .= ''; $selectboxlist .= ''; - $selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone', 0, 'hidden selected', 0, 1); + $selectboxlist .= Form::selectarray('boxcombo', $arrayboxtoactivatelabel, -1, $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth150onsmartphone hideonprint', 0, 'hidden selected', 0, 1); if (empty($conf->use_javascript_ajax)) { $selectboxlist .= ' '; } diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 8a40eed9da8..3455b572888 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -76,7 +76,7 @@ class FormSocialContrib $sql = "SELECT c.id, c.libelle as type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql .= " WHERE c.active = 1"; - $sql .= " AND c.fk_pays = ".$mysoc->country_id; + $sql .= " AND c.fk_pays = ".((int) $mysoc->country_id); $sql .= " ORDER BY c.libelle ASC"; } else { $sql = "SELECT c.id, c.libelle as type"; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 3cec6c19789..259e5a3a19a 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -259,7 +259,7 @@ class FormTicket $doleditor->Create(); print ''; - if (!empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { + if ($public && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print ''; print ''; @@ -272,6 +272,15 @@ class FormTicket print ''; } + //Categories + if ($conf->categorie->enabled) { + // Categories + print ''.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ""; + } + // Attached files if (!empty($this->withfile)) { // Define list of attached files @@ -427,6 +436,14 @@ class FormTicket print 'withnotifytiersatcreate ? ' checked="checked"' : '').'>'; print ''; } + + // User assigned + print ''; + print $langs->trans("AssignedTo"); + print ''; + print $form->select_dolusers(GETPOST('fk_user_assign', 'int'), 'fk_user_assign', 1); + print ''; + print ''; } if (!empty($conf->projet->enabled) && !$this->ispublic) { @@ -561,98 +578,281 @@ class FormTicket /** * Return html list of ticket anaytic codes * - * @param string $selected Id categorie pre-selectionnée - * @param string $htmlname Nom de la zone select - * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users. - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $maxlength Max length of label - * @param string $morecss More CSS + * @param string $selected Id categorie pre-selectionnée + * @param string $htmlname Name of select component + * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users. + * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code + * @param int $empty 1=peut etre vide, 0 sinon + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $maxlength Max length of label + * @param string $morecss More CSS + * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes. * @return void */ - public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') + public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0) { global $langs, $user; - $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + $ticketstat = new Ticket($this->db); $ticketstat->loadCacheCategoriesTickets(); - print ''; + if ($empty) { + print ''; + } - if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { - foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { - // Exclude some record - if ($filtertype == 'public=1') { - if (empty($arraycategories['public'])) { + if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { + foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { + // Exclude some record + if ($filtertype == 'public=1') { + if (empty($arraycategories['public'])) { + continue; + } + } + + // We discard empty line if showempty is on because an empty line has already been output. + if ($empty && empty($arraycategories['code'])) { continue; } + + if ($format == 0) { + print ''; } - - // We discard empty line if showempty is on because an empty line has already been output. - if ($empty && empty($arraycategories['code'])) { - continue; - } - - if ($format == 0) { - print ''; } - } - print ''; - if ($user->admin && !$noadmininfo) { - print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + print ''; + if ($user->admin && !$noadmininfo) { + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + } - print ajax_combobox('select'.$htmlname); + print ajax_combobox('select'.$htmlname); + } elseif ($htmlname!='') { + $groupticket=GETPOST($htmlname, 'aZ09'); + $child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0; + $arraycodenotparent[] = ""; + $arrayidused = array(); + $stringtoprint = ''.$langs->trans("GroupOfTicket").' '; + $stringtoprint .= ''; + } else { + $stringtoprint .= ''; + $stringtoprint .= ''; + } + $stringtoprint .= ' '; + + $levelid = 1; + while ($levelid <= $use_multilevel) { + $tabscript = array(); + $stringtoprint .= ''; + + $stringtoprint .=''; + } + $stringtoprint .=''; + $stringtoprint .= ajax_combobox($htmlname); + + return $stringtoprint; + } } /** @@ -995,6 +1195,8 @@ class FormTicket print ''; } + $uselocalbrowser = false; + // Intro // External users can't send message email if ($user->rights->ticket->write && !$user->socid) { @@ -1005,15 +1207,15 @@ class FormTicket print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $uselocalbrowser = true; - $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; } // MESSAGE + $defaultmessage = ""; if (is_object($arraydefaultmessage) && $arraydefaultmessage->content) { $defaultmessage = $arraydefaultmessage->content; @@ -1043,7 +1245,7 @@ class FormTicket //$toolbarname = 'dolibarr_details'; $toolbarname = 'dolibarr_notes'; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); + $doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70); $doleditor->Create(); print ''; @@ -1055,7 +1257,7 @@ class FormTicket print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help'); print ''; include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); + $doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70); $doleditor->Create(); print ''; } diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php index 076dace54f0..fb59e2b7c42 100644 --- a/htdocs/core/class/infobox.class.php +++ b/htdocs/core/class/infobox.class.php @@ -85,7 +85,7 @@ class InfoBox * * @param DoliDB $db Database handler * @param string $mode 'available' or 'activated' - * @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) + * @param int $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) * @param User|null $user Object user to filter * @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude * @param int $includehidden Include also hidden boxes @@ -97,7 +97,6 @@ class InfoBox $boxes = array(); - $confuserzone = 'MAIN_BOXES_'.$zone; if ($mode == 'activated') { // activated $sql = "SELECT b.rowid, b.position, b.box_order, b.fk_user,"; $sql .= " d.rowid as box_id, d.file, d.note, d.tms"; @@ -105,7 +104,7 @@ class InfoBox $sql .= " WHERE b.box_id = d.rowid"; $sql .= " AND b.entity IN (0,".$conf->entity.")"; if ($zone >= 0) { - $sql .= " AND b.position = ".$zone; + $sql .= " AND b.position = ".((int) $zone); } if (is_object($user)) { $sql .= " AND b.fk_user IN (0,".$user->id.")"; @@ -116,7 +115,7 @@ class InfoBox } else { // available $sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms"; $sql .= " FROM ".MAIN_DB_PREFIX."boxes_def as d"; - $sql .= " WHERE d.entity IN (0,".$conf->entity.")"; + $sql .= " WHERE d.entity IN (0, ".$conf->entity.")"; } dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user) ? $user->id : '')."", LOG_DEBUG); @@ -217,7 +216,7 @@ class InfoBox * Save order of boxes for area and user * * @param DoliDB $db Database handler - * @param string $zone Name of area (0 for Homepage, ...) + * @param int $zone Name of area (0 for Homepage, ...) * @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...' * @param int $userid Id of user * @return int <0 if KO, 0=Nothing done, > 0 if OK @@ -254,8 +253,8 @@ class InfoBox // Delete all lines $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql .= " WHERE entity = ".$conf->entity; - $sql .= " AND fk_user = ".$userid; - $sql .= " AND position = ".$zone; + $sql .= " AND fk_user = ".((int) $userid); + $sql .= " AND position = ".((int) $zone); dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); $result = $db->query($sql); @@ -278,14 +277,13 @@ class InfoBox $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes"; $sql .= "(box_id, position, box_order, fk_user, entity)"; $sql .= " values ("; - $sql .= " ".$id.","; - $sql .= " ".$zone.","; + $sql .= " ".((int) $id).","; + $sql .= " ".((int) $zone).","; $sql .= " '".$db->escape($colonne.$ii)."',"; - $sql .= " ".$userid.","; - $sql .= " ".$conf->entity; + $sql .= " ".((int) $userid).","; + $sql .= " ".((int) $conf->entity); $sql .= ")"; - dol_syslog(get_class()."::saveboxorder", LOG_DEBUG); $result = $db->query($sql); if ($result < 0) { $error++; diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 0f97ed878cf..a2e5d450869 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -22,6 +22,10 @@ /** * \file htdocs/core/class/ldap.class.php * \brief File of class to manage LDAP features + * + * Note: + * LDAP_ESCAPE_FILTER is to escape char array('\\', '*', '(', ')', "\x00") + * LDAP_ESCAPE_DN is to escape char array('\\', ',', '=', '+', '<', '>', ';', '"', '#') */ /** @@ -132,6 +136,7 @@ class Ldap $this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION; $this->dn = $conf->global->LDAP_SERVER_DN; $this->serverType = $conf->global->LDAP_SERVER_TYPE; + $this->domain = $conf->global->LDAP_SERVER_DN; $this->searchUser = $conf->global->LDAP_ADMIN_DN; $this->searchPassword = $conf->global->LDAP_ADMIN_PASS; @@ -932,7 +937,7 @@ class Ldap * Returns an array containing a details or list of LDAP record(s) * ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword * - * @param string $search Value of fiel to search, '*' for all. Not used if $activefilter is set. + * @param string $search Value of field to search, '*' for all. Not used if $activefilter is set. * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) * @param string $useridentifier Name of key field (Ex: uid) * @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword) @@ -953,7 +958,7 @@ class Ldap } // Define filter - if (!empty($activefilter)) { + if (!empty($activefilter)) { // Use a predefined trusted filter (defined into setup by admin). if (((string) $activefilter == '1' || (string) $activefilter == 'user') && $this->filter) { $filter = '('.$this->filter.')'; } elseif (((string) $activefilter == 'group') && $this->filtergroup ) { @@ -961,11 +966,11 @@ class Ldap } elseif (((string) $activefilter == 'member') && $this->filter) { $filter = '('.$this->filtermember.')'; } else { - // If this->filter is empty, make fiter on * (all) - $filter = '('.$useridentifier.'=*)'; + // If this->filter/this->filtergroup is empty, make fiter on * (all) + $filter = '('.ldap_escape($useridentifier, '', LDAP_ESCAPE_FILTER).'=*)'; } - } else { - $filter = '('.$useridentifier.'='.$search.')'; + } else { // Use a filter forged using the $search value + $filter = '('.ldap_escape($useridentifier, '', LDAP_ESCAPE_FILTER).'='.ldap_escape($search, '', LDAP_ESCAPE_FILTER).')'; } if (is_array($attributeArray)) { diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 65fdaff9645..6f024c91b0b 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -352,10 +352,10 @@ class Menubase $sql .= " type='".$this->db->escape($this->type)."',"; $sql .= " mainmenu='".$this->db->escape($this->mainmenu)."',"; $sql .= " leftmenu='".$this->db->escape($this->leftmenu)."',"; - $sql .= " fk_menu=".$this->fk_menu.","; + $sql .= " fk_menu=".((int) $this->fk_menu).","; $sql .= " fk_mainmenu=".($this->fk_mainmenu ? "'".$this->db->escape($this->fk_mainmenu)."'" : "null").","; $sql .= " fk_leftmenu=".($this->fk_leftmenu ? "'".$this->db->escape($this->fk_leftmenu)."'" : "null").","; - $sql .= " position=".($this->position > 0 ? $this->position : 0).","; + $sql .= " position=".($this->position > 0 ? ((int) $this->position) : 0).","; $sql .= " url='".$this->db->escape($this->url)."',"; $sql .= " target='".$this->db->escape($this->target)."',"; $sql .= " titre='".$this->db->escape($this->title)."',"; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 345ec5b38e3..2e0a71460ba 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -65,7 +65,7 @@ class Notify // Les codes actions sont definis dans la table llx_notify_def // codes actions supported are - // @todo defined also into interface_50_modNotificiation_Notificiation.class.php + // @todo defined also into interface_50_modNotification_Notification.class.php public $arrayofnotifsupported = array( 'BILL_VALIDATE', 'BILL_PAYED', @@ -80,8 +80,8 @@ class Notify 'SHIPPING_VALIDATE', 'EXPENSE_REPORT_VALIDATE', 'EXPENSE_REPORT_APPROVE', - 'HOLIDAY_VALIDATE', - 'HOLIDAY_APPROVE', + 'HOLIDAY_VALIDATE', + 'HOLIDAY_APPROVE', 'ACTION_CREATE' ); @@ -176,7 +176,7 @@ class Notify $sqlnotifcode = ''; if ($notifcode) { if (is_numeric($notifcode)) { - $sqlnotifcode = " AND n.fk_action = ".$notifcode; // Old usage + $sqlnotifcode = " AND n.fk_action = ".((int) $notifcode); // Old usage } else { $sqlnotifcode = " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage } @@ -195,7 +195,7 @@ class Notify $sql .= $sqlnotifcode; $sql .= " AND s.entity IN (".getEntity('societe').")"; if ($socid > 0) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG); @@ -233,7 +233,7 @@ class Notify $sql .= $sqlnotifcode; $sql .= " AND c.entity IN (".getEntity('user').")"; if ($userid > 0) { - $sql .= " AND c.rowid = ".$userid; + $sql .= " AND c.rowid = ".((int) $userid); } dol_syslog(__METHOD__." ".$notifcode.", ".$socid."", LOG_DEBUG); @@ -380,11 +380,11 @@ class Notify $sql .= " AND n.fk_soc = s.rowid"; $sql .= " AND c.statut = 1"; if (is_numeric($notifcode)) { - $sql .= " AND n.fk_action = ".$notifcode; // Old usage + $sql .= " AND n.fk_action = ".((int) $notifcode); // Old usage } else { $sql .= " AND a.code = '".$this->db->escape($notifcode)."'"; // New usage } - $sql .= " AND s.rowid = ".$object->socid; + $sql .= " AND s.rowid = ".((int) $object->socid); $sql .= "\nUNION\n"; } @@ -546,7 +546,7 @@ class Notify $object_type = 'holiday'; $labeltouse = $conf->global->HOLIDAY_APPROVE_TEMPLATE; $mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); - break; + break; case 'ACTION_CREATE': $link = ''.$newref.''; $dir_output = $conf->agenda->dir_output; @@ -567,10 +567,10 @@ class Notify $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); $message = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs); } else { - $message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n"; - $message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; - $message .= "\n"; - $message .= $mesg; + $message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n"; + $message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n"; + $message .= "\n"; + $message .= $mesg; } $ref = dol_sanitizeFileName($newref); @@ -687,7 +687,7 @@ class Notify break; case 'BILL_PAYED': $link = ''.$newref.''; - $dir_output = $$conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); + $dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); $object_type = 'facture'; $mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed", $link); break; @@ -782,7 +782,7 @@ class Notify $dir_output = $conf->holiday->dir_output; $object_type = 'holiday'; $mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link); - break; + break; case 'ACTION_CREATE': $link = ''.$newref.''; $dir_output = $conf->agenda->dir_output; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 2a25652761d..b535d2b3585 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -204,7 +204,7 @@ class Translate dol_print_error('', get_class($this)."::Load ErrorWrongParameters"); return -1; } - if ($this->defaultlang == 'none_NONE') { + if ($this->defaultlang === 'none_NONE') { return 0; // Special language code to not translate keys } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index d2987e8fc63..bdd6cc2b83a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -319,9 +319,9 @@ class Utils } if ($dolibarr_main_db_character_set == 'utf8mb4') { // We save output into utf8mb4 charset - $param .= " --default-character-set=utf8mb4"; + $param .= " --default-character-set=utf8mb4 --no-tablespaces"; } else { - $param .= " --default-character-set=utf8"; // We always save output into utf8 charset + $param .= " --default-character-set=utf8 --no-tablespaces"; // We always save output into utf8 charset } $paramcrypted = $param; $paramclear = $param; @@ -594,7 +594,7 @@ class Utils * Execute a CLI command. * * @param string $command Command line to execute. - * @param string $outputfile Output file (used only when method is 2). For exemple $conf->admin->dir_temp.'/out.tmp'; + * @param string $outputfile A path for an output file (used only when method is 2). For example: $conf->admin->dir_temp.'/out.tmp'; * @param int $execmethod 0=Use default method (that is 1 by default), 1=Use the PHP 'exec', 2=Use the 'popen' method * @return array array('result'=>...,'output'=>...,'error'=>...). result = 0 means OK. */ diff --git a/htdocs/ticket/class/utils_diff.class.php b/htdocs/core/class/utils_diff.class.php similarity index 100% rename from htdocs/ticket/class/utils_diff.class.php rename to htdocs/core/class/utils_diff.class.php diff --git a/htdocs/core/commonfieldsinexport.inc.php b/htdocs/core/commonfieldsinexport.inc.php index a02a21afdd6..3b201e4f10a 100644 --- a/htdocs/core/commonfieldsinexport.inc.php +++ b/htdocs/core/commonfieldsinexport.inc.php @@ -37,7 +37,7 @@ if (class_exists($keyforclass)) { /* * case 'sellist': * $tmp=''; - * $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + * $tmpparam=jsonOrUnserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null * if ($tmpparam['options'] && is_array($tmpparam['options'])) { * $tmpkeys=array_keys($tmpparam['options']); * $tmp=array_shift($tmpkeys); diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 898421978db..9996d09f036 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -122,7 +122,7 @@ interface Database * List tables into a database * * @param string $database Name of database - * @param string $table Nmae of table filter ('xxx%') + * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ public function DDLListTables($database, $table = ''); @@ -189,7 +189,7 @@ interface Database /** * Get last ID after an insert INSERT * - * @param string $tab Table name concerned by insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql + * @param string $tab Table name concerned by insert. Not used under MySql but required for compatibility with Postgresql * @param string $fieldid Field name * @return int Id of row */ diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 2ed93a9b5f4..b93a3f40cea 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -108,7 +108,7 @@ abstract class DoliDB implements Database * Sanitize a string for SQL forging * * @param string $stringtosanitize String to escape - * @param int $allowsimplequote Allow simple quote + * @param int $allowsimplequote 1=Allow simple quotes in string. When string is used as a list of SQL string ('aa', 'bb', ...) * @return string String escaped */ public function sanitize($stringtosanitize, $allowsimplequote = 0) diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 343f4c8cc3e..36974d29218 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -266,7 +266,7 @@ class DoliDBMysqli extends DoliDB */ public function query($query, $usesavepoint = 0, $type = 'auto') { - global $conf; + global $conf, $dolibarr_main_db_readonly; $query = trim($query); @@ -278,6 +278,15 @@ class DoliDBMysqli extends DoliDB return false; // Return false = error if empty request } + if (!empty($dolibarr_main_db_readonly)) { + if (preg_match('/^(INSERT|UPDATE|REPLACE|DELETE|CREATE|ALTER|TRUNCATE|DROP)/i', $query)) { + $this->lasterror = 'Application in read-only mode'; + $this->lasterrno = 'APPREADONLY'; + $this->lastquery = $query; + return false; + } + } + if (!$this->database_name) { // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) $ret = $this->db->query($query); diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 83d00ba8a2a..0513226ac31 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -211,7 +211,7 @@ class DoliDBPgsql extends DoliDB $line = preg_replace('/tinyint/i', 'smallint', $line); // nuke unsigned - $line = preg_replace('/(int\w+|smallint)\s+unsigned/i', '\\1', $line); + $line = preg_replace('/(int\w+|smallint|bigint)\s+unsigned/i', '\\1', $line); // blob -> text $line = preg_replace('/\w*blob/i', 'text', $line); @@ -498,7 +498,7 @@ class DoliDBPgsql extends DoliDB */ public function query($query, $usesavepoint = 0, $type = 'auto') { - global $conf; + global $conf, $dolibarr_main_db_readonly; $query = trim($query); @@ -527,6 +527,18 @@ class DoliDBPgsql extends DoliDB $SYSLOG_SQL_LIMIT = 10000; // limit log to 10kb per line to limit DOS attacks dol_syslog('sql='.substr($query, 0, $SYSLOG_SQL_LIMIT), LOG_DEBUG); } + if (empty($query)) { + return false; // Return false = error if empty request + } + + if (!empty($dolibarr_main_db_readonly)) { + if (preg_match('/^(INSERT|UPDATE|REPLACE|DELETE|CREATE|ALTER|TRUNCATE|DROP)/i', $query)) { + $this->lasterror = 'Application in read-only mode'; + $this->lasterrno = 'APPREADONLY'; + $this->lastquery = $query; + return false; + } + } $ret = @pg_query($this->db, $query); @@ -757,6 +769,7 @@ class DoliDBPgsql extends DoliDB $errorlabel = pg_last_error($this->db); $errorcode = ''; + $reg = array(); if (preg_match('/: *([0-9P]+):/', $errorlabel, $reg)) { $errorcode = $reg[1]; if (isset($errorcode_map[$errorcode])) { diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 563ccb19aac..395155973be 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -397,7 +397,7 @@ class DoliDBSqlite3 extends DoliDB */ public function query($query, $usesavepoint = 0, $type = 'auto') { - global $conf; + global $conf, $dolibarr_main_db_readonly; $ret = null; @@ -455,6 +455,15 @@ class DoliDBSqlite3 extends DoliDB return false; // Return false = error if empty request } + if (!empty($dolibarr_main_db_readonly)) { + if (preg_match('/^(INSERT|UPDATE|REPLACE|DELETE|CREATE|ALTER|TRUNCATE|DROP)/i', $query)) { + $this->lasterror = 'Application in read-only mode'; + $this->lasterrno = 'APPREADONLY'; + $this->lastquery = $query; + return false; + } + } + // Ordre SQL ne necessitant pas de connexion a une base (exemple: CREATE DATABASE) try { //$ret = $this->db->exec($query); diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index a868c99a66f..70dd0077e57 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -36,9 +36,10 @@ if ($resql) { // This can fail when class is used on old database (during mig case 'boolean': $typeFilter = "Boolean"; break; + case 'checkbox': case 'select': if (!empty($conf->global->EXPORT_LABEL_FOR_SELECT)) { - $tmpparam = unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) + $tmpparam = jsonOrUnserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) if ($tmpparam['options'] && is_array($tmpparam['options'])) { $typeFilter = "Select:".$obj->param; } @@ -46,7 +47,7 @@ if ($resql) { // This can fail when class is used on old database (during mig break; case 'sellist': $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null + $tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null if ($tmpparam['options'] && is_array($tmpparam['options'])) { $tmpkeys = array_keys($tmpparam['options']); $tmp = array_shift($tmpkeys); diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index c0a8844b572..74a7f543bfc 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -47,6 +47,11 @@ session_cache_limiter('public'); require_once '../../main.inc.php'; + +/* + * View + */ + // Define javascript type top_httphead('text/javascript; charset=UTF-8'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. @@ -97,8 +102,7 @@ print "});\n"; // Wrapper to manage dropdown if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) { print "\n/* JS CODE TO ENABLE dropdown (hamburger, linkto, ...) */\n"; - print ' - jQuery(document).ready(function () { + print ' jQuery(document).ready(function () { var lastopendropdown = null; // Click onto the link "link to" or "hamburger", toggle dropdown @@ -166,21 +170,19 @@ if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) { // Wrapper to manage document_preview if ($conf->browser->layout != 'phone') { print "\n/* JS CODE TO ENABLE document_preview */\n"; // Function document_preview is into header - print ' - jQuery(document).ready(function () { + print ' jQuery(document).ready(function () { jQuery(".documentpreview").click(function () { console.log("We click on preview for element with href="+$(this).attr(\'href\')+" mime="+$(this).attr(\'mime\')); document_preview($(this).attr(\'href\'), $(this).attr(\'mime\'), \''.dol_escape_js($langs->transnoentities("Preview")).'\'); return false; }); - }); - ' . "\n"; + });'."\n"; } // Code to manage reposition print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n"; print ' - jQuery(document).ready(function() { + jQuery(document).ready(function() { /* If page_y set, we set scollbar with it */ page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */ if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */ @@ -198,7 +200,9 @@ print ' { if (this.href) { + console.log("We click on tag with .reposition class. this.ref was "+this.href); var hrefarray = this.href.split("#", 2); + hrefarray[0]=hrefarray[0].replace(/&page_y=(\d+)/, \'\'); /* remove page_y param if already present */ this.href=hrefarray[0]+\'&page_y=\'+page_y; console.log("We click on tag with .reposition class. this.ref is now "+this.href); } @@ -209,37 +213,123 @@ print ' } } }); - });'."\n"; + });'."\n"; -print "\n/* JS CODE TO ENABLE ClipBoard copy paste*/\n"; -print 'jQuery(\'.clipboardCPShowOnHover\').hover( - function() { - console.log("We hover a value with a copy paste feature"); - $(this).children(".clipboardCPButton, .clipboardCPText").show(); - }, - function() { - console.log("We hover out the value with a copy paste feature"); - $(this).children(".clipboardCPButton, .clipboardCPText").hide(); - } - );'; -print 'jQuery(\'.clipboardCPButton\').click(function() { - /* console.log(this.parentNode); */ - console.log("We click on a clipboardCPButton tag"); - if (window.getSelection) { - selection = window.getSelection(); +// Code to manage Copy To Clipboard click +print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n"; +print ' + jQuery(document).ready(function() { + jQuery(\'.clipboardCPShowOnHover\').hover( + function() { + console.log("We hover a value with a copy paste feature"); + $(this).children(".clipboardCPButton, .clipboardCPText").show(); + }, + function() { + console.log("We hover out the value with a copy paste feature"); + $(this).children(".clipboardCPButton, .clipboardCPText").hide(); + } + ); - range = document.createRange(); - range.selectNodeContents(this.parentNode.firstChild); + jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() { + /* console.log(this.parentNode); */ + console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class"); + if (window.getSelection) { + selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange( range ); - } - document.execCommand( \'copy\' ); - window.getSelection().removeAllRanges(); + range = document.createRange(); + range.selectNodeContents(this.parentNode.firstChild); - /* Show message */ - var lastchild = this.parentNode.lastChild; - var tmp = lastchild.innerHTML - lastchild.innerHTML = \''.dol_escape_js($langs->trans('CopiedToClipboard')).'\'; - setTimeout(() => { lastchild.innerHTML = tmp; }, 1000); - })'."\n"; + selection.removeAllRanges(); + selection.addRange( range ); + } + document.execCommand( \'copy\' ); + window.getSelection().removeAllRanges(); + + /* Show message */ + var lastchild = this.parentNode.lastChild; + var tmp = lastchild.innerHTML + lastchild.innerHTML = \''.dol_escape_js($langs->trans('CopiedToClipboard')).'\'; + setTimeout(() => { lastchild.innerHTML = tmp; }, 1000); + }); + });'."\n"; + +// Code to manage clicktodial +print "\n/* JS CODE TO ENABLE clicktodial call of an URL */\n"; +print ' + jQuery(document).ready(function() { + jQuery(".cssforclicktodial").click(function() { + event.preventDefault(); + console.log("We click on a cssforclicktodial class with url="+this.href); + $.ajax({ + url: this.href, + type: \'GET\', + data: { token: \''.newToken().'\' } + }).done(function(xhr, textStatus, errorThrown) { + /* do nothing */ + }).fail(function(xhr, textStatus, errorThrown) { + alert("Error: "+textStatus); + }); + return false; + }); + });'."\n"; + + +// Code to manage the confirm dialog box +print "\n/* JS CODE TO ENABLE DIALOG CONFIRM POPUP ON ACTION BUTTON */\n"; +print ' + jQuery(document).ready(function() { + $(document).on("click", \'.butActionConfirm\', function(event) { + event.preventDefault(); + + // I don\'t use jquery $(this).data(\'confirm-url\'); to get $(this).attr(\'data-confirm-url\'); because .data() can doesn\'t work with ajax + var confirmUrl = $(this).attr(\'data-confirm-url\'); + var confirmTitle = $(this).attr(\'data-confirm-title\'); + var confirmContent = $(this).attr(\'data-confirm-content\'); + var confirmActionBtnLabel = $(this).attr(\'data-confirm-action-btn-label\'); + var confirmCancelBtnLabel = $(this).attr(\'data-confirm-cancel-btn-label\'); + var confirmModal = $(this).attr(\'data-confirm-modal\'); + if(confirmModal == undefined){ confirmModal = false; } + + var confirmId = \'confirm-dialog-box\'; + if($(this).attr(\'id\') != undefined){ var confirmId = confirmId + "-" + $(this).attr(\'id\'); } + if($("#" + confirmId) != undefined) { $(\'#\' + confirmId).remove(); } + + // Create modal box + + var $confirmBox = $(\'
    \', { + id: confirmId, + title: confirmTitle + }).appendTo(\'body\'); + + $confirmBox.dialog({ + autoOpen: true, + modal: confirmModal, + //width: Math.min($( window ).width() - 50, 1700), + width: \'auto\', + dialogClass: \'confirm-dialog-box\', + buttons: [ + { + text: confirmActionBtnLabel, + "class": \'ui-state-information\', + click: function () { + window.location.replace(confirmUrl); + } + }, + { + text: confirmCancelBtnLabel, + "class": \'ui-state-information\', + click: function () { + $(this).dialog("close"); + } + } + ], + close: function( event, ui ) { + $(\'#\'+confirmBox).remove(); + }, + open: function( event, ui ) { + $confirmBox.html(confirmContent); + } + }); + }); + }); +'."\n"; diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index a56084d0f32..0d5905b4351 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -50,6 +50,11 @@ session_cache_limiter('public'); require_once '../../main.inc.php'; + +/* + * View + */ + // Define javascript type top_httphead('text/javascript; charset=UTF-8'); // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. @@ -544,20 +549,27 @@ function hideMessage(fieldId,message) { * @param int strict Strict * @param int forcereload Force reload * @param int userid User id + * @param int value Value to set * @param string token Token */ -function setConstant(url, code, input, entity, strict, forcereload, userid, token) { +function setConstant(url, code, input, entity, strict, forcereload, userid, token, value) { var saved_url = url; /* avoid undefined url */ $.post( url, { action: "set", name: code, entity: entity, - token: token + token: token, + value: value }, function() { /* handler for success of post */ - console.log("url request success forcereload="+forcereload); - $("#set_" + code).hide(); - $("#del_" + code).show(); + console.log("url request success forcereload="+forcereload+" value="+value); + if (value == 0) { + $("#set_" + code).show(); + $("#del_" + code).hide(); + } else { + $("#set_" + code).hide(); + $("#del_" + code).show(); + } $.each(input, function(type, data) { // Enable another element if (type == "disabled" && strict != 1) { @@ -605,7 +617,7 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke if (forcereload) { location.reload(); } - }).fail(function(error) { location.reload(); }); /* When it fails, we always force reload to have setEventErrorMEssage in session visible */ + }).fail(function(error) { location.reload(); }); /* When it fails, we always force reload to have setEventErrorMessages in session visible */ } /* @@ -676,7 +688,7 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke if (forcereload) { location.reload(); } - }).fail(function(error) { location.reload(); }); /* When it fails, we always force reload to have setEventErrorMEssage in session visible */ + }).fail(function(error) { location.reload(); }); /* When it fails, we always force reload to have setEventErrorMessages in session visible */ } /* @@ -711,7 +723,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, text : yesButton, click : function() { if (action == "set") { - setConstant(url, code, input, entity, strict, 0, userid, token); + setConstant(url, code, input, entity, strict, 0, userid, token, 1); } else if (action == "del") { delConstant(url, code, input, entity, strict, 0, userid, token); } diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index f25c218f5d8..ee41555119a 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -41,132 +41,147 @@ if (!defined('NOREQUIREHTML')) { define('NOREQUIREHTML', 1); } +session_cache_limiter('public'); + require_once '../../main.inc.php'; -if (!($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/' || $_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root.'/index.php' - || preg_match('/getmenu_div\.php/', $_SERVER['HTTP_REFERER']))) { - global $langs, $conf; - top_httphead('text/javascript; charset=UTF-8'); +/* + * View + */ - print 'var login = \''.$_SESSION['dol_login'].'\';'."\n"; - print 'var nowtime = Date.now();'; - print 'var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined - print 'var time_js_next_test;'."\n"; - ?> - - /* Check if permission ok */ - if (Notification.permission !== "granted") { - console.log("Ask Notification.permission"); - Notification.requestPermission() - } - - /* Launch timer */ - // We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one. - //var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds - var time_first_execution = global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION) ? 0 : $conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>; - if (login != '') { - setTimeout(first_execution, time_first_execution * 1000); - time_js_next_test = nowtime + time_first_execution; - console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test); - } //first run auto check +top_httphead('text/javascript; charset=UTF-8'); +// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. +if (empty($dolibarr_nocache)) { + header('Cache-Control: max-age=10800, public, must-revalidate'); +} else { + header('Cache-Control: no-cache'); +} - function first_execution() { - console.log("Call first_execution then set repeat time to time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update); - check_events(); //one check before setting the new time for other checks - setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events - } +print "jQuery(document).ready(function () {\n"; - function check_events() { - if (Notification.permission === "granted") - { - time_js_next_test += time_auto_update; - console.log("Call ajax to check_events with time_js_next_test = "+time_js_next_test); +//print " console.log('referrer=".dol_escape_js($_SERVER['HTTP_REFERER'])."');\n"; - $.ajax("", { - type: "post", // Usually post or get - async: true, - data: { time_js_next_test: time_js_next_test, forcechecknow: 1, token: 'notrequired' }, - dataType: "json", - success: function (result) { - //console.log(result); - var arrayofpastreminders = Object.values(result.pastreminders); - if (arrayofpastreminders && arrayofpastreminders.length > 0) { - console.log("Retrieved "+arrayofpastreminders.length+" reminders to do."); - var audio = null; - global->AGENDA_REMINDER_BROWSER_SOUND)) { - print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav\');'; +print ' var nowtime = Date.now();'; +print ' var time_auto_update = '.$conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY.';'."\n"; // Always defined +print ' var time_js_next_test;'."\n"; +?> + +/* Check if permission ok */ +if (Notification.permission !== "granted") { + console.log("Ask Notification.permission"); + Notification.requestPermission() +} + +/* Launch timer */ + +// We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one. +//var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds +var time_first_execution = global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION) ? 0 : $conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>; + +setTimeout(first_execution, time_first_execution * 1000); +time_js_next_test = nowtime + time_first_execution; +console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test); + + +function first_execution() { + console.log("Call first_execution then set repeat time to time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update); + check_events(); //one check before setting the new time for other checks + setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events +} + +function check_events() { + if (Notification.permission === "granted") + { + time_js_next_test += time_auto_update; + console.log("Call ajax to check_events with time_js_next_test = "+time_js_next_test); + + $.ajax("", { + type: "post", // Usually post or get + async: true, + data: { time_js_next_test: time_js_next_test, forcechecknow: 1, token: 'notrequired' }, + dataType: "json", + success: function (result) { + //console.log(result); + var arrayofpastreminders = Object.values(result.pastreminders); + if (arrayofpastreminders && arrayofpastreminders.length > 0) { + console.log("Retrieved "+arrayofpastreminders.length+" reminders to do."); + var audio = null; + global->AGENDA_REMINDER_BROWSER_SOUND)) { + print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav\');'; + } + ?> + var listofreminderids = ''; + var noti = [] + + $.each(arrayofpastreminders, function (index, value) { + console.log(value); + var url = "notdefined"; + var title = "Not defined"; + var body = value.label; + if (value.type == 'agenda' && value.location != null && value.location != '') { + body += '\n' + value.location; } - ?> - var listofreminderids = ''; - var noti = [] - $.each(arrayofpastreminders, function (index, value) { - console.log(value); - var url = "notdefined"; - var title = "Not defined"; - var body = value.label; - if (value.type == 'agenda' && value.location != null && value.location != '') { - body += '\n' + value.location; - } + if (value.type == 'agenda' && (value.event_date_start_formated != null || value.event_date_start_formated['event_date_start'] != '')) { + body += '\n' + value.event_date_start_formated; + } - if (value.type == 'agenda' && (value.event_date_start_formated != null || value.event_date_start_formated['event_date_start'] != '')) { - body += '\n' + value.event_date_start_formated; - } + if (value.type == 'agenda') + { + url = '' + value.id_agenda; + title = 'transnoentities('EventReminder')) ?>'; + } + var extra = { + icon: '', + //image: '', + body: body, + tag: value.id_agenda, + requireInteraction: true + }; - if (value.type == 'agenda') - { - url = '' + value.id_agenda; - title = 'trans('EventReminder')) ?>'; - } - var extra = { - icon: '', - //image: '', - body: body, - tag: value.id_agenda, - requireInteraction: true + // We release the notify + console.log("Send notification on browser"); + noti[index] = new Notification(title, extra); + if (index==0 && audio) + { + audio.play(); + } + + if (noti[index]) { + noti[index].onclick = function (event) { + console.log("A click on notification on browser has been done"); + event.preventDefault(); // prevent the browser from focusing the Notification's tab + window.focus(); + window.open(url, '_blank'); + noti[index].close(); }; - // We release the notify - console.log("Send notification on browser"); - noti[index] = new Notification(title, extra); - if (index==0 && audio) - { - audio.play(); - } + listofreminderids = (listofreminderids == '' ? '' : listofreminderids + ',') + value.id_reminder + } + }); - if (noti[index]) { - noti[index].onclick = function (event) { - console.log("A click on notification on browser has been done"); - event.preventDefault(); // prevent the browser from focusing the Notification's tab - window.focus(); - window.open(url, '_blank'); - noti[index].close(); - }; - - listofreminderids = (listofreminderids == '' ? '' : listofreminderids + ',') + value.id_reminder - } - }); - - // Update status of all notifications we sent on browser (listofreminderids) - console.log("Flag notification as done for listofreminderids="+listofreminderids); - $.ajax(""+listofreminderids, { - type: "post", // Usually post or get - async: true, - data: { time_js_next_test: time_js_next_test, token: 'notrequired' } - }); - } else { - console.log("No reminder to do found, next search at "+time_js_next_test); - } + // Update status of all notifications we sent on browser (listofreminderids) + console.log("Flag notification as done for listofreminderids="+listofreminderids); + $.ajax(""+listofreminderids, { + type: "POST", // Usually post or get + async: true, + data: { time_js_next_test: time_js_next_test, token: 'notrequired' } + }); + } else { + console.log("No reminder to do found, next search at "+time_js_next_test); } - }); - } - else - { - console.log("Cancel check_events. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); - } + } + }); + } + else + { + console.log("Cancel check_events. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https)."); } - * Copyright (C) 2015-2017 Laurent Destailleur + * Copyright (C) 2021 Josep Lluís Amador * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -257,7 +258,7 @@ function updateTotal(days,mode) result=parseTime(jQuery('.totalDay'+stringdays).text(),taskTime); if (result >= 0) { - totalhour = totalhour + taskTime.getHours(); + totalhour = totalhour + taskTime.getHours() + result*24; totalmin = totalmin + taskTime.getMinutes(); } } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 303382f285b..683b92fb8d9 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -123,6 +123,7 @@ function versioncompare($versionarray1, $versionarray2) * Return version PHP * * @return array Tableau de version (vermajeur,vermineur,autre) + * @see versioncompare() */ function versionphparray() { @@ -133,6 +134,7 @@ function versionphparray() * Return version Dolibarr * * @return array Tableau de version (vermajeur,vermineur,autre) + * @see versioncompare() */ function versiondolibarrarray() { @@ -1545,6 +1547,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print ''; } + print '
    '; print ''; print ''; print ''; @@ -1715,6 +1718,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') } } print '
    '.$langs->trans("Description").'
    '; + print '
    '; if (!empty($strictw3c) && $strictw3c == 1) { print '
    '; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 939e6514c13..9796c49cf59 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -61,18 +61,19 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh // Filters //print '
    '; print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; if ($massaction != 'predelete' && $massaction != 'preaffecttag') { // When $massaction == 'predelete', action may be already output to 'delete' by the mass action system. print ''; } - print ''; + print ''; if ($canedit) { print '
    '; + // Type - print ''; + print ''; $multiselect = 0; if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { // We use an option here because it adds bugs when used on agenda page "peruser" and "list" $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); @@ -80,14 +81,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500'); print '
    '; - // Assigned to + // Assigned to user print '
    '; print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="fawidth30 inline-block"'); - print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusxx'); + print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'minwidth150 maxwidth500 widthcentpercentminusxx'); print '
    '; + + // Assigned to user group print '
    '; print img_picto($langs->trans("ToUserOfGroup"), 'object_group', 'class="fawidth30 inline-block"'); - print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'maxwidth500'); + print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'minwidth100 maxwidth500 widthcentpercentminusxx'); print '
    '; if ($conf->resource->enabled) { @@ -168,7 +171,7 @@ function show_array_actions_to_do($max = 5) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY a.datep DESC, a.id DESC"; $sql .= $db->plimit($max, 0); @@ -284,7 +287,7 @@ function show_array_last_actions_done($max = 5) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY a.datep2 DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8874b96eda5..b59b40b8c9d 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -411,10 +411,11 @@ function ajax_dialog($title, $message, $w = 350, $h = 150) * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete * @param int $forcefocus Force focus on field * @param string $widthTypeOfAutocomplete 'resolve' or 'off' + * @param string $idforemptyvalue '-1' * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. * @see selectArrayAjax() of html.form.class */ -function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = 0, $forcefocus = 0, $widthTypeOfAutocomplete = 'resolve') +function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = 0, $forcefocus = 0, $widthTypeOfAutocomplete = 'resolve', $idforemptyvalue = '-1') { global $conf; @@ -454,15 +455,15 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = templateResult: function (data, container) { /* Format visible output into combo list */ /* Code to add class of origin OPTION propagated to the new select2
  • tag */ if (data.element) { $(container).addClass($(data.element).attr("class")); } - console.log($(data.element).attr("data-html")); - if (data.id == -1 && $(data.element).attr("data-html") == undefined) { + //console.log($(data.element).attr("data-html")); + if (data.id == '.((int) $idforemptyvalue).' && $(data.element).attr("data-html") == undefined) { return \' \'; } if ($(data.element).attr("data-html") != undefined) return htmlEntityDecodeJs($(data.element).attr("data-html")); // If property html set, we decode html entities and use this return data.text; }, templateSelection: function (selection) { /* Format visible output of selected value */ - if (selection.id == -1) return \'\'+selection.text+\'\'; + if (selection.id == '.((int) $idforemptyvalue).') return \'\'+selection.text+\'\'; return selection.text; }, escapeMarkup: function(markup) { @@ -539,14 +540,15 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = * @param string $code Name of constant * @param array $input Array of complementary actions to do if success ("disabled"|"enabled'|'set'|'del') => CSS element to switch, 'alert' => message to show, ... Example: array('disabled'=>array(0=>'cssid')) * @param int $entity Entity. Current entity is used if null. - * @param int $revertonoff Revert on/off + * @param int $revertonoff 1=Revert on/off * @param int $strict Use only "disabled" with delConstant and "enabled" with setConstant * @param int $forcereload Force to reload page if we click/change value (this is supported only when there is no 'alert' option in input) * @param string $marginleftonlyshort 1 = Add a short left margin on picto, 2 = Add a larger left margin on picto, 0 = No left margin. Works for fontawesome picto only. * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. + * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it * @return string */ -function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0) +function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0) { global $conf, $langs, $user; @@ -592,9 +594,13 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton; if (input.alert.del.noButton) noButton = input.alert.del.noButton; confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict, userid, token); - } else { - delConstant(url, code, input, entity, 0, '.$forcereload.', userid, token); - } + } else {'; + if (empty($setzeroinsteadofdel)) { + $out .=' delConstant(url, code, input, entity, 0, '.$forcereload.', userid, token);'; + } else { + $out .=' setConstant(url, code, input, entity, 0, '.$forcereload.', userid, token, 0);'; + } + $out .= ' } }); }); '."\n"; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 99bcd2c3921..7d261f2d5ab 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -227,7 +227,7 @@ function societe_prepare_head(Societe $object) if (empty($conf->stripe->enabled)) { $sql .= " AND n.stripe_card_ref IS NULL"; } else { - $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".$servicestatus."))"; + $sql .= " AND (n.stripe_card_ref IS NULL OR (n.stripe_card_ref IS NOT NULL AND n.status = ".((int) $servicestatus)."))"; } $resql = $db->query($sql); @@ -715,10 +715,7 @@ function getCountriesInEEC() global $conf, $db; $country_code_in_EEC = array(); - if (!empty($conf->global->MAIN_COUNTRIES_IN_EEC)) { - // For example MAIN_COUNTRIES_IN_EEC = 'AT,BE,BG,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HR,NL,HU,IE,IM,IT,LT,LU,LV,MC,MT,PL,PT,RO,SE,SK,SI,UK' - $country_code_in_EEC = explode(',', $conf->global->MAIN_COUNTRIES_IN_EEC); - } elseif (!empty($conf->cache['country_code_in_EEC'])) { + if (!empty($conf->cache['country_code_in_EEC'])) { // Use of cache to reduce number of database requests $country_code_in_EEC = $conf->cache['country_code_in_EEC']; } else { @@ -963,9 +960,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') $contactstatic->fields = array( 'name' =>array('type'=>'varchar(128)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1), - 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20), - 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>30), - 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>40), + 'poste' =>array('type'=>'varchar(128)', 'label'=>'PostOrFunction', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'index'=>1, 'position'=>20), + 'address' =>array('type'=>'varchar(128)', 'label'=>'Address', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>3, 'index'=>1, 'position'=>30), + 'role' =>array('type'=>'checkbox', 'label'=>'Role', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>4, 'index'=>1, 'position'=>40), 'statut' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>50, 'arrayofkeyval'=>array(0=>$contactstatic->LibStatut(0, 1), 1=>$contactstatic->LibStatut(1, 1))), ); @@ -1448,7 +1445,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin if (is_object($objcon) && $objcon->id > 0) { $force_filter_contact = true; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".$objcon->id; + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); } if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) { @@ -1457,7 +1454,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin $sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as er"; $sql .= " ON er.resource_type = 'dolresource'"; $sql .= " AND er.element_id = a.id"; - $sql .= " AND er.resource_id = ".$filterobj->id; + $sql .= " AND er.resource_id = ".((int) $filterobj->id); } elseif (is_object($filterobj) && get_class($filterobj) == 'Project') { /* Nothing */ } elseif (is_object($filterobj) && get_class($filterobj) == 'Adherent') { @@ -1616,8 +1613,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin 'contact_id'=>$obj->fk_contact, 'socpeopleassigned' => $contactaction->socpeopleassigned, - 'lastname'=>$obj->lastname, - 'firstname'=>$obj->firstname, + 'lastname' => empty($obj->lastname) ? '' : $obj->lastname, + 'firstname' => empty($obj->firstname) ? '' : $obj->firstname, 'fk_element'=>$obj->fk_element, 'elementtype'=>$obj->elementtype, // Type of event @@ -1902,7 +1899,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin } // Status - $out .= ''.$actionstatic->LibStatut($histo[$key]['percent'], 3, 0, $histo[$key]['datestart']).''; + $out .= ''.$actionstatic->LibStatut($histo[$key]['percent'], 2, 0, $histo[$key]['datestart']).''; // Actions $out .= ''; @@ -1940,7 +1937,7 @@ function show_subsidiaries($conf, $langs, $db, $object) $sql = "SELECT s.rowid, s.client, s.fournisseur, s.nom as name, s.name_alias, s.email, s.address, s.zip, s.town, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur, s.canvas"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - $sql .= " WHERE s.parent = ".$object->id; + $sql .= " WHERE s.parent = ".((int) $object->id); $sql .= " AND s.entity IN (".getEntity('societe').")"; $sql .= " ORDER BY s.nom"; @@ -1951,7 +1948,9 @@ function show_subsidiaries($conf, $langs, $db, $object) $socstatic = new Societe($db); print load_fiche_titre($langs->trans("Subsidiaries"), '', ''); - print "\n".''."\n"; + + print "\n".'
    '."\n"; + print '
    '."\n"; print ''; print ''; @@ -1979,17 +1978,17 @@ function show_subsidiaries($conf, $langs, $db, $object) print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; @@ -1997,6 +1996,7 @@ function show_subsidiaries($conf, $langs, $db, $object) $i++; } print "\n
    '.$langs->trans("Company").''.$langs->trans("Address").''.$langs->trans("Zip").'
    '; + print ''; print $socstatic->getNomUrl(1); print ''.$obj->address.''.$obj->zip.''.$obj->town.''.$obj->code_client.''.dol_escape_htmltag($obj->address).''.$obj->zip.''.$obj->town.''.$obj->code_client.''; - print ''; + print ''; print img_edit(); print '
    \n"; + print '
  • '."\n"; } print "
    \n"; diff --git a/htdocs/core/lib/cron.lib.php b/htdocs/core/lib/cron.lib.php index 2d111e37ef8..5216ff554e4 100644 --- a/htdocs/core/lib/cron.lib.php +++ b/htdocs/core/lib/cron.lib.php @@ -114,8 +114,13 @@ function dol_print_cron_urls() print ''.$langs->trans("FileToLaunchCronJobs").':
    '; - $file = '/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY) ? 'securitykey' : ''.$conf->global->CRON_KEY.'').' '.$logintouse.' [cronjobid]'; - print '
    \n"; + $pathtoscript = '/pathtoscript'; + if (!empty($conf->global->MAIN_DOL_SCRIPTS_ROOT)) { + $pathtoscript = $conf->global->MAIN_DOL_SCRIPTS_ROOT; + } + + $file = $pathtoscript.'/scripts/cron/cron_run_jobs.php '.(empty($conf->global->CRON_KEY) ? 'securitykey' : ''.$conf->global->CRON_KEY.'').' '.$logintouse.' [cronjobid]'; + print '
    \n"; print '
    '; // Add note @@ -131,7 +136,7 @@ function dol_print_cron_urls() if ($linuxlike) { print $langs->trans("CronExplainHowToRunUnix"); print '
    '; - print '
    '; + print '
    '; } else { print $langs->trans("CronExplainHowToRunWin"); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 0dde3a93159..8fe9352457b 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -294,32 +294,36 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l /** - * Generate a SQL string to make a filter into a range (for second of date until last second of date) + * Generate a SQL string to make a filter into a range (for second of date until last second of date). + * This method allows to maje SQL request that will deal correctly the timezone of server. * * @param string $datefield Name of SQL field where apply sql date filter * @param int $day_date Day date * @param int $month_date Month date * @param int $year_date Year date * @param int $excludefirstand Exclude first and + * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. + * Note: In database, dates are always fot the server TZ. * @return string $sqldate String with SQL filter */ -function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0) +function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) { global $db; $sqldate = ""; if ($month_date > 0) { if ($year_date > 0 && empty($day_date)) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, false)); - $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, false))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm)); + $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'"; } elseif ($year_date > 0 && !empty($day_date)) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date)); - $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_date, $day_date, $year_date, $gm)); + $sqldate .= "' AND '".$db->idate(dol_mktime(23, 59, 59, $month_date, $day_date, $year_date, $gm))."'"; } else { + // This case is not reliable on TZ, but we should not need it. $sqldate .= ($excludefirstand ? "" : " AND ")." date_format( ".$datefield.", '%c') = '".$db->escape($month_date)."'"; } } elseif ($year_date > 0) { - $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, false)); - $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, false))."'"; + $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, 1, $gm)); + $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, 12, $gm))."'"; } return $sqldate; } @@ -664,15 +668,16 @@ function getGMTEasterDatetime($year) * * @param int $timestampStart Timestamp start (UTC with hour, min, sec = 0) * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) - * @param string $country_code Country code - * @param int $lastday Last day is included, 0: no, 1:yes + * @param string $country_code Country code + * @param int $lastday Last day is included, 0: no, 1:yes * @param int $includesaturday Include saturday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includesunday Include sunday as non working day (-1=use setup, 0=no, 1=yes) * @param int $includefriday Include friday as non working day (-1=use setup, 0=no, 1=yes) - * @return int|string Number of non working days or error message string if error + * @param int $includemonday Include monday as non working day (-1=use setup, 0=no, 1=yes) + * @return int|string Number of non working days or error message string if error * @see num_between_day(), num_open_day() */ -function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1) +function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $includesaturday = -1, $includesunday = -1, $includefriday = -1, $includemonday = -1) { global $db, $conf, $mysoc; @@ -686,6 +691,9 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', if (empty($country_code)) { $country_code = $mysoc->country_code; } + if ($includemonday < 0) { + $includemonday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY : 0); + } if ($includefriday < 0) { $includefriday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY : 0); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ce5e7129bcf..766d7cdb763 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -377,7 +377,7 @@ function completeFileArrayWithDatabaseInfo(&$filearray, $relativedir) $ecmfile->fullpath_orig = $filearray[$key]['fullname']; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -933,7 +933,7 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te $ecmfile->fullpath_orig = $srcfile; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $resultecm = $ecmfile->create($user); if ($resultecm < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -1785,11 +1785,18 @@ function addFileIntoDatabaseIndex($dir, $file, $fullpathorig = '', $mode = 'uplo $ecmfile->fullpath_orig = $fullpathorig; $ecmfile->gen_or_uploaded = $mode; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content if (is_object($object) && $object->id > 0) { $ecmfile->src_object_id = $object->id; - $ecmfile->src_object_type = $object->table_element; + if (isset($object->table_element)) { + $ecmfile->src_object_type = $object->table_element; + } else { + dol_syslog('Error: object ' . get_class($object) . ' has no table_element attribute.'); + return -1; + } + if (isset($object->src_object_description)) $ecmfile->description = $object->src_object_description; + if (isset($object->src_object_keywords)) $ecmfile->keywords = $object->src_object_keywords; } if ($setsharekey) { @@ -2232,9 +2239,10 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( } /** - * Security check when accessing to a document (used by document.php, viewimage.php and webservices) + * Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents). + * TODO Replace code that set $accesallowed by a call to restrictedArea() * - * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp') + * @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Exemple: 'medias', 'invoice', 'logs', 'tax-vat', ... * @param string $original_file Relative path with filename, relative to modulepart. * @param string $entity Restrict onto entity (0=no restriction) * @param User $fuser User object (forced) @@ -2262,10 +2270,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $entity = 0; } } - // Fix modulepart + // Fix modulepart for backward compatibility if ($modulepart == 'users') { $modulepart = 'user'; } + if ($modulepart == 'tva') { + $modulepart = 'tax-vat'; + } //print 'dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity; dol_syslog('dol_check_secure_access_document modulepart='.$modulepart.' original_file='.$original_file.' entity='.$entity); @@ -2435,7 +2446,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } $original_file = (!empty($conf->product->multidir_temp[$entity]) ? $conf->product->multidir_temp[$entity] : $conf->service->multidir_temp[$entity]).'/'.$original_file; - } elseif (in_array($modulepart, array('tax', 'tax-vat')) && !empty($conf->tax->dir_output)) { + } elseif (in_array($modulepart, array('tax', 'tax-vat', 'tva')) && !empty($conf->tax->dir_output)) { // Wrapping for taxes if ($fuser->rights->tax->charges->{$lire}) { $accessallowed = 1; @@ -2446,6 +2457,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping for events if ($fuser->rights->agenda->myactions->{$read}) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on the given agenda event on properties and assigned users + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $tmpobject = new ActionComm($db); + $tmpobject->fetch((int) $refname); + $accessallowed = checkUserAccessToObject($user, array('agenda'), $tmpobject->id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id', ''); + if ($user->socid && $tmpobject->socid) { + $accessallowed = checkUserAccessToObject($user, array('societe'), $tmpobject->socid); + } + } } $original_file = $conf->agenda->dir_output.'/'.$original_file; } elseif ($modulepart == 'category' && !empty($conf->categorie->multidir_output[$entity])) { @@ -2612,12 +2633,26 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Wrapping pour les projets if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + $tmpproject = new Project($db); + $tmpproject->fetch('', $refname); + $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', ''); + } } $original_file = $conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; + // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project + if ($refname && !preg_match('/^specimen/i', $original_file)) { + include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $tmptask = new Task($db); + $tmptask->fetch('', $refname); + $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet&project', '', '', 'rowid', ''); + } } $original_file = $conf->projet->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; diff --git a/htdocs/core/lib/fourn.lib.php b/htdocs/core/lib/fourn.lib.php index 68910357269..efc9f60147c 100644 --- a/htdocs/core/lib/fourn.lib.php +++ b/htdocs/core/lib/fourn.lib.php @@ -59,7 +59,7 @@ function facturefourn_prepare_head($object) $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; - $sql .= " WHERE pfd.fk_facture_fourn = ".$object->id; + $sql .= " WHERE pfd.fk_facture_fourn = ".((int) $object->id); $sql .= " AND pfd.ext_payment_id IS NULL"; $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8251c850ddf..a9cb45e06fb 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -634,17 +634,17 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null $out = checkVal($out, $check, $filter, $options); } - // Sanitizing for special parameters. There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL. + // Sanitizing for special parameters. + // Note: There is no reason to allow the backtopage, backtolist or backtourl parameter to contains an external URL. if ($paramname == 'backtopage' || $paramname == 'backtolist' || $paramname == 'backtourl') { - $out = str_replace('\\', '/', $out); - $out = str_replace(array(':', ';', '@'), '', $out); - + $out = str_replace('\\', '/', $out); // Can be before the loop because only 1 char is replaced. No risk to get it after other replacements. + $out = str_replace(array(':', ';', '@'), '', $out); // Can be before the loop because only 1 char is replaced. No risk to get it after other replacements. do { $oldstringtoclean = $out; $out = str_ireplace(array('javascript', 'vbscript', '&colon', '&#'), '', $out); } while ($oldstringtoclean != $out); - $out = preg_replace(array('/^[a-z]*\/\/+/i'), '', $out); + $out = preg_replace(array('/^[a-z]*\/\/+/i'), '', $out); // We remove schema*// to remove external URL } // Code for search criteria persistence. @@ -684,7 +684,7 @@ function GETPOSTINT($paramname, $method = 0, $filter = null, $options = null, $n } /** - * Return a value after checking on a rule. + * Return a value after checking on a rule. A sanitization may also have been done. * * @param string $out Value to check/clear. * @param string $check Type of check/sanitizing @@ -775,13 +775,48 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = } break; case 'restricthtml': // Recommended for most html textarea + case 'restricthtmlallowunvalid': do { $oldstringtoclean = $out; + + if (!empty($out) && !empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) && $check != 'restricthtmlallowunvalid') { + try { + $dom = new DOMDocument; + // Add a trick to solve pb with text without parent tag + // like '

    Foo

    bar

    ' that ends up with '

    Foo

    bar

    ' + // like 'abc' that ends up with '

    abc

    ' + $out = '
    '.$out.'
    '; + + $dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); + $out = trim($dom->saveHTML()); + + // Remove the trick added to solve pb with text without parent tag + $out = preg_replace('/^
    /', '', $out); + $out = preg_replace('/<\/div>$/', '', $out); + } catch (Exception $e) { + //print $e->getMessage(); + return 'InvalidHTMLString'; + } + } + + // Ckeditor use the numeric entitic for apostrophe so we force it to text entity (all other special chars are correctly + // encoded using text entities). This is a fix for CKeditor (CKeditor still encode in HTML4 instead of HTML5). + $out = preg_replace('/'/i', ''', $out); + + // We replace chars from a/A to z/Z encoded with numeric HTML entities with the real char so we won't loose the chars at the next step. + // No need to use a loop here, this step is not to sanitize (this is done at next step, this is to try to save chars, even if they are + // using a non coventionnel way to be encoded, to not have them sanitized just after) + $out = preg_replace_callback('/&#(x?[0-9][0-9a-f]+;?)/i', 'realCharForNumericEntities', $out); + + // Now we remove all remaining HTML entities starting with a number. We don't want such entities. + $out = preg_replace('/&#x?[0-9]+/i', '', $out); // For example if we have javascript with an entities without the ; to hide the 'a' of 'javascript'. + $out = dol_string_onlythesehtmltags($out, 0, 1, 1); // We should also exclude non expected attributes if (!empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)) { - $out = dol_string_onlythesehtmlattributes($out); + // Warning, the function may add a LF so we are forced to trim to compare with old $out without having always a difference and an infinit loop. + $out = trim(dol_string_onlythesehtmlattributes($out)); } } while ($oldstringtoclean != $out); break; @@ -797,7 +832,6 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = } - if (!function_exists('dol_getprefix')) { /** * Return a prefix to use for this Dolibarr instance, for session/cookie names or email id. @@ -985,7 +1019,7 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0) function dol_clone($object, $native = 0) { if (empty($native)) { - $myclone = unserialize(serialize($object)); + $myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields } else { $myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable) } @@ -1017,10 +1051,11 @@ function dol_size($size, $type = '') /** - * Clean a string to use it as a file name + * Clean a string to use it as a file name. + * Replace also '--' and ' -' strings, they are used for parameters separation. * * @param string $str String to clean - * @param string $newstr String to replace bad chars with + * @param string $newstr String to replace bad chars with. * @param int $unaccent 1=Remove also accent (default), 0 do not remove them * @return string String cleaned (a-zA-Z_) * @@ -1032,12 +1067,16 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) // Char '>' '<' '|' '$' and ';' are special chars for shells. // Char '/' and '\' are file delimiters. // -- car can be used into filename to inject special paramaters like --use-compress-program to make command with file as parameter making remote execution of command - $filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°', '$', ';', '--'); - return dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); + $filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°', '$', ';'); + $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); + $tmp = preg_replace('/\-\-+/', '_', $tmp); + $tmp = preg_replace('/\s+\-/', ' _', $tmp); + return $tmp; } /** - * Clean a string to use it as a path name + * Clean a string to use it as a path name. + * Replace also '--' and ' -' strings, they are used for parameters separation. * * @param string $str String to clean * @param string $newstr String to replace bad chars with @@ -1049,7 +1088,10 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1) function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1) { $filesystem_forbidden_chars = array('<', '>', '?', '*', '|', '"', '°'); - return dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); + $tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars); + $tmp = preg_replace('/\-\-+/', '_', $tmp); + $tmp = preg_replace('/\s+\-/', ' _', $tmp); + return $tmp; } /** @@ -1145,21 +1187,26 @@ function dol_string_unaccent($str) * Clean a string from all punctuation characters to use it as a ref or login. * This is a more complete function than dol_sanitizeFileName. * - * @param string $str String to clean - * @param string $newstr String to replace forbidden chars with - * @param array $badcharstoreplace List of forbidden characters - * @return string Cleaned string + * @param string $str String to clean + * @param string $newstr String to replace forbidden chars with + * @param array|string $badcharstoreplace List of forbidden characters to replace + * @param array|string $badcharstoremove List of forbidden characters to remove + * @return string Cleaned string * * @see dol_sanitizeFilename(), dol_string_unaccent(), dol_string_nounprintableascii() */ -function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '') +function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '', $badcharstoremove = '') { $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName $forbidden_chars_to_remove = array(); + //$forbidden_chars_to_remove=array("(",")"); + if (is_array($badcharstoreplace)) { $forbidden_chars_to_replace = $badcharstoreplace; } - //$forbidden_chars_to_remove=array("(",")"); + if (is_array($badcharstoremove)) { + $forbidden_chars_to_remove = $badcharstoremove; + } return str_replace($forbidden_chars_to_replace, $newstr, str_replace($forbidden_chars_to_remove, "", $str)); } @@ -1469,21 +1516,23 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di //print ''; $out = ''.$buttonstring.''; + $out .= ''; $out .= ''; + jQuery(document).ready(function () { + jQuery(".button_'.$name.'").click(function () { + console.log("Open popup with jQuery(...).dialog() on URL '.dol_escape_js(DOL_URL_ROOT.$url).'") + var $dialog = $(\'
    \').html(\'\') + .dialog({ + autoOpen: false, + modal: true, + height: (window.innerHeight - 150), + width: \'80%\', + title: "'.dol_escape_js($label).'" + }); + $dialog.dialog(\'open\'); + }); + }); + '; return $out; } @@ -1658,7 +1707,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $tabsname = str_replace("@", "", $picto); } $out .= '
    '; - $out .= ''.$langs->trans("More").'... ('.$nbintab.')'; // Do not use "reposition" class in the "More". + $out .= ''.$langs->trans("More").'... ('.$nbintab.')'; // Do not use "reposition" class in the "More". $out .= '
    '; $out .= $outmore; $out .= '
    '; @@ -1733,10 +1782,10 @@ function dol_get_fiche_end($notab = 0) * @param int $shownav Show Condition (navigation is shown if value is 1) * @param string $fieldid Nom du champ en base a utiliser pour select next et previous (we make the select max and min on this field). Use 'none' for no prev/next search. * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous - * @param string $morehtmlref More html to show after ref + * @param string $morehtmlref More html to show after the ref (see $morehtmlleft for before) * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name - * @param string $morehtmlleft More html code to show before ref + * @param string $morehtmlleft More html code to show before the ref (see $morehtmlref for after) * @param string $morehtmlstatus More html code to show under navigation arrows * @param int $onlybanner Put this to 1, if the card will contains only a banner (this add css 'arearefnobottom' on div) * @param string $morehtmlright More html code to show before navigation arrows @@ -1919,7 +1968,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi } if ($showbarcode) { - $morehtmlleft .= '
    '.$form->showbarcode($object).'
    '; + $morehtmlleft .= '
    '.$form->showbarcode($object, 100, 'photoref').'
    '; } if ($object->element == 'societe') { @@ -2782,7 +2831,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor * @param int $socid Id of third party if known * @param string $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set) * @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx - * @param string $withpicto Show picto + * @param string $withpicto Show picto ('fax', 'phone', 'mobile') * @param string $titlealt Text to show on alt * @param int $adddivfloat Add div float around phone. * @return string Formated phone number @@ -2820,7 +2869,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli } elseif (dol_strlen($phone) == 11) { $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 2).$separ.substr($newphone, 5, 2).$separ.substr($newphone, 7, 2).$separ.substr($newphone, 9, 2); } elseif (dol_strlen($phone) == 12) { - $newphone = substr($newphone, 0, 4).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); + $newphone = substr($newphone, 0, 3).$separ.substr($newphone, 3, 1).$separ.substr($newphone, 4, 2).$separ.substr($newphone, 6, 2).$separ.substr($newphone, 8, 2).$separ.substr($newphone, 10, 2); } } elseif (strtoupper($countrycode) == "CA") { if (dol_strlen($phone) == 10) { @@ -3005,11 +3054,18 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli '__PASS__'=>$clicktodial_password); $url = make_substitutions($url, $substitarray); $newphonesav = $newphone; - $newphone = 'global->CLICKTODIAL_FORCENEWTARGET)) { - $newphone .= ' target="_blank"'; + if (empty($conf->global->CLICKTODIAL_DO_NOT_USE_AJAX_CALL)) { + // Default and recommended: New method using ajax without submiting a page making a javascript history.go(-1) back + $newphone = ''; + } else { + // Old method + $newphone = 'global->CLICKTODIAL_FORCENEWTARGET)) { + $newphone .= ' target="_blank"'; + } + $newphone .= '>'.$newphonesav.''; } - $newphone .= '>'.$newphonesav.''; } //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) @@ -3113,7 +3169,7 @@ function getUserRemoteIP() if (empty($_SERVER['HTTP_X_FORWARDED_FOR']) || preg_match('/[^0-9\.\:,\[\]]/', $_SERVER['HTTP_X_FORWARDED_FOR'])) { if (empty($_SERVER['HTTP_CLIENT_IP']) || preg_match('/[^0-9\.\:,\[\]]/', $_SERVER['HTTP_CLIENT_IP'])) { if (empty($_SERVER["HTTP_CF_CONNECTING_IP"])) { - $ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']); // value may have been forged by client + $ip = (empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']); // value may have been the IP of the proxy and not the client } else { $ip = $_SERVER["HTTP_CF_CONNECTING_IP"]; // value here may have been forged by client } @@ -3494,24 +3550,28 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'bug', 'building', - 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'cron', 'cubes', 'multicurrency', + 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', + 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes', + 'multicurrency', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice', 'edit', 'ellipsis-h', 'email', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus', 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group', 'help', 'holiday', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'knowledgemanagement', - 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', + 'label', 'language', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lot', 'long-arrow-alt-right', 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next', 'off', 'on', 'order', - 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip', + 'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip', 'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench', 'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket', + 'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'region', + 'salary', 'shipment', 'state', 'supplier_invoice', 'supplier_invoicea', 'supplier_invoicer', 'supplier_invoiced', + 'technic', 'ticket', 'error', 'warning', - 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', + 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'uncheck', 'user-cog', 'website', 'workstation', @@ -3530,7 +3590,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $arrayconvpictotofa = array( 'account'=>'university', 'accountline'=>'receipt', 'accountancy'=>'search-dollar', 'action'=>'calendar-alt', 'add'=>'plus-circle', 'address'=> 'address-book', 'asset'=>'money-check-alt', 'autofill'=>'fill', - 'bank_account'=>'university', 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'billd'=>'file-medical', 'supplier_invoiced'=>'file-medical', + 'bank_account'=>'university', + 'bill'=>'file-invoice-dollar', 'billa'=>'file-excel', 'billr'=>'file-invoice-dollar', 'billd'=>'file-medical', + 'supplier_invoice'=>'file-invoice-dollar', 'supplier_invoicea'=>'file-excel', 'supplier_invoicer'=>'file-invoice-dollar', 'supplier_invoiced'=>'file-medical', 'bom'=>'shapes', 'chart'=>'chart-line', 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'collab'=>'people-arrows', 'conversation'=>'comments', 'country'=>'globe-americas', 'cron'=>'business-time', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', @@ -3547,16 +3609,16 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', 'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter', - 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', + 'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table', 'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice', 'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle', 'other'=>'square', 'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', - 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', + 'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge', 'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature', - 'refresh'=>'redo', 'resource'=>'laptop-house', - 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', + 'refresh'=>'redo', 'region'=>'map-marked', 'resource'=>'laptop-house', + 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'title_agenda'=>'calendar-alt', @@ -3594,13 +3656,13 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ } if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) { - $morecss = 'em092'; + $morecss .= ' em092'; } if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) { - $morecss = 'em088'; + $morecss .= ' em088'; } if (in_array($pictowithouttext, array('asset', 'intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) { - $morecss = 'em080'; + $morecss .= ' em080'; } // Define $marginleftonlyshort @@ -3657,7 +3719,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'partnership'=>'#6c6aa8', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'reception'=>'#a69944', 'resize'=>'#444', 'rss'=>'#cba', //'shipment'=>'#a69944', 'security'=>'#999', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'timespent'=>'#555', - 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', + 'uncheck'=>'#800', 'uparrow'=>'#555', 'user-cog'=>'#999', 'country'=>'#aaa', 'globe-americas'=>'#aaa', 'region'=>'#aaa', 'state'=>'#aaa', 'website'=>'#304', 'workstation'=>'#a69944' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { @@ -3728,7 +3790,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ return $fullpathpicto; } // tag title is used for tooltip on , tag alt can be used with very simple text on image for blind people - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } /** @@ -3788,10 +3850,11 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $mo * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $moreatt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path + * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. * @return string Return img tag * @see img_object(), img_picto() */ -function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0) +function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $notitle = 0) { global $conf; @@ -3813,7 +3876,7 @@ function img_picto_common($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0 } } - return img_picto($titlealt, $path, $moreatt, 1); + return img_picto($titlealt, $path, $moreatt, 1, 0, $notitle); } /** @@ -3940,7 +4003,7 @@ function img_edit($titlealt = 'default', $float = 0, $other = '') * @param string $other Add more attributes on img * @return string Return tag img */ -function img_view($titlealt = 'default', $float = 0, $other = '') +function img_view($titlealt = 'default', $float = 0, $other = 'class="valignmiddle"') { global $langs; @@ -5180,7 +5243,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ * @param int $option Put 1 if you know that content is already universal format number (so no correction on decimal will be done) * Put 2 if you know that number is a user input (so we know we don't have to fix decimal separator). * @return string Amount with universal numeric format (Example: '99.99999'). - * If conversion fails, it return text unchanged if $rounding = '' or '0' if $rounding is defined. + * If conversion fails, it return text unchanged if ($rounding = '' and $option = 1) or '0' if ($rounding is defined and $option = 1). * If amount is null or '', it returns '' if $rounding = '' or '0' if $rounding is defined.. * * @see price() Opposite function of price2num @@ -5454,7 +5517,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_sell } else { $sql .= " AND t.recuperableonly = '".$db->escape($vatnpr)."'"; } - dol_syslog("get_localtax", LOG_DEBUG); + $resql = $db->query($sql); if ($resql) { @@ -5660,16 +5723,16 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi } /** - * Return vat rate of a product in a particular selling country or default country vat if product is unknown - * Function called by get_default_tva + * Return vat rate of a product in a particular country, or default country vat if product is unknown. + * Function called by get_default_tva(). * * @param int $idprod Id of product or 0 if not a predefined product - * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) + * @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...) * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice) * @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)' * @see get_product_localtax_for_country() */ -function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice = 0) +function get_product_vat_for_country($idprod, $thirdpartytouse, $idprodfournprice = 0) { global $db, $conf, $mysoc; @@ -5683,7 +5746,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr $product = new Product($db); $result = $product->fetch($idprod); - if ($mysoc->country_code == $thirdparty_seller->country_code) { // If selling country is ours + if ($mysoc->country_code == $thirdpartytouse->country_code) { // If country to consider is ours if ($idprodfournprice > 0) { // We want vat for product for a "supplier" object $product->get_buyprice($idprodfournprice, 0, 0, 0); $ret = $product->vatrate_supplier; @@ -5698,8 +5761,8 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr } $found = 1; } else { - // TODO Read default product vat according to countrycode and product. Vat for couple countrycode/product is a feature not implemeted yet. - // May be usefull/required if hidden option SERVICE_ARE_ECOMMERCE_200238EC is on + // TODO Read default product vat according to product and another countrycode. + // Vat for couple anothercountrycode/product is data that is not managed and store yet, so we will fallback on next rule. } } @@ -5708,7 +5771,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr // If vat of product for the country not found or not defined, we return the first higher vat of country. $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdparty_seller->country_code)."'"; + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdpartytouse->country_code)."'"; $sql .= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; $sql .= $db->plimit(1); @@ -5735,15 +5798,15 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr } /** - * Return localtax vat rate of a product in a particular selling country or default country vat if product is unknown + * Return localtax vat rate of a product in a particular country or default country vat if product is unknown * * @param int $idprod Id of product * @param int $local 1 for localtax1, 2 for localtax 2 - * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) + * @param Societe $thirdpartytouse Thirdparty with a ->country_code defined (FR, US, IT, ...) * @return int <0 if KO, Vat rate if OK * @see get_product_vat_for_country() */ -function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) +function get_product_localtax_for_country($idprod, $local, $thirdpartytouse) { global $db, $mysoc; @@ -5759,14 +5822,15 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) $product = new Product($db); $result = $product->fetch($idprod); - if ($mysoc->country_code == $thirdparty_seller->country_code) { // If selling country is ours + if ($mysoc->country_code == $thirdpartytouse->country_code) { // If selling country is ours /* Not defined yet, so we don't use this if ($local==1) $ret=$product->localtax1_tx; elseif ($local==2) $ret=$product->localtax2_tx; $found=1; */ } else { - // TODO Read default product vat according to countrycode and product + // TODO Read default product vat according to product and another countrycode. + // Vat for couple anothercountrycode/product is data that is not managed and store yet, so we will fallback on next rule. } } @@ -5774,7 +5838,7 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) // If vat of product for the country not found or not defined, we return higher vat of country. $sql = "SELECT taux as vat_rate, localtax1, localtax2"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; - $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdparty_seller->country_code)."'"; + $sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($thirdpartytouse->country_code)."'"; $sql .= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql .= $db->plimit(1); @@ -5799,12 +5863,12 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) /** * Function that return vat rate of a product line (according to seller, buyer and product vat rate) - * Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. - * Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. - * Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. - * Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier ou entreprise sans num TVA intra) alors TVA par defaut=TVA du produit vendu. Fin de regle - * Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise avec num TVA) intra alors TVA par defaut=0. Fin de regle - * Sinon TVA proposee par defaut=0. Fin de regle. + * VATRULE 1: Si vendeur non assujeti a TVA, TVA par defaut=0. Fin de regle. + * VATRULE 2: Si le (pays vendeur = pays acheteur) alors TVA par defaut=TVA du produit vendu. Fin de regle. + * VATRULE 3: Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. + * VATRULE 4: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle + * VATRULE 5: Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle + * VATRULE 6: Sinon TVA proposee par defaut=0. Fin de regle. * * @param Societe $thirdparty_seller Objet societe vendeuse * @param Societe $thirdparty_buyer Objet societe acheteuse @@ -5833,9 +5897,19 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, // If services are eServices according to EU Council Directive 2002/38/EC (http://ec.europa.eu/taxation_customs/taxation/vat/traders/e-commerce/article_1610_en.htm) // we use the buyer VAT. if (!empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) { - if ($seller_in_cee && $buyer_in_cee && !$thirdparty_buyer->isACompany()) { - //print 'VATRULE 0'; - return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice); + if ($seller_in_cee && $buyer_in_cee) { + $isacompany = $thirdparty_buyer->isACompany(); + if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (!isValidVATID($thirdparty_buyer)) { + $isacompany = 0; + } + } + + if (!$isacompany) { + //print 'VATRULE 0'; + return get_product_vat_for_country($idprod, $thirdparty_buyer, $idprodfournprice); + } } } @@ -5855,36 +5929,41 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, } // Si (vendeur et acheteur dans Communaute europeenne) et (bien vendu = moyen de transports neuf comme auto, bateau, avion) alors TVA par defaut=0 (La TVA doit etre paye par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de regle. - // Not supported + // 'VATRULE 3' - Not supported // Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = entreprise) alors TVA par defaut=0. Fin de regle // Si (vendeur et acheteur dans Communaute europeenne) et (acheteur = particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle if (($seller_in_cee && $buyer_in_cee)) { $isacompany = $thirdparty_buyer->isACompany(); - if ($isacompany) { - if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - if (!isValidVATID($thirdparty_buyer)) { - //print 'VATRULE 6'; - return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); - } + if ($isacompany && !empty($conf->global->MAIN_USE_VAT_COMPANIES_IN_EEC_WITH_INVALID_VAT_ID_ARE_INDIVIDUAL)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + if (!isValidVATID($thirdparty_buyer)) { + $isacompany = 0; } - //print 'VATRULE 3'; - return 0; - } else { + } + + if (!$isacompany) { //print 'VATRULE 4'; return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + } else { + //print 'VATRULE 5'; + return 0; } } - // Si (vendeur en France et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle - if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee) && !$thirdparty_buyer->isACompany()) { - return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + // Si (vendeur dans Communaute europeene et acheteur hors Communaute europeenne et acheteur particulier) alors TVA par defaut=TVA du produit vendu. Fin de regle + // I don't see any use case that need this rule. + if (!empty($conf->global->MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC) && empty($buyer_in_cee)) { + $isacompany = $thirdparty_buyer->isACompany(); + if (!$isacompany) { + return get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); + //print 'VATRULE extra'; + } } // Sinon la TVA proposee par defaut=0. Fin de regle. // Rem: Cela signifie qu'au moins un des 2 est hors Communaute europeenne et que le pays differe - //print 'VATRULE 5'; + //print 'VATRULE 6'; return 0; } @@ -6266,7 +6345,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, $stringtoclean = preg_replace('/:|�+58|:/i', '', $stringtoclean); // refused string ':' encoded (no reason to have a : encoded like this) to disable 'javascript:...' $stringtoclean = preg_replace('/javascript\s*:/i', '', $stringtoclean); - $temp = strip_tags($stringtoclean, $allowed_tags_string); + $temp = strip_tags($stringtoclean, $allowed_tags_string); // Warning: This remove also undesired changing string obfuscated with that pass injection detection into harmfull string if ($cleanalsosomestyles) { // Clean for remaining html tags $temp = preg_replace('/position\s*:\s*(absolute|fixed)\s*!\s*important/i', '', $temp); // Note: If hacker try to introduce css comment into string to bypass this regex, the string must also be encoded by the dol_htmlentitiesbr during output so it become harmless @@ -6316,8 +6395,8 @@ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes } $return = $dom->saveHTML(); - //$return = 'aaaa

    bb

    ssdd

    '."\n

    aaa

    aa

    bb

    "; + $return = preg_replace('/^/', '', $return); $return = preg_replace('/<\/body><\/html>$/', '', $return); return $return; @@ -6757,6 +6836,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray = array_merge($substitutionarray, array( '__MYCOMPANY_NAME__' => $mysoc->name, '__MYCOMPANY_EMAIL__' => $mysoc->email, + '__MYCOMPANY_PHONE__' => $mysoc->phone, + '__MYCOMPANY_FAX__' => $mysoc->fax, '__MYCOMPANY_PROFID1__' => $mysoc->idprof1, '__MYCOMPANY_PROFID2__' => $mysoc->idprof2, '__MYCOMPANY_PROFID3__' => $mysoc->idprof3, @@ -6845,6 +6926,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__DIRECTDOWNLOAD_URL_PROPOSAL__'] = 'Direct download url of a proposal'; $substitutionarray['__DIRECTDOWNLOAD_URL_ORDER__'] = 'Direct download url of an order'; $substitutionarray['__DIRECTDOWNLOAD_URL_INVOICE__'] = 'Direct download url of an invoice'; + $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = 'Direct download url of a contract'; + $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = 'Direct download url of a supplier proposal'; if (!empty($conf->expedition->enabled) && (!is_object($object) || $object->element == 'shipping')) { $substitutionarray['__SHIPPINGTRACKNUM__'] = 'Shipping tracking number'; @@ -6874,8 +6957,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, // For backward compatibility $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); - $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null)); - $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null); $substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : ''); $substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : ''); @@ -7131,14 +7212,14 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__AMOUNT_TAX3__'] = is_object($object) ? $object->total_localtax2 : ''; } - $substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; - $substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; - $substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? (isset($object->total_vat) ? price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : ''; + $substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? (isset($object->total_vat) ? price($object->total_vat, 0, $outputlangs, 0, -1, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, -1, -1, $conf->currency) : null)) : ''; if ($onlykey != 2 || $mysoc->useLocalTax(1)) { - $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; } if ($onlykey != 2 || $mysoc->useLocalTax(2)) { - $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : ''; + $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : ''; } $substitutionarray['__AMOUNT_MULTICURRENCY__'] = (is_object($object) && isset($object->multicurrency_total_ttc)) ? $object->multicurrency_total_ttc : ''; @@ -7403,7 +7484,7 @@ function print_date_range($date_start, $date_end, $format = '', $outputlangs = ' * @param int $date_end End date * @param string $format Output format * @param Translate $outputlangs Output language - * @param integer $withparenthesis 1=Add parenthesis, 0=non parenthesis + * @param integer $withparenthesis 1=Add parenthesis, 0=no parenthesis * @return string String */ function get_date_range($date_start, $date_end, $format = '', $outputlangs = '', $withparenthesis = 1) @@ -7991,6 +8072,29 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1) global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object global $soc; // For backward compatibility + // Replace dangerous char (used for RCE), we allow only PHP variable testing. + if (strpos($s, '`') !== false) { + return 'Bad string syntax to evaluate: '.$s; + } + + // We block using of php exec or php file functions + $forbiddenphpstrings = array("exec(", "passthru(", "shell_exec(", "system(", "proc_open(", "popen(", "eval(", "dol_eval(", "executeCLI("); + $forbiddenphpstrings = array_merge($forbiddenphpstrings, array("fopen(", "file_put_contents(", "fputs(", "fputscsv(", "fwrite(", "fpassthru(", "unlink(", "mkdir(", "rmdir(", "symlink(", "touch(", "umask(")); + $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('function(', '$$', 'call_user_func(')); + $forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST')); + $forbiddenphpregex = 'global\s+\$'; + do { + $oldstringtoclean = $s; + $s = str_ireplace($forbiddenphpstrings, '__forbiddenstring__', $s); + $s = preg_replace('/'.$forbiddenphpregex.'/', '__forbiddenstring__', $s); + //$s = preg_replace('/\$[a-zA-Z0-9_\->\$]+\(/i', '', $s); // Remove $function( call and $mycall->mymethod( + } while ($oldstringtoclean != $s); + + if (strpos($s, '__forbiddenstring__') !== false) { + dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING); + return 'Bad string syntax to evaluate: '.$s; + } + //print $s."
    \n"; if ($returnvalue) { if ($hideerrors) { @@ -8023,16 +8127,17 @@ function dol_validElement($element) * * @param string $codelang Language code ('en_IN', 'fr_CA', ...) or ISO Country code on 2 characters in uppercase ('IN', 'FR') * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"' or 'class="saturatemedium"') + * @param int $notitlealt No title alt * @return string HTML img string with flag. */ -function picto_from_langcode($codelang, $moreatt = '') +function picto_from_langcode($codelang, $moreatt = '', $notitlealt = 0) { if (empty($codelang)) { return ''; } if ($codelang == 'auto') { - return ''; + return ''; } $langtocountryflag = array( @@ -8058,14 +8163,14 @@ function picto_from_langcode($codelang, $moreatt = '') $flagImage = empty($tmparray[1]) ? $tmparray[0] : $tmparray[1]; } - return img_picto_common($codelang, 'flags/'.strtolower($flagImage).'.png', $moreatt); + return img_picto_common($codelang, 'flags/'.strtolower($flagImage).'.png', $moreatt, 0, $notitlealt); } /** * Return default language from country code. * Return null if not found. * - * @param string $countrycode Country code like 'US', 'FR', 'CA', ... + * @param string $countrycode Country code like 'US', 'FR', 'CA', 'ES', 'MX', ... * @return string Value of locale like 'en_US', 'fr_FR', ... */ function getLanguageCodeFromCountryCode($countrycode) @@ -8089,6 +8194,9 @@ function getLanguageCodeFromCountryCode($countrycode) if ($mysoc->country_code == 'DE') { return 'de_CH'; } + if ($mysoc->country_code == 'IT') { + return 'it_CH'; + } } // Locale list taken from: @@ -8229,6 +8337,7 @@ function getLanguageCodeFromCountryCode($countrycode) 'pt-BR', 'pt-PT', 'rm-CH', + 'ro-MD', 'ro-RO', 'ru-RU', 'rw-RW', @@ -8389,8 +8498,10 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, if (!empty($hookmanager)) { $parameters = array('object' => $object, 'mode' => $mode, 'head' => &$head); $reshook = $hookmanager->executeHooks('completeTabsHead', $parameters); - if ($reshook > 0) { + if ($reshook > 0) { // Hook ask to replace completely the array $head = $hookmanager->resArray; + } else { // Hook + $head = array_merge($head, $hookmanager->resArray); } $h = count($head); } @@ -9664,17 +9775,35 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st /** * Function dolGetButtonAction * - * @param string $label label of button no html : use in alt attribute for accessibility $html is not empty + * @param string $label label of button without HTML : use in alt attribute for accessibility $html is not empty * @param string $html optional : content with html * @param string $actionType default, delete, danger * @param string $url the url for link * @param string $id attribute id of button * @param int $userRight user action right - * @param array $params various params for future : recommended rather than adding more function arguments + * // phpcs:disable + * @param array $params = [ // Various params for future : recommended rather than adding more function arguments + * 'attr' => [ // to add or override button attributes + * 'xxxxx' => '', // your xxxxx attribute you want + * 'class' => '', // to add more css class to the button class attribute + * 'classOverride' => '' // to replace class attribute of the button + * ], + * 'confirm' => [ + * 'url' => 'http://', // Overide Url to go when user click on action btn, if empty default url is $url.?confirm=yes, for no js compatibility use $url for fallback confirm. + * 'title' => '', // Overide title of modal, if empty default title use "ConfirmBtnCommonTitle" lang key + * 'action-btn-label' => '', // Overide label of action button, if empty default label use "Confirm" lang key + * 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key + * 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key + * 'modal' => true, // true|false to display dialog as a modal (with dark background) + * ], + * ] + * // phpcs:enable * @return string html button */ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array()) { + global $hookmanager, $action, $object, $langs; + $class = 'butAction'; if ($actionType == 'danger' || $actionType == 'delete') { $class = 'butActionDelete'; @@ -9682,8 +9811,9 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = } $attr = array( - 'class' => $class - ,'href' => empty($url) ? '' : $url + 'class' => $class, + 'href' => empty($url) ? '' : $url, + 'title' => $label ); if (empty($html)) { @@ -9714,12 +9844,30 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = } } + // Js Confirm button + if ($userRight && !empty($params['confirm'])) { + if (!is_array($params['confirm'])) { + $params['confirm'] = array( + 'url' => $url . (strpos($url, '?') > 0 ? '&' : '?') . 'confirm=yes' + ); + } + + // for js desabled compatibility set $url as call to confirm action and $params['confirm']['url'] to confirmed action + $attr['data-confirm-url'] = $params['confirm']['url']; + $attr['data-confirm-title'] = !empty($params['confirm']['title']) ? $params['confirm']['title'] : $langs->trans('ConfirmBtnCommonTitle', $label); + $attr['data-confirm-content'] = !empty($params['confirm']['content']) ? $params['confirm']['content'] : $langs->trans('ConfirmBtnCommonContent', $label); + $attr['data-confirm-content'] = preg_replace("/\r|\n/", "", $attr['data-confirm-content']); + $attr['data-confirm-action-btn-label'] = !empty($params['confirm']['action-btn-label']) ? $params['confirm']['action-btn-label'] : $langs->trans('Confirm'); + $attr['data-confirm-cancel-btn-label'] = !empty($params['confirm']['cancel-btn-label']) ? $params['confirm']['cancel-btn-label'] : $langs->trans('CloseDialog'); + $attr['data-confirm-modal'] = !empty($params['confirm']['modal']) ? $params['confirm']['modal'] : true; + + $attr['class'].= ' butActionConfirm'; + } + if (isset($attr['href']) && empty($attr['href'])) { unset($attr['href']); } - // TODO : add a hook - // escape all attribute $attr = array_map('dol_escape_htmltag', $attr); @@ -9732,14 +9880,36 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = $tag = !empty($attr['href']) ? 'a' : 'span'; - return '<'.$tag.' '.$compiledAttributes.'>'.$html.''; + + $parameters = array( + 'TCompiledAttr' => $TCompiledAttr, + 'compiledAttributes' => $compiledAttributes, + 'attr' => $attr, + 'tag' => $tag, + 'label' => $label, + 'html' => $html, + 'actionType' => $actionType, + 'url' => $url, + 'id' => $id, + 'userRight' => $userRight, + 'params' => $params + ); + + $reshook = $hookmanager->executeHooks('dolGetButtonAction', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + if (empty($reshook)) { + return '<' . $tag . ' ' . $compiledAttributes . '>' . $html . ''; + } else { + return $hookmanager->resPrint; + } } /** * Add space between dolGetButtonTitle * - * @param string $moreClass more css class label - * @return string html of title separator + * @param string $moreClass more css class label + * @return string html of title separator */ function dolGetButtonTitleSeparator($moreClass = "") { @@ -10043,7 +10213,7 @@ function newToken() */ function currentToken() { - return $_SESSION['token']; + return isset($_SESSION['token']) ? $_SESSION['token'] : ''; } /** @@ -10231,7 +10401,8 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) } /** - * Create a button to copy $valuetocopy in the clipboard + * Create a button to copy $valuetocopy in the clipboard. + * Code that handle the click is inside lib_foot.jsp.php * * @param string $valuetocopy The value to print * @param int $showonlyonhover Show the copy-paste button only on hover @@ -10240,6 +10411,13 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1) */ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '') { + /* + global $conf; + + if (!empty($conf->dol_no_mouse_hover)) { + $showonlyonhover = 0; + }*/ + if ($texttoshow) { $result = ''.$valuetocopy.''.$texttoshow.''; } else { @@ -10248,3 +10426,20 @@ function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $tex return $result; } + + +/** + * Decode an encode string. The string can be encoded in json format (recommended) or with serialize (avoid this) + * + * @param string $stringtodecode String to decode (json or serialize coded) + * @return mixed The decoded object. + */ +function jsonOrUnserialize($stringtodecode) +{ + $result = json_decode($stringtodecode); + if ($result === null) { + $result = unserialize($stringtodecode); + } + + return $result; +} diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e279ced2a3d..d79f688391d 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1043,7 +1043,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $ $regType = array(); if (preg_match('/\{(t+)\}/i', $mask, $regType)) { $masktype = $regType[1]; - $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdpaty typent_code (where n is length in mask) + $masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdparty typent_code (where n is length in mask) $masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask } else { $masktype = ''; @@ -1876,7 +1876,7 @@ function version_os($option = '') * Return PHP version * * @return string PHP version - * @see versionphparray() + * @see versionphparray(), versioncompare() */ function version_php() { @@ -1887,7 +1887,7 @@ function version_php() * Return Dolibarr version * * @return string Dolibarr version - * @see versiondolibarrarray() + * @see versiondolibarrarray(), versioncompare() */ function version_dolibarr() { @@ -2679,57 +2679,6 @@ if (!function_exists('dolEscapeXML')) { } -/** - * Return automatic or manual in current language - * - * @param string $automaticmanual Value to test (1, 'automatic', 'true' or 0, 'manual', 'false') - * @param integer $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Automatic/Manual - * @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color. - * @return string HTML string - */ -function autoOrManual($automaticmanual, $case = 1, $color = 0) -{ - global $langs; - $result = 'unknown'; - $classname = ''; - if ($automaticmanual == 1 || strtolower($automaticmanual) == 'automatic' || strtolower($automaticmanual) == 'true') { // A mettre avant test sur no a cause du == 0 - $result = $langs->trans('automatic'); - if ($case == 1 || $case == 3) { - $result = $langs->trans("Automatic"); - } - if ($case == 2) { - $result = ''; - } - if ($case == 3) { - $result = ' '.$result; - } - - $classname = 'ok'; - } elseif ($automaticmanual == 0 || strtolower($automaticmanual) == 'manual' || strtolower($automaticmanual) == 'false') { - $result = $langs->trans("manual"); - if ($case == 1 || $case == 3) { - $result = $langs->trans("Manual"); - } - if ($case == 2) { - $result = ''; - } - if ($case == 3) { - $result = ' '.$result; - } - - if ($color == 2) { - $classname = 'ok'; - } else { - $classname = 'error'; - } - } - if ($color) { - return ''.$result.''; - } - return $result; -} - - /** * Convert links to local wrapper to medias files into a string into a public external URL readable on internet * @@ -2751,7 +2700,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow) * Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals) * Function used into accountancy FEC export * - * @param float $amount Amount to format + * @param float $amount Amount to format * @return string Chain with formatted upright * @see price2num() Format a numeric into a price for FEC files */ diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 9feddb6f7f5..3398189a771 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -24,7 +24,9 @@ /** * Function to get a content from an URL (use proxy if proxy defined). * Support Dolibarr setup for timeout and proxy. - * Enhancement of CURL to add an anti SSRF protection. + * Enhancement of CURL to add an anti SSRF protection: + * - you can set MAIN_SECURITY_ANTI_SSRF_SERVER_IP to set static ip of server + * - common local lookup ips like 127.*.*.* are automatically added * * @param string $url URL to call. * @param string $postorget 'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'POSTALREADYFORMATED', 'DELETE' @@ -199,12 +201,13 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = } } if ($localurl == 1) { // Only local url allowed (dangerous, may allow to get metadata on server or make internal port scanning) + // Deny ips NOT like 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 0.0.0.0/8, 169.254.0.0/16, 127.0.0.0/8 et 240.0.0.0/4, ::1/128, ::/128, ::ffff:0:0/96, fe80::/10... if (filter_var($iptocheck, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname '.$iptocheck.'. Must be a local URL.'; break; } - if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', '127.0.0.1,::1,'.$conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { + if (!empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) && !in_array($iptocheck, explode(',', $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP))) { $info['http_code'] = 400; $info['content'] = 'Error bad hostname IP (IP is not a local IP defined into list MAIN_SECURITY_SERVER_IP). Must be a local URL in allowed list.'; break; @@ -220,7 +223,7 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+ if (defined('CURLOPT_CONNECT_TO')) { - $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], $newUrlArray['port'], $iptocheck, $newUrlArray['port'])); + $connect_to = array(sprintf("%s:%d:%s:%d", $newUrlArray['host'], empty($newUrlArray['port'])?'':$newUrlArray['port'], $iptocheck, empty($newUrlArray['port'])?'':$newUrlArray['port'])); //var_dump($newUrlArray); //var_dump($connect_to); curl_setopt($ch, CURLOPT_CONNECT_TO, $connect_to); diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index 0a0ebe3ce02..0ccb6a415fc 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -590,7 +590,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', break; } - if (!is_resource($img)) { + if (!is_resource($img) && !($img instanceof \GdImage)) { dol_syslog('Failed to detect type of image. We found infoImg[2]='.$infoImg[2], LOG_WARNING); return 0; } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 16891214ca5..3838829f8cd 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -458,8 +458,9 @@ function getPurchaseInvoicePieChart($socid = 0) /** * Return an HTML table that contains a pie chart of the number of customers or supplier invoices - * @param string $mode Can be customer or fourn - * @return string A HTML table that contains a pie chart of customers or supplier invoices + * + * @param string $mode Can be 'customers' or 'suppliers' + * @return string A HTML table that contains a pie chart of customers or supplier invoices */ function getNumberInvoicesPieChart($mode) { @@ -487,48 +488,55 @@ function getNumberInvoicesPieChart($mode) $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30"; if ($mode == 'customers') { $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; - } elseif ($mode == 'fourn') { + } elseif ($mode == 'fourn' || $mode == 'suppliers') { $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; } else { return ''; } $sql .= " WHERE f.type <> 2"; $sql .= " AND f.fk_statut = 1"; + if (isset($user->socid) && $user->socid > 0) { + $sql .= " AND f.fk_soc = ".((int) $user->socid); + } + $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $total = 0; $dataseries = array(); + while ($i < $num) { $obj = $db->fetch_object($resql); - $dataseries = array(array($langs->trans('InvoiceLate30Days'),$obj->nblate30) - ,array($langs->trans('InvoiceLate15Days'),$obj->nblate15-$obj->nblate30) - ,array($langs->trans('InvoiceLateMinus15Days'),$obj->nblatenow-$obj->nblate15) - ,array($langs->trans('InvoiceNotLate'),$obj->nbnotlatenow-$obj->nbnotlate15) - ,array($langs->trans('InvoiceNotLate15Days'),$obj->nbnotlate15-$obj->nbnotlate30) - ,array($langs->trans('InvoiceNotLate30Days'),$obj->nbnotlate30)); + $dataseries = array(array($langs->trans('InvoiceLate30Days'), $obj->nblate30) + ,array($langs->trans('InvoiceLate15Days'), $obj->nblate15 - $obj->nblate30) + ,array($langs->trans('InvoiceLateMinus15Days'), $obj->nblatenow - $obj->nblate15) + ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) + ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) + ,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30)); $i++; } foreach ($dataseries as $key=>$value) { - $total+=$value[1]; + $total += $value[1]; } $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11); - if ($conf->use_javascript_ajax) { - $result = '
    '; - $result .= ''; - $result .= ''; - $result .= ''; - } elseif ($mode == 'fourn') { - $result .= $langs->trans("SupplierInvoice").''; - } else { - return ''; - } - $result .= ''; + $result = '
    '; + $result .= '
    '.$langs->trans("Statistics").' - '; - if ($mode == 'customers') { - $result .= $langs->trans("CustomerInvoice").'
    '; + $result .= ''; + $result .= ''; + $result .= ''; + + if ($conf->use_javascript_ajax) { $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); $dolgraph->SetDataColor(array_values($colorseries)); @@ -539,17 +547,21 @@ function getNumberInvoicesPieChart($mode) $dolgraph->setWidth('300'); if ($mode == 'customers') { $dolgraph->draw('idgraphcustomerinvoices'); - } elseif ($mode == 'fourn') { + } elseif ($mode == 'fourn' || $mode == 'suppliers') { $dolgraph->draw('idgraphfourninvoices'); } else { return ''; } $result .= ''; - $result .= ''; + $result .= ''; $result .= ''; - $result .= '
    '.$langs->trans("Statistics").' - '; + if ($mode == 'customers') { + $result .= $langs->trans("CustomerInvoice"); + } elseif ($mode == 'fourn' || $mode == 'suppliers') { + $result .= $langs->trans("SupplierInvoice"); + } else { + return ''; + } + $result .= '
    '.$dolgraph->show($total ? 0 : 1).''.$dolgraph->show($total ? 0 : $langs->trans("NoOpenInvoice")).'
    '; - $result .= '
    '; + } else { + // Print text lines } + + $result .= ''; + $result .= '
    '; + return $result; } else { dol_print_error($db); @@ -603,7 +615,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $sql .= " s.nom, s.rowid, s.email, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur,"; $sql .= " cc.rowid, cc.code"; if (!$user->rights->societe->client->voir && !$socid) { - $sql.= ", sc.fk_soc, sc.fk_user"; + $sql .= ", sc.fk_soc, sc.fk_user"; } // Add Group from hooks @@ -734,7 +746,7 @@ function getDraftSupplierTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -842,8 +854,8 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) { global $conf, $db, $langs, $user; - $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; - $sql .= " f.datec"; + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.type, f.total_ht, f.total_tva, f.total_ttc, f.datec,"; + $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -892,6 +904,10 @@ function getCustomerInvoiceLatestEditTable($maxCount = 5, $socid = 0) $objectstatic->ref = $obj->ref; $objectstatic->paye = $obj->paye; $objectstatic->statut = $obj->status; + $objectstatic->total_ht = $obj->total_ht; + $objectstatic->total_tva = $obj->total_tva; + $objectstatic->total_ttc = $obj->total_ttc; + $objectstatic->type = $obj->type; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; @@ -940,8 +956,8 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) { global $conf, $db, $langs, $user; - $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; - $sql .= " f.datec"; + $sql = "SELECT f.rowid, f.entity, f.ref, f.fk_statut as status, f.paye, f.total_ht, f.total_tva, f.total_ttc, f.type, f.ref_supplier, f.datec,"; + $sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -950,7 +966,7 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -990,6 +1006,10 @@ function getPurchaseInvoiceLatestEditTable($maxCount = 5, $socid = 0) $objectstatic->ref = $obj->ref; $objectstatic->paye = $obj->paye; $objectstatic->statut = $obj->status; + $objectstatic->total_ht = $obj->total_ht; + $objectstatic->total_tva = $obj->total_tva; + $objectstatic->total_ttc = $obj->total_ttc; + $objectstatic->type = $obj->type; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; @@ -1062,7 +1082,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); @@ -1250,7 +1270,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND ff.fk_soc = ".$socid; + $sql .= " AND ff.fk_soc = ".((int) $socid); } // Add where from hooks $parameters = array(); diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 484f34c265c..fc274e0d624 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -63,6 +63,33 @@ function member_prepare_head(Adherent $object) $h++; } + $tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty'; + + if ($tabtoadd == 'member') { + if (!empty($user->rights->partnership->read)) { + $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; + $head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id; + $head[$h][1] = $langs->trans("Partnership"); + $head[$h][2] = 'partnership'; + if ($nbPartnership > 0) { + $head[$h][1] .= ''.$nbPartnership.''; + } + $h++; + } + } else { + if (!empty($user->rights->partnership->read)) { + $nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0; + $head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id; + $head[$h][1] = $langs->trans("Partnership"); + $head[$h][2] = 'partnership'; + if ($nbPartnership > 0) { + $head[$h][1] .= ''.$nbPartnership.''; + } + $h++; + } + } + + // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab @@ -70,9 +97,6 @@ function member_prepare_head(Adherent $object) complete_head_from_modules($conf, $langs, $object, $head, $h, 'member'); $nbNote = 0; - if (!empty($object->note)) { - $nbNote++; - } if (!empty($object->note_private)) { $nbNote++; } diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 59d9eb4aa4c..4621e22d122 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -158,7 +158,7 @@ function getValidOnlinePaymentMethods($paymentmethod = '') /** * Return string with full online payment Url * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @return string Url string */ @@ -182,7 +182,7 @@ function showOnlinePaymentUrl($type, $ref) /** * Return string with HTML link for online payment * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param string $label Text or HTML tag to display, if empty it display the URL * @return string Url string @@ -199,7 +199,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '') * Return string with full Url * * @param int $mode 0=True url, 1=Url formated with colors - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param int $amount Amount (required for $type='free' only) * @param string $freetag Free tag @@ -304,7 +304,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } } elseif ($type == 'member' || $type == 'membersubscription') { $newtype = 'member'; - $out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index d1c793c621c..4821bfde2b9 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -705,8 +705,8 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) { global $conf; - // Add a background image on document - if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) { // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image + // Add a background image on document only if good setup of const + if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF) && ($conf->global->MAIN_USE_BACKGROUND_ON_PDF != '-1')) { // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image $pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0), 0, $page_height); $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak @@ -1325,38 +1325,36 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it) // TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation - // ($textwasmodified is replaced with $textwasmodifiedorcompleted and we add completion). + // ($textwasnotmodified is replaced with $textwasmodifiedorcompleted and we add completion). // Set label - // If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation. + // If we want another language, and if label is same than default language (we did not force it to a specific value), we can use translation. //var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit; - $textwasmodified = ($label == $prodser->label); - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) { + $textwasnotmodified = ($label == $prodser->label); + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasnotmodified || $translatealsoifmodified)) { $label = $prodser->multilangs[$outputlangs->defaultlang]["label"]; } // Set desc // Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no - $textwasmodified = false; + $textwasnotmodified = false; if (!empty($desc) && dol_textishtml($desc) && !empty($prodser->description) && dol_textishtml($prodser->description)) { - $textwasmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false); + $textwasnotmodified = (strpos(dol_html_entity_decode($desc, ENT_QUOTES | ENT_HTML5), dol_html_entity_decode($prodser->description, ENT_QUOTES | ENT_HTML5)) !== false); } else { - $textwasmodified = ($desc == $prodser->description); + $textwasnotmodified = ($desc == $prodser->description); } - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasmodified || $translatealsoifmodified)) { + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["description"]) && ($textwasnotmodified || $translatealsoifmodified)) { $desc = $prodser->multilangs[$outputlangs->defaultlang]["description"]; } // Set note - $textwasmodified = ($note == $prodser->note); - if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) { - $note = $prodser->multilangs[$outputlangs->defaultlang]["note"]; + $textwasnotmodified = ($note == $prodser->note_public); + if (!empty($prodser->multilangs[$outputlangs->defaultlang]["other"]) && ($textwasnotmodified || $translatealsoifmodified)) { + $note = $prodser->multilangs[$outputlangs->defaultlang]["other"]; } } } elseif ($object->element == 'facture' || $object->element == 'facturefourn') { - if ($object->type == $object::TYPE_DEPOSIT) { - $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); - } + $desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc); } // Description short of product line diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 9825b2dac2c..64cc72a8879 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -360,7 +360,8 @@ function product_lot_admin_prepare_head() */ function show_stats_for_company($product, $socid) { - global $conf, $langs, $user, $db; + global $conf, $langs, $user, $db, $hookmanager; + $form = new Form($db); $nblines = 0; @@ -558,6 +559,12 @@ function show_stats_for_company($product, $socid) print ''; print ''; } + $parameters = array('socid'=>$socid); + $reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks + if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + + print $hookmanager->resPrint; + return $nblines++; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 0315e848e94..26d66ceae23 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -681,7 +681,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Title of task if (count($arrayfields) > 0 && !empty($arrayfields['t.label']['checked'])) { - print ""; + print ''; if ($showlineingray) { print ''; } @@ -849,7 +849,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t // Contacts of task if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) { - print ''; + print ''; foreach (array('internal', 'external') as $source) { $tab = $lines[$i]->liste_contact(-1, $source); $num = count($tab); @@ -1306,6 +1306,13 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 to start break , -1 no break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + //dol_syslog('projectLinesPerDay inc='.$inc.' preselectedday='.$preselectedday.' task parent id='.$parent.' level='.$level." count(lines)=".$numlines." count(lineswithoutlevel0)=".count($lineswithoutlevel0)); for ($i = 0; $i < $numlines; $i++) { if ($parent == 0) { @@ -1551,6 +1558,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr $disabledtask = 1; } + if ($restrictBefore && $preselectedday < $restrictBefore) { + $disabledtask = 1; + } + // Form to add new time print ''; $tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask); @@ -1699,6 +1710,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 = start break, -1 = never break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + for ($i = 0; $i < $numlines; $i++) { if ($parent == 0) { $level = 0; @@ -1977,6 +1995,12 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ $cssweekend = 'weekend'; } + $disabledtaskday = $disabledtask; + + if (! $disabledtask && $restrictBefore && $tmpday < $restrictBefore) { + $disabledtaskday = 1; + } + $tableCell = ''; //$tableCell .= 'idw='.$idw.' '.$conf->global->MAIN_START_WEEK.' '.$numstartworkingday.'-'.$numendworkingday; $placeholder = ''; @@ -1985,7 +2009,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ //$placeholder=' placeholder="00:00"'; //$tableCell.='+'; } - $tableCell .= ''; @@ -2079,6 +2103,13 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $oldprojectforbreak = (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT) ? 0 : -1); // 0 = start break, -1 = never break } + $restrictBefore = null; + + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + } + for ($i = 0; $i < $numlines; $i++) { if ($parent == 0) { $level = 0; @@ -2231,10 +2262,11 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & $modeinput = 'hours'; $TFirstDay = getFirstDayOfEachWeek($TWeek, date('Y', $firstdaytoshow)); $TFirstDay[reset($TWeek)] = 1; - foreach ($TFirstDay as &$fday) { - $fday--; - } - foreach ($TWeek as $weekNb) { + + $firstdaytoshowarray = dol_getdate($firstdaytoshow); + $year = $firstdaytoshowarray['year']; + $month = $firstdaytoshowarray['mon']; + foreach ($TWeek as $weekIndex => $weekNb) { $weekWorkLoad = $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]; $totalforeachweek[$weekNb] += $weekWorkLoad; @@ -2244,6 +2276,12 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & } $alttitle = $langs->trans("AddHereTimeSpentForWeek", $weekNb); + $disabledtaskweek = $disabledtask; + $firstdayofweek = dol_mktime(0, 0, 0, $month, $TFirstDay[$weekIndex], $year); + + if (! $disabledtask && $restrictBefore && $firstdayofweek < $restrictBefore) { + $disabledtaskweek = 1; + } $tableCell = ''; $placeholder = ''; @@ -2253,7 +2291,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & //$tableCell.='+'; } - $tableCell .= ''; @@ -2693,8 +2731,9 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide // define progress color according to time spend vs workload $progressBarClass = 'progress-bar-info'; + $progressCalculated = 0; if ($task->planned_workload) { - $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); + $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; @@ -2702,12 +2741,12 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $diffTitle = '
    '.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : ''); $diffTitle .= '
    '.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : ''); - //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.doubleval($task->progress * $warningRatio)); - if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) { + //var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.floatval($task->progress * $warningRatio)); + if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { $progressBarClass = 'progress-bar-danger'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; - } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10% + } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% $progressBarClass = 'progress-bar-warning'; $title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point")); $diff = ' '.($task->progress - $progressCalculated).'%'; @@ -2771,18 +2810,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide $out .= ''; $out .= '
    '; - $diffval = doubleval($task->progress) - doubleval($progressCalculated); + $diffval = floatval($task->progress) - floatval($progressCalculated); if ($diffval >= 0) { // good - $out .= '
    '; + $out .= '
    '; if (!empty($task->progress)) { - $out .= '
    '; + $out .= '
    '; } $out .= '
    '; } else { // bad - $out .= '
    '; - $out .= '
    '; + $out .= '
    '; + $out .= '
    '; $out .= '
    '; } $out .= '
    '; @@ -2811,17 +2850,17 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '') // define color according to time spend vs workload $badgeClass = 'badge '; if ($task->planned_workload) { - $progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2); + $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); // this conf is actually hidden, by default we use 10% for "be carefull or warning" $warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10; - if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) { + if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) { $badgeClass .= 'badge-danger'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; } - } elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10% + } elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10% $badgeClass .= 'badge-warning'; if (empty($tooltip)) { $tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%'; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 1440a02983f..d64069aa923 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -98,7 +98,7 @@ function dol_decode($chain, $key = '1') * If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash'). * * @param string $chain String to hash - * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. + * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. * @return string Hash of string * @see getRandomPassword() */ @@ -124,8 +124,10 @@ function dol_hash($chain, $type = '0') return md5($chain); } elseif ($type == '4' || $type == 'md5openldap') { return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base) - } elseif ($type == '5') { + } elseif ($type == '5' || $type == 'sha256') { return hash('sha256', $chain); + } elseif ($type == '6' || $type == 'password_hash') { + return password_hash($chain, PASSWORD_DEFAULT); } elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') { return sha1($chain); } elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') { @@ -173,17 +175,21 @@ function dol_verifyHash($chain, $hash, $type = '0') * This method check permission on module then call checkUserAccessToObject() for permission on object (according to entity and socid of user). * * @param User $user User to check - * @param string $features Features to check (it must be module $object->element. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) + * @param string $features Features to check (it must be module $object->element. Can be a 'or' check with 'levela|levelb'. + * Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...) + * This is used to check permission $user->rights->features->... * @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional). * @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany module. Param not used if objectid is null (optional). * @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'. + * This is used to check permission $user->rights->features->feature2... * @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional) * @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional) * @param int $isdraft 1=The object with id=$objectid is a draft - * @return int Always 1, die process if not allowed + * @param int $mode Mode (0=default, 1=return with not die) + * @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed. * @see dol_check_secure_access_document(), checkUserAccessToObject() */ -function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0) +function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0, $mode = 0) { global $db, $conf; global $hookmanager; @@ -228,7 +234,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f if (isset($hookmanager->resArray['result'])) { if ($hookmanager->resArray['result'] == 0) { - accessforbidden(); // Module returns 0, so access forbidden + if ($mode) { + return 0; + } else { + accessforbidden(); // Module returns 0, so access forbidden + } } } if ($reshook > 0) { // No other test done. @@ -343,14 +353,18 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$readok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Read access is ok"; // Check write permission from module (we need to know write permission to create but also to delete drafts record or to upload files) $createok = 1; $nbko = 0; - $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update'); + $wemustcheckpermissionforcreate = (GETPOST('sendit', 'alpha') || GETPOST('linkit', 'alpha') || GETPOST('action', 'aZ09') == 'create' || GETPOST('action', 'aZ09') == 'update') || GETPOST('roworder', 'alpha', 2); $wemustcheckpermissionfordeletedraft = ((GETPOST("action", "aZ09") == 'confirm_delete' && GETPOST("confirm", "aZ09") == 'yes') || GETPOST("action", "aZ09") == 'delete'); if ($wemustcheckpermissionforcreate || $wemustcheckpermissionfordeletedraft) { @@ -432,7 +446,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if ($wemustcheckpermissionforcreate && !$createok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Write access is ok"; } @@ -445,7 +463,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$createuserok) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Create user access is ok"; } @@ -520,26 +542,34 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f } if (!$deleteok && !($isdraft && $createok)) { - accessforbidden(); + if ($mode) { + return 0; + } else { + accessforbidden(); + } } //print "Delete access is ok"; } - // If we have a particular object to check permissions on, we check this object - // is linked to a company allowed to $user. + // If we have a particular object to check permissions on, we check if $user has permission + // for this given object (link to company, is contact for project, ...) if (!empty($objectid) && $objectid > 0) { $ok = checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select, $parentfortableentity); $params = array('objectid' => $objectid, 'features' => join(',', $featuresarray), 'features2' => $feature2); //print 'checkUserAccessToObject ok='.$ok; - return $ok ? 1 : accessforbidden('', 1, 1, 0, $params); + if ($mode) { + return $ok ? 1 : 0; + } else { + return $ok ? 1 : accessforbidden('', 1, 1, 0, $params); + } } return 1; } /** - * Check access by user to object. - * This function is also called by restrictedArea that check before if module is enabled and permissions of user compared to $action. + * Check access by user to object is ok. + * This function is also called by restrictedArea that check before if module is enabled and if permission of user for $action is ok. * * @param User $user User to check * @param array $featuresarray Features/modules to check. Example: ('user','service','member','project','task',...) @@ -552,7 +582,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f * @return bool True if user has access, False otherwise * @see restrictedArea() */ -function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '') +function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '') { global $db, $conf; @@ -686,6 +716,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $projectstatic = new Project($db); $tmps = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, 0); + $tmparray = explode(',', $tmps); if (!in_array($objectid, $tmparray)) { return false; diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 523b8ccf2cb..4408e2ccd52 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -476,8 +476,8 @@ function getRandomPassword($generic = false, $replaceambiguouschars = null, $len } $generated_password = str_shuffle($randomCode); - } else // Old platform, non cryptographic random - { + } else { + // Old platform, non cryptographic random $max = strlen($lowercase) - 1; for ($x = 0; $x < $nbofchar; $x++) { $tmp = mt_rand(0, $max); diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index 880019d7b97..0814c0f4825 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -246,7 +246,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; //TODO Add link to expeditiondet_batch $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; - $sql .= " AND obj.fk_".$origin." = ".$origin_id; + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_origin_line"; $sql .= " AND ed.fk_expedition = e.rowid"; if ($filter) { diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 4d9d4bb2fa2..f2a6194ab06 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -163,7 +163,7 @@ function showDirectPublicLink($object) $out .= img_picto('', 'object_globe.png').' '.$langs->trans("TicketPublicAccess").'
    '; if ($url) { $out .= '
    '; $out .= ajax_autoselect("directpubliclink", 0); @@ -248,6 +248,12 @@ function llxHeaderTicket($title, $head = "", $disablejs = 0, $disablehead = 0, $ print '
    '; } + if (!empty($conf->global->TICKET_IMAGE_PUBLIC_INTERFACE)) { + print '
    '; + print ''; + print '
    '; + } + print '
    '; print '
    '; @@ -336,7 +342,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no if (is_object($objcon) && $objcon->id > 0) { $force_filter_contact = true; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as r ON a.id = r.fk_actioncomm"; - $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".$objcon->id; + $sql .= " AND r.element_type = '".$db->escape($objcon->table_element)."' AND r.fk_element = ".((int) $objcon->id); } if (is_object($filterobj) && get_class($filterobj) == 'Societe') { @@ -595,15 +601,15 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no $out .= ''; - //$out.=''; $out .= getTitleFieldOfList('Date', 0, $_SERVER["PHP_SELF"], 'a.datep', '', $param, '', $sortfield, $sortorder, '')."\n"; - //$out.=''; $out .= ''.$langs->trans("Search").' : '; if ($donetodo) { $out .= ''; } - $out .= ''.$langs->trans("Type").' '; + $out .= ''; + $out .= ''; + //$out .= img_picto($langs->trans("Type"), 'type'); $out .= $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1, 0, 0, 1, 'minwidth200imp'); $out .= ''; $out .= ''; diff --git a/htdocs/core/lib/treeview.lib.php b/htdocs/core/lib/treeview.lib.php index 255bc47d9a9..fda21e28a21 100644 --- a/htdocs/core/lib/treeview.lib.php +++ b/htdocs/core/lib/treeview.lib.php @@ -162,10 +162,9 @@ function tree_recur($tab, $pere, $rang, $iddivjstree = 'iddivjstree', $donoreset print "\n".'
  • '; if ($showfk) { print '
    '; - print '   '; - print $tab[$x]['title']; - print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; - print ''; + print ''.$tab[$x]['title'].''; + print '  (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')'; + print ''; print $tab[$x]['buttons']; print '
    '; } else { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 700c9c5ed86..29f208e5254 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -110,7 +110,7 @@ function user_prepare_head($object) $nbNote = 0; $sql = "SELECT COUNT(n.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."notify_def as n"; - $sql .= " WHERE fk_user = ".$object->id; + $sql .= " WHERE fk_user = ".((int) $object->id); $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); @@ -339,7 +339,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) $thumbsbyrow = 6; print '
    '; - print ''; + print '
    '; // Title if ($foruserprofile) { @@ -906,7 +906,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) } // Use MAIN_OPTIMIZEFORTEXTBROWSER - if ($foruserprofile) { + if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); $default = $langs->trans('No'); print ''; @@ -953,7 +953,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) // Use MAIN_OPTIMIZEFORTEXTBROWSER - if ($foruserprofile) { + if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORCOLORBLIND)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORCOLORBLIND); $default = $langs->trans('No'); print ''; diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 8824d9cc06d..721b908b9d1 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -283,11 +283,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage, /** - * Save content of the index.php and/or wrapper.php page + * Save content of the index.php and/or the wrapper.php page * * @param string $pathofwebsite Path of website root * @param string $fileindex Full path of file index.php - * @param string $filetpl File tpl the index.php page redirect to + * @param string $filetpl File tpl the index.php page redirect to (used only if $fileindex is provided) * @param string $filewrapper Full path of file wrapper.php * @return boolean True if OK */ diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 9de95be506b..0f3927709eb 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -29,7 +29,7 @@ * * @param string $usertotest Login * @param string $passwordtotest Password - * @param int $entitytotest Number of instance (always 1 if module multicompany not enabled) + * @param int $entitytotest Numero of instance (always 1 if module multicompany not enabled) * @return string Login if OK, '' if KO */ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) @@ -151,10 +151,13 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($result > 0) { if ($result == 2) { // Connection is ok for user/pass into LDAP $login = $usertotest; - if (!empty($conf->global->LDAP_FIELD_LOGIN)) { - $login = $ldap->login; - } dol_syslog("functions_ldap::check_user_password_ldap $login authentication ok"); + // For the case, we search the user id using a search key without the login (but using other fields like id), + // we need to get the real login to use in the ldap answer. + if (!empty($conf->global->LDAP_FIELD_LOGIN) && !empty($ldap->login)) { + $login = $ldap->login; + dol_syslog("functions_ldap::check_user_password_ldap login is now $login (LDAP_FIELD_LOGIN=".$conf->global->LDAP_FIELD_LOGIN.")"); + } require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -207,7 +210,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) } $usertmp = new User($db); - $resultFetchUser = $usertmp->fetch('', $login, $sid); + $resultFetchUser = $usertmp->fetch('', $login, $sid, 1, ($entitytotest > 0 ? $entitytotest : -1)); if ($resultFetchUser > 0) { dol_syslog("functions_ldap::check_user_password_ldap Sync user found user id=".$usertmp->id); // On verifie si le login a change et on met a jour les attributs dolibarr @@ -215,7 +218,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) if ($usertmp->login != $ldap->login && $ldap->login) { $usertmp->login = $ldap->login; $usertmp->update($usertmp); - // TODO Que faire si update echoue car on update avec un login deja existant. + // TODO Que faire si update echoue car on update avec un login deja existant pour un autre compte. } //$resultUpdate = $usertmp->update_ldap2dolibarr($ldap); @@ -231,7 +234,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $usertmp->fetch('', $login); $ret = $mc->checkRight($usertmp->id, $entitytotest); if ($ret < 0) { - dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user '".$usertmp->id."'", LOG_NOTICE); + dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE); $login = ''; // force authentication failure } unset($usertmp); diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index d9c2cad7c9f..b032ba5beb4 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -76,8 +76,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Third parties insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__); @@ -167,7 +167,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_proposal->enabled', __HANDLER__, 'left', 1653__+MAX_llx_menu__, 'commercial', '', 1650__+MAX_llx_menu__, '/comm/propal/stats/index.php?leftmenu=supplier_proposals&mode=supplier', 'Statistics', 1, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 2, __ENTITY__); -- Commercial - Supplier's orders insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5100__+MAX_llx_menu__, 'commercial', 'orders_suppliers', 5__+MAX_llx_menu__, '/fourn/commande/index.php?mainmenu=commercial&leftmenu=orders_suppliers', 'SuppliersOrders', 0, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 6, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewOrder', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5101__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/card.php?mainmenu=commercial&action=create&leftmenu=orders_suppliers', 'NewSupplierOrderShort', 1, 'orders', '($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled', __HANDLER__, 'left', 5102__+MAX_llx_menu__, 'commercial', '', 5100__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', 'List', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 1, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5103__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=0', 'StatusOrderDraftShort', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->supplier_order->enabled && $leftmenu=="orders_suppliers"', __HANDLER__, 'left', 5104__+MAX_llx_menu__, 'commercial', '', 5102__+MAX_llx_menu__, '/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers&statut=1', 'StatusOrderValidated', 1, 'orders', '($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire)', '', 2, 3, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 74c66e899f4..26aa5df16ad 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -334,7 +334,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( 'enabled'=>(!empty($conf->comptabilite->enabled) || !empty($conf->accounting->enabled) || !empty($conf->asset->enabled) || !empty($conf->intracommreport->enabled)), - 'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)), + 'perms'=>(!empty($user->rights->compta->resultat->lire) || !empty($user->rights->accounting->comptarapport->lire) || !empty($user->rights->accounting->mouvements->lire) || !empty($user->rights->asset->read) || !empty($user->rights->intracommreport->read)), 'module'=>'comptabilite|accounting|asset|intracommreport' ); $menu_arr[] = array( @@ -382,6 +382,31 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'submenus' => array(), ); + // Tickets and knwoledge base + $tmpentry = array( + 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)), + 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)), + 'module'=>'ticket|knwoledgemanagement' + ); + $menu_arr[] = array( + 'name' => 'Ticket', + 'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=', + 'title' => "Tickets", + 'level' => 0, + 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'target' => $atarget, + 'mainmenu' => "ticket", + 'leftmenu' => '', + 'position' => 88, + 'id' => $id, + 'idsel' => 'ticket', + 'classname' => $classname = ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"', + 'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright"'), + 'session' => (($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "ticket") ? 0 : 1), + 'loadLangs' => array("other"), + 'submenus' => array(), + ); + // Tools $tmpentry = array( 'enabled'=>1, @@ -665,7 +690,8 @@ function print_end_menu_array() */ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0) { - global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc; + + global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc, $hookmanager; //var_dump($tabMenu); @@ -959,7 +985,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->supplier_order->enabled)) { $langs->load("orders"); $newmenu->add("/fourn/commande/index.php?leftmenu=orders_suppliers", $langs->trans("SuppliersOrders"), 0, $user->rights->fournisseur->commande->lire, '', $mainmenu, 'orders_suppliers', 400, '', '', '', img_picto('', 'supplier_order', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewOrder"), 1, $user->rights->fournisseur->commande->creer); + $newmenu->add("/fourn/commande/card.php?action=create&leftmenu=orders_suppliers", $langs->trans("NewSupplierOrderShort"), 1, $user->rights->fournisseur->commande->creer); $newmenu->add("/fourn/commande/list.php?leftmenu=orders_suppliers", $langs->trans("List"), 1, $user->rights->fournisseur->commande->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders_suppliers") { @@ -1180,7 +1206,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Accounting (Double entries) if (!empty($conf->accounting->enabled)) { - $permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); + //$permtoshowmenu = (!empty($conf->accounting->enabled) || $user->rights->accounting->bind->write || $user->rights->compta->resultat->lire); //$newmenu->add("/accountancy/index.php?leftmenu=accountancy", $langs->trans("MenuAccountancy"), 0, $permtoshowmenu, '', $mainmenu, 'accountancy'); // Configuration @@ -1317,10 +1343,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Accounting - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); - - // Balance - $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire || $user->rights->accounting->comptarapport->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); // General Ledger $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire); @@ -1328,6 +1351,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Journals $newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->rights->accounting->mouvements->lire); + // Account Balance + $newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire); + // Files if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) { $newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire); @@ -1373,7 +1399,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $modecompta = 'CREANCES-DETTES'; if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { - $modecompta = 'BOOKKEEPING'; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + $modecompta = 'BOOKKEEPING'; // Not yet implemented. } if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { @@ -1384,7 +1410,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } $modecompta = 'RECETTES-DEPENSES'; - //if (! empty($conf->accounting->enabled) && ! empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') $modecompta=''; // Not yet implemented. Should be BOOKKEEPINGCOLLECTED + if (!empty($conf->accounting->enabled) && !empty($user->rights->accounting->comptarapport->lire) && $mainmenu == 'accountancy') { + $modecompta = 'BOOKKEEPINGCOLLECTED'; // Not yet implemented. + } if ($modecompta && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_invoice->enabled))) { if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_report/', $leftmenu)) { $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 2, $user->rights->accounting->comptarapport->lire); @@ -1410,7 +1438,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/resultat/compteres.php?leftmenu=report","Compte de resultat",2,$user->rights->compta->resultat->lire); $newmenu->add("/compta/resultat/bilan.php?leftmenu=report","Bilan",2,$user->rights->compta->resultat->lire); */ - $newmenu->add("/compta/stats/index.php?leftmenu=report", $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); /* $newmenu->add("/compta/stats/cumul.php?leftmenu=report","Cumule",2,$user->rights->compta->resultat->lire); @@ -1419,14 +1446,32 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/compta/stats/comp.php?leftmenu=report","Transforme",2,$user->rights->compta->resultat->lire); } */ - $newmenu->add("/compta/stats/casoc.php?leftmenu=report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report", $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report", $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + + $modecompta = 'CREANCES-DETTES'; + $newmenu->add("/compta/stats/index.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ReportTurnover"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyprodserv.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/byratecountry.php?leftmenu=report&modecompta=".$modecompta, $langs->trans("ByVatRate"), 2, $user->rights->compta->resultat->lire); + + $modecompta = 'RECETTES-DEPENSES'; + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportTurnoverCollected"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + //Achats - $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report", $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report", $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); - $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report", $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + $modecompta = 'CREANCES-DETTES'; + $newmenu->add("/compta/stats/supplier_turnover.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnover"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_thirdparty.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/supplier_turnover_by_prodserv.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByProductsAndServices"), 2, $user->rights->compta->resultat->lire); + + /* + $modecompta = 'RECETTES-DEPENSES'; + $newmenu->add("/compta/stats/index.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ReportPurchaseTurnoverCollected"), 1, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/casoc.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByCompanies"), 2, $user->rights->compta->resultat->lire); + $newmenu->add("/compta/stats/cabyuser.php?leftmenu=accountancy_report&modecompta=".$modecompta, $langs->trans("ByUsers"), 2, $user->rights->compta->resultat->lire); + */ + // Journals $newmenu->add("/compta/journal/sellsjournal.php?leftmenu=report", $langs->trans("SellsJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 50); $newmenu->add("/compta/journal/purchasesjournal.php?leftmenu=report", $langs->trans("PurchasesJournal"), 1, $user->rights->compta->resultat->lire, '', '', '', 51); @@ -1598,21 +1643,19 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Inventory - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - if (!empty($conf->stock->enabled)) { - $langs->load("stocks"); - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); - if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); - } - } else { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); - if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { - $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); - } + if (!empty($conf->stock->enabled)) { + $langs->load("stocks"); + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); + } + } else { + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->inventory_advance->read, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); + if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { + $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->inventory_advance->write); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->inventory_advance->read); } } } @@ -1690,11 +1733,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $titleboth = $langs->trans("LeadsOrProjects"); $titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { $titleboth = $langs->trans("Projects"); $titlenew = $langs->trans("NewProject"); } - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $titleboth = $langs->trans("Leads"); $titlenew = $langs->trans("NewLead"); } @@ -1703,13 +1746,13 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"')); $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); - if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { + if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list'); - } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) { + } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) { $newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list'); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode); $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode); - } elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only + } elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode); } @@ -1755,11 +1798,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") { - $newmenu->add("/holiday/list.php?search_statut=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); - $newmenu->add("/holiday/list.php?search_statut=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read); + $newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read); } $newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read); $newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall); @@ -1916,6 +1959,28 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM return 0; } + // Allow the $menu_array of the menu to be manipulated by modules + $parameters = array( + 'mainmenu' => $mainmenu, + ); + $hook_items = $menu_array; + $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks + + if (is_numeric($reshook)) { + if ($reshook == 0 && !empty($hookmanager->results)) { + $menu_array[] = $hookmanager->results; // add + } elseif ($reshook == 1) { + $menu_array = $hookmanager->results; // replace + } + + // @todo Sort menu items by 'position' value + // $position = array(); + // foreach ($menu_array as $key => $row) { + // $position[$key] = $row['position']; + // } + // array_multisort($position, SORT_ASC, $menu_array); + } + // TODO Use the position property in menu_array to reorder the $menu_array //var_dump($menu_array); /*$new_menu_array = array(); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 5fbfc05a9fb..3b7cc0d1184 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1371,7 +1371,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it if ($command) { $sql .= " AND command = '".$this->db->escape($command)."'"; } - $sql .= " AND entity = ".$entity; // Must be exact entity + $sql .= " AND entity = ".((int) $entity); // Must be exact entity $now = dol_now(); @@ -1612,7 +1612,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql = "SELECT count(*)"; $sql .= " FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE ".$this->db->decrypt('name')." = '".$this->db->escape($name)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); $result = $this->db->query($sql); if ($result) { @@ -2197,7 +2197,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql = "DELETE FROM ".MAIN_DB_PREFIX."const"; $sql .= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->db->escape($this->const_name)."_".strtoupper($key)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " AND entity = ".((int) $entity); dol_syslog(get_class($this)."::delete_const_".$key."", LOG_DEBUG); if (!$this->db->query($sql)) { diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 1bbf2e14cc0..a87817cdc73 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -72,9 +72,9 @@ class pdf_ban extends ModeleBankAccountDoc $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; // Display product-service code // Retrieves transmitter $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f1ebc5bf64f..49e311f1c89 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -75,9 +75,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_codeproduitservice = 1; // Affiche code produit-service + $this->option_logo = 1; // Display logo FAC_PDF_LOGO + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_codeproduitservice = 1; //Display product-service code // Retrieves transmitter $this->emetteur = $mysoc; diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php index 56c2a12fee6..fe36f7604c2 100644 --- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php @@ -186,6 +186,11 @@ class modPhpbarcode extends ModeleBarCode global $conf, $filebarcode; dol_mkdir($conf->barcode->dir_temp); + if (!is_writable($conf->barcode->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } $file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png'; diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php index 90b7cd4f543..df9ec39546d 100644 --- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php +++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php @@ -158,6 +158,12 @@ class modTcpdfbarcode extends ModeleBarCode global $conf, $_GET; dol_mkdir($conf->barcode->dir_temp); + if (!is_writable($conf->barcode->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->barcode->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } + $file = $conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png'; $tcpdfEncoding = $this->getTcpdfEncodingType($encoding); diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 7bbedd0aa67..0d1bee3c28a 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -107,7 +107,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode // Mask parameter //$texte.= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php index 99fc8ed366d..01a00405452 100644 --- a/htdocs/core/modules/barcode/modules_barcode.class.php +++ b/htdocs/core/modules/barcode/modules_barcode.class.php @@ -138,7 +138,7 @@ abstract class ModeleNumRefBarCode { global $conf; - $langs->load("admin"); + $langs->loadLangs(array("admin", "companies")); $s = ''; $s .= $langs->trans("Name").': '.$this->name.'
    '; diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index 20ce1373b66..ce85203930f 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -151,7 +151,7 @@ class doc_generic_bom_odt extends ModelePDFBom $texte .= $conf->global->BOM_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -278,7 +278,11 @@ class doc_generic_bom_odt extends ModelePDFBom //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->bom->dir_temp); - + if (!is_writable($conf->bom->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->bom->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/bom/mod_bom_advanced.php b/htdocs/core/modules/bom/mod_bom_advanced.php index 71bd2788c82..d590c3ff70c 100644 --- a/htdocs/core/modules/bom/mod_bom_advanced.php +++ b/htdocs/core/modules/bom/mod_bom_advanced.php @@ -79,7 +79,7 @@ class mod_bom_advanced extends ModeleNumRefboms // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index 36a2b30e6e0..16e0f666774 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -73,7 +73,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 33b31135caf..239ec7639ec 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,13 +85,13 @@ class doc_generic_order_odt extends ModelePDFCommandes $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -158,7 +158,7 @@ class doc_generic_order_odt extends ModelePDFCommandes $texte .= $conf->global->COMMANDE_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -182,7 +182,7 @@ class doc_generic_order_odt extends ModelePDFCommandes // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -290,7 +290,11 @@ class doc_generic_order_odt extends ModelePDFCommandes //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->commande->dir_temp); - + if (!is_writable($conf->commande->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->commande->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1dc8ce74db0..83ccd391bd9 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -251,7 +251,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 4099686c1b6..8b4ccdfaba7 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -79,7 +79,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes // Parametrage du prefix $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 7b451287ae1..b1e441175d9 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -84,13 +84,13 @@ class doc_generic_contract_odt extends ModelePDFContract $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva CONTRACT_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat CONTRACT_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -157,7 +157,7 @@ class doc_generic_contract_odt extends ModelePDFContract $texte .= $conf->global->CONTRACT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -168,7 +168,7 @@ class doc_generic_contract_odt extends ModelePDFContract // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -278,7 +278,11 @@ class doc_generic_contract_odt extends ModelePDFContract //print "conf->contrat->dir_temp=".$conf->contrat->dir_temp; dol_mkdir($conf->contrat->dir_temp); - + if (!is_writable($conf->contrat->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->contrat->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on contract, we use it $usecontact = false; diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index d696ac06fdd..dcaee5eadbc 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -85,7 +85,7 @@ class mod_contract_magre extends ModelNumRefContracts $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= '
    '.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '; diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index a1c01002d2e..39ea743c5de 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -240,7 +240,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } diff --git a/htdocs/core/modules/delivery/mod_delivery_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php index af1900803c8..d5ac288b52a 100644 --- a/htdocs/core/modules/delivery/mod_delivery_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -83,7 +83,7 @@ class mod_delivery_saphir extends ModeleNumRefDeliveryOrder // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 797530a6c13..8a2b6b2b121 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -86,13 +86,13 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva EXPEDITION_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option EXPEDITION_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -182,7 +182,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -290,7 +290,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->expedition->dir_temp); - + if (!is_writable($conf->expedition->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->expedition->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If SHIPMENT contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 42999248026..f6f4b0b1a2a 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -139,7 +139,7 @@ class pdf_espadon extends ModelePdfExpedition $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur = $mysoc; @@ -201,14 +201,13 @@ class pdf_espadon extends ModelePdfExpedition continue; } - $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { - $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + $pdir = get_exdir(0, 0, 0, 0, $objphoto, 'product'); $dir = $conf->product->dir_output.'/'.$pdir; } @@ -609,7 +608,7 @@ class pdf_espadon extends ModelePdfExpedition $posYAfterDescription = $pdf->GetY(); } - $nexY = $pdf->GetY(); + $nexY = max($pdf->GetY(), $posYAfterImage); $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 79ceb166eed..2fef145800f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -127,7 +127,7 @@ class pdf_rouget extends ModelePdfExpedition $this->db = $db; $this->name = "rouget"; - $this->description = $langs->trans("DocumentModelStandardPDF"); + $this->description = $langs->trans("DocumentModelStandardPDF").' ('.$langs->trans("OldImplementation").')'; $this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template $this->type = 'pdf'; diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 0303dfde3dc..79bbcbdb481 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -80,7 +80,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 1815321ab18..b1f48450d0d 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2016-2019 Philippe Grand + * Copyright (C) 2016-2021 Philippe Grand * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2018 Francis Appels * Copyright (C) 2019 Markus Welters @@ -151,13 +151,13 @@ class pdf_standard extends ModeleExpenseReport $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts diff --git a/htdocs/core/modules/expensereport/mod_expensereport_sand.php b/htdocs/core/modules/expensereport/mod_expensereport_sand.php index 195667692f1..482b8c06431 100644 --- a/htdocs/core/modules/expensereport/mod_expensereport_sand.php +++ b/htdocs/core/modules/expensereport/mod_expensereport_sand.php @@ -82,7 +82,7 @@ class mod_expensereport_sand extends ModeleNumRefExpenseReport // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 2d15f3999d0..88ae937bb6d 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -277,8 +277,8 @@ class ExportCsv extends ModeleExports $newvalue = $this->csvClean($newvalue, $outputlangs->charset_output); - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 370fc49df7e..54842ff8278 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -315,8 +315,8 @@ class ExportExcel2007 extends ModeleExports $newvalue = $this->excel_clean($newvalue); $typefield = isset($array_types[$code]) ? $array_types[$code] : ''; - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index c93787a762c..7718dd3e350 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -252,8 +252,8 @@ class ExportTsv extends ModeleExports $newvalue = $this->tsv_clean($newvalue, $outputlangs->charset_output); - if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { - $array = unserialize($typefield); + if (preg_match('/^Select:/i', $typefield) && $typefield = substr($typefield, 7)) { + $array = json_decode($typefield, true); $array = $array['options']; $newvalue = $array[$newvalue]; } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index eb48373a443..0d360269d46 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -85,13 +85,13 @@ class doc_generic_invoice_odt extends ModelePDFFactures $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -158,7 +158,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures $texte .= $conf->global->FACTURE_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
  • '; // Scan directories @@ -181,7 +181,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -291,7 +291,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->facture->dir_temp); - + if (!is_writable($conf->facture->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->facture->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index ad793d3d6b8..401309c22e5 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -257,7 +257,7 @@ class pdf_sponge extends ModelePDFFactures $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php index 70fde36f549..32e06f285a9 100644 --- a/htdocs/core/modules/facture/mod_facture_mercure.php +++ b/htdocs/core/modules/facture/mod_facture_mercure.php @@ -76,7 +76,7 @@ class mod_facture_mercure extends ModeleNumRefFactures // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -84,17 +84,17 @@ class mod_facture_mercure extends ModeleNumRefFactures // Prefix setting of replacement invoices $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; // Prefix setting of deposit $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php index fa5dd49f0fa..91025817a9d 100644 --- a/htdocs/core/modules/fichinter/mod_arctic.php +++ b/htdocs/core/modules/fichinter/mod_arctic.php @@ -84,7 +84,7 @@ class mod_arctic extends ModeleNumRefFicheinter // Setting the prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index b8cb33f550e..000c7881561 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -85,7 +85,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1768029b97e..6bec94d6130 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -623,6 +623,12 @@ class ImportCsv extends ModeleImports } } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); + } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { + if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + $newval = rtrim(trim($newval), "0"); + } else { + $newval = trim($newval); + } } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index d90a52755e3..0378180475d 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -664,6 +664,12 @@ class ImportXlsx extends ModeleImports } } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') { $newval = price2num($newval); + } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'accountingaccount') { + if (empty($conf->global->ACCOUNTING_MANAGE_ZERO)) { + $newval = rtrim(trim($newval), "0"); + } else { + $newval = trim($newval); + } } //print 'Val to use as insert is '.$newval.'
    '; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 4bd03593e09..0ca62392c82 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -140,16 +140,20 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY sp.poste"; $resql = $this->db->query($sql); - $s .= $langs->trans("PostOrFunction").': '; - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - while ($i < $num) { - $obj = $this->db->fetch_object($resql); - $s .= ''; - $i++; + if ($num > 0) { + while ($i < $num) { + $obj = $this->db->fetch_object($resql); + $s .= ''; + $i++; + } + } else { + $s .= ''; } } else { dol_print_error($this->db); @@ -159,7 +163,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on contact category - $s .= $langs->trans("ContactCategoriesShort").': '; + $s .= $langs->trans("ContactCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -175,7 +179,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); @@ -197,8 +201,8 @@ class mailing_contacts1 extends MailingTargets $s .= '
    '; // Add prospect of a particular level - $s .= $langs->trans("NatureOfThirdParty").': '; - $s .= ''; $sql = "SELECT code, label"; $sql .= " FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $sql .= " WHERE active > 0"; @@ -234,7 +238,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on thirdparty category - $s .= $langs->trans("CustomersProspectsCategoriesShort").': '; + $s .= $langs->trans("CustomersProspectsCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -250,7 +254,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); @@ -272,7 +276,7 @@ class mailing_contacts1 extends MailingTargets $s .= ' '; // Filter on thirdparty category - $s .= $langs->trans("SuppliersCategoriesShort").': '; + $s .= $langs->trans("SuppliersCategoriesShort").' '; $sql = "SELECT c.label, count(distinct(sp.email)) AS nb"; $sql .= " FROM "; $sql .= " ".MAIN_DB_PREFIX."socpeople as sp,"; @@ -288,7 +292,7 @@ class mailing_contacts1 extends MailingTargets $sql .= " ORDER BY c.label"; $resql = $this->db->query($sql); - $s .= ''; $s .= ''; if ($resql) { $num = $this->db->num_rows($resql); diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 03334e62322..6880452a416 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -20,13 +20,13 @@ /** * \file htdocs/core/modules/mailings/pomme.modules.php * \ingroup mailing - * \brief File of class to offer a selector of emailing targets with Rule 'Pomme'. + * \brief File of class to offer a selector of emailing targets of users. */ include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php'; /** - * Class to offer a selector of emailing targets with Rule 'Peche'. + * Class to offer a selector of emailing targets with Rule 'Pomme'. */ class mailing_pomme extends MailingTargets { @@ -119,16 +119,16 @@ class mailing_pomme extends MailingTargets $langs->load("users"); $s = ''; - $s .= $langs->trans("Status").': '; - $s .= ''; $s .= ''; $s .= ''; $s .= ''; $s .= ''; $s .= ' '; - $s .= $langs->trans("Employee").': '; - $s .= ''; $s .= ''; $s .= ''; $s .= ''; @@ -171,7 +171,7 @@ class mailing_pomme extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.email <> ''"; // u.email IS NOT NULL est implicite dans ce test $sql .= " AND u.entity IN (0,".$conf->entity.")"; - $sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND u.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; if (GETPOSTISSET("filter") && GETPOST("filter") == '1') { $sql .= " AND u.statut=1"; } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index b3b88224df6..ae26dfc19fd 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -77,7 +77,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; } else { $addFilter = ""; if (GETPOSTISSET("filter_client") && GETPOST("filter_client") <> '-1') { @@ -112,7 +112,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); @@ -122,7 +122,7 @@ class mailing_thirdparties extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_fournisseur as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql .= " WHERE s.email <> ''"; $sql .= " AND s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND cs.fk_soc = s.rowid"; $sql .= " AND c.rowid = cs.fk_categorie"; $sql .= " AND c.rowid=".((int) GETPOST('filter', 'int')); @@ -226,8 +226,8 @@ class mailing_thirdparties extends MailingTargets $langs->load("companies"); - $s = $langs->trans("Categories").': '; - $s .= ''; // Show categories $sql = "SELECT rowid, label, type, visible"; @@ -276,7 +276,7 @@ class mailing_thirdparties extends MailingTargets $s .= ' '; $s .= $langs->trans('ProspectCustomer'); - $s .= ': '; $s .= ''; if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $s .= ''; @@ -292,7 +292,7 @@ class mailing_thirdparties extends MailingTargets $s .= ' '; $s .= $langs->trans("Status"); - $s .= ': '; $s .= ''; $s .= ''; $s .= ''; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 7b5d4f38737..4c848b69ac0 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -110,7 +110,7 @@ class mailing_thirdparties_services_expired extends MailingTargets $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; - $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")"; + $sql .= " AND s.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".((int) $mailing_id).")"; $sql .= " AND s.rowid = c.fk_soc AND cd.fk_contrat = c.rowid AND s.email != ''"; $sql .= " AND cd.statut= 4 AND cd.fk_product=p.rowid AND p.ref = '".$this->db->escape($product)."'"; $sql .= " AND cd.date_fin_validite < '".$this->db->idate($now)."'"; diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php index 5ff5a1f767a..939c78f32e3 100644 --- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php +++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php @@ -81,13 +81,13 @@ class doc_generic_member_odt extends ModelePDFMember $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva MEMBER_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -154,7 +154,7 @@ class doc_generic_member_odt extends ModelePDFMember $texte .= $conf->global->MEMBER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -171,7 +171,7 @@ class doc_generic_member_odt extends ModelePDFMember // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -279,7 +279,11 @@ class doc_generic_member_odt extends ModelePDFMember //print "conf->adherent->dir_temp=".$conf->adherent->dir_temp; dol_mkdir($conf->adherent->dir_temp); - + if (!is_writable($conf->adherent->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->adherent->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on member, we use it $usecontact = false; diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index 0e041a17559..937e8a06870 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -48,7 +48,7 @@ class ModelePDFCards * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - public function liste_modeles($db, $maxfilenamelength = 0) + public static function liste_modeles($db, $maxfilenamelength = 0) { // phpcs:enable global $conf; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 21618c56bc9..e0bf3a9bbc5 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -60,7 +60,7 @@ class modAccounting extends DolibarrModules $this->dirs = array('/accounting/temp'); // Config pages - $this->config_page_url = array('accounting.php'); + $this->config_page_url = array('accounting.php?mainmenu=accountancy&leftmenu=accountancy_admin'); // Dependencies $this->depends = array("modFacture", "modBanque", "modTax"); // List of modules id that must be enabled if this module is enabled @@ -297,6 +297,10 @@ class modAccounting extends DolibarrModules ); $this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); + $this->import_convertvalue_array[$r] = array( + 'b.numero_compte' => array('rule' => 'accountingaccount'), + 'b.subledger_account' => array('rule' => 'accountingaccount') + ); $this->import_examplevalues_array[$r] = array( 'b.piece_num'=>'123 (!!! use next value not already used)', 'b.doc_date'=>dol_print_date(dol_now(), "%Y-%m-%d"), @@ -350,6 +354,8 @@ class modAccounting extends DolibarrModules 'b.sens'=>'rule-computeSens' ); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_convertvalue_array[$r]=array( + 'b.numero_compte'=>array('rule'=>'accountingaccount'), + 'b.subledger_account'=>array('rule'=>'accountingaccount'), 'b.montant' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeAmount', 'element' => 'Accountancy'), 'b.sens' => array('rule' => 'compute', 'classfile' => '/accountancy/class/accountancyimport.class.php', 'class' => 'AccountancyImport', 'method' => 'computeDirection', 'element' => 'Accountancy'), ); @@ -395,6 +401,7 @@ class modAccounting extends DolibarrModules $this->import_fields_array[$r] = array('aa.fk_pcg_version'=>"Chartofaccounts*", 'aa.account_number'=>"AccountAccounting*", 'aa.label'=>"Label*", 'aa.account_parent'=>"Accountparent", "aa.fk_accounting_category"=>"AccountingCategory", "aa.pcg_type"=>"Pcgtype*", 'aa.active'=>'Status*', 'aa.datec'=>"DateCreation"); $this->import_regex_array[$r] = array('aa.fk_pcg_version'=>'pcg_version@'.MAIN_DB_PREFIX.'accounting_system', 'aa.account_number'=>'^.{1,32}$', 'aa.label'=>'^.{1,255}$', 'aa.account_parent'=>'^.{0,32}$', 'aa.fk_accounting_category'=>'rowid@'.MAIN_DB_PREFIX.'c_accounting_category', 'aa.pcg_type'=>'^.{1,20}$', 'aa.active'=>'^0|1$', 'aa.datec'=>'^\d{4}-\d{2}-\d{2}$'); $this->import_convertvalue_array[$r] = array( + 'aa.account_number'=>array('rule'=>'accountingaccount'), 'aa.account_parent'=>array('rule'=>'fetchidfromref', 'classfile'=>'/accountancy/class/accountingaccount.class.php', 'class'=>'AccountingAccount', 'method'=>'fetch', 'element'=>'AccountingAccount'), 'aa.fk_accounting_category'=>array('rule'=>'fetchidfromcodeorlabel', 'classfile'=>'/accountancy/class/accountancycategory.class.php', 'class'=>'AccountancyCategory', 'method'=>'fetch', 'dict'=>'DictionaryAccountancyCategory'), ); diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index fab12a0ae59..877dca880f7 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -93,6 +93,7 @@ class modBarcode extends DolibarrModules // Main menu entries $r = 0; + $this->menu[$r] = array( 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'mainmenu'=>'tools', @@ -106,7 +107,7 @@ class modBarcode extends DolibarrModules 'enabled'=>'$conf->barcode->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->barcode->lire_advance) || (! $conf->global->MAIN_USE_ADVANCED_PERMS)', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both + 'user'=>0, // 0=Menu for internal users, 1=external users, 2=both ); $r++; diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index ba6c7ddce6c..a128b92ee29 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -51,7 +51,7 @@ class modCashDesk extends DolibarrModules $this->name = preg_replace('/^mod/i', '', get_class($this)); $this->description = "CashDesk module"; - $this->version = 'dolibarr'; + $this->version = 'deprecated'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->picto = 'cash-register'; diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php index f28659bbd5d..18f1e6befeb 100644 --- a/htdocs/core/modules/modClickToDial.class.php +++ b/htdocs/core/modules/modClickToDial.class.php @@ -18,7 +18,7 @@ /** * \defgroup clicktodial Module clicktodial - * \brief Module pour gerer l'appel automatique + * \brief Module to manage a ClickToDial system * \file htdocs/core/modules/modClickToDial.class.php * \ingroup clicktodial * \brief Description and activation file for the module Click to Dial @@ -46,7 +46,8 @@ class modClickToDial extends DolibarrModules $this->family = "interface"; // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); - $this->description = "Gestion du Click To Dial"; + $this->description = "Integration of a ClickToDial system (Asterisk, ...)"; + $this->descriptionlong = "Support a Click To Dial feature with a SIP system. When clicking on a phone number, your phone system automatically call the callee."; $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 6a44075822c..4275d806d40 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -193,7 +193,7 @@ class modCommande extends DolibarrModules $this->export_label[$r] = 'CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("commande", "commande", "export")); $this->export_fields_array[$r] = array( - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'd.nom'=>'State', 'co.label'=>'Country', + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'd.nom'=>'State', 'co.label'=>'Country', 'co.code'=>"CountryCode", 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 'c.rowid'=>"Id", 'c.ref'=>"Ref", 'c.ref_client'=>"RefCustomer", 'c.fk_soc'=>"IdCompany", 'c.date_creation'=>"DateCreation", 'c.date_commande'=>"OrderDate", 'c.date_livraison'=>"DateDeliveryPlanned", 'c.amount_ht'=>"Amount", 'c.remise_percent'=>"GlobalDiscount", 'c.total_ht'=>"TotalHT", @@ -219,7 +219,7 @@ class modCommande extends DolibarrModules // 'p.rowid'=>'List:product:ref','p.ref'=>'Text','p.label'=>'Text' //); $this->export_TypeFields_array[$r] = array( - 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'co.label'=>'List:c_country:label:label', 'co.code'=>'Text', 's.phone'=>'Text', + 's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'co.label'=>'List:c_country:label:label', 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 'c.ref'=>"Text", 'c.ref_client'=>"Text", 'c.date_creation'=>"Date", 'c.date_commande'=>"Date", 'c.date_livraison'=>"Date", 'c.amount_ht'=>"Numeric", 'c.remise_percent'=>"Numeric", 'c.total_ht'=>"Numeric", 'c.total_ttc'=>"Numeric", 'c.facture'=>"Boolean", 'c.fk_statut'=>'Status', 'c.note_public'=>"Text", 'c.date_livraison'=>'Date', 'pj.ref'=>'Text', @@ -227,7 +227,7 @@ class modCommande extends DolibarrModules 'cd.total_ttc'=>"Numeric", 'p.rowid'=>'List:product:ref::product', 'p.ref'=>'Text', 'p.label'=>'Text', 'd.nom'=>'Text' ); $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'd.nom'=>'company', 'co.label'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'd.nom'=>'company', 'co.label'=>'company', 'co.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.siret'=>'company', 'c.rowid'=>"order", 'c.ref'=>"order", 'c.ref_client'=>"order", 'c.fk_soc'=>"order", 'c.date_creation'=>"order", 'c.date_commande'=>"order", 'c.amount_ht'=>"order", 'c.remise_percent'=>"order", 'c.total_ht'=>"order", 'c.total_ttc'=>"order", 'c.facture'=>"order", 'c.fk_statut'=>"order", 'c.note'=>"order", @@ -254,10 +254,11 @@ class modCommande extends DolibarrModules include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra4 ON s.rowid = extra4.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON ps.rowid = s.parent'; if (empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; } - $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra4 ON s.rowid = extra4.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'commande as c'; diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 3a81102f4bd..4ba73d4fe2c 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -268,7 +268,7 @@ class modEventOrganization extends DolibarrModules 'fk_menu'=>'fk_mainmenu=project,fk_leftmenu=eventorganization', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Left menu entry 'titre'=>'List', - 'url'=>'/projet/list.php?search_usage_event_organization=1&mainmenu=project&contextpage=organizedevents', + 'url'=>'/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents', 'langs'=>'eventorganization@eventorganization', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1000+$r, 'enabled'=>'$conf->eventorganization->enabled', // Define condition to show or hide menu entry. Use '$conf->eventorganization->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index f727247a831..63bc99f41ee 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -185,8 +185,9 @@ class modExpenseReport extends DolibarrModules 'd.total_ht'=>"TotalHT", 'd.total_tva'=>'TotalVAT', 'd.total_ttc'=>'TotalTTC', 'd.fk_statut'=>'Status', 'd.paid'=>'Paid', 'd.note_private'=>'NotePrivate', 'd.note_public'=>'NotePublic', 'd.detail_cancel'=>'MOTIF_CANCEL', 'd.detail_refuse'=>'MOTIF_REFUS', - 'u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'u.login'=>"Login", 'ed.rowid'=>'LineId', 'tf.code'=>'Type', 'ed.date'=>'Date', 'ed.tva_tx'=>'VATRate', + 'ed.rowid'=>'LineId', 'tf.code'=>'Type', 'ed.date'=>'Date', 'ed.tva_tx'=>'VATRate', 'ed.total_ht'=>'TotalHT', 'ed.total_tva'=>'TotalVAT', 'ed.total_ttc'=>'TotalTTC', 'ed.comments'=>'Comment', 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', + 'u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'u.login'=>"Login", 'user_rib.iban_prefix' => 'IBAN', 'user_rib.bic' => 'BIC', 'user_rib.code_banque' => 'BankCode', 'user_rib.bank' => 'BankName', 'user_rib.proprio' => 'BankAccountOwner', 'user_rib.owner_address' => 'BankAccountOwnerAddress' ); @@ -195,15 +196,17 @@ class modExpenseReport extends DolibarrModules 'd.total_ht'=>"Numeric", 'd.total_tva'=>'Numeric', 'd.total_ttc'=>'Numeric', 'd.fk_statut'=>"Numeric", 'd.paid'=>'Numeric', 'd.note_private'=>'Text', 'd.note_public'=>'Text', 'd.detail_cancel'=>'Text', 'd.detail_refuse'=>'Text', - 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'u.login'=>"Text", 'ed.rowid'=>'Numeric', 'tf.code'=>'Code', 'ed.date'=>'Date', 'ed.tva_tx'=>'Numeric', + 'ed.rowid'=>'Numeric', 'tf.code'=>'Code', 'ed.date'=>'Date', 'ed.tva_tx'=>'Numeric', 'ed.total_ht'=>'Numeric', 'ed.total_tva'=>'Numeric', 'ed.total_ttc'=>'Numeric', 'ed.comments'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', + 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'u.login'=>"Text", 'user_rib.iban_prefix' => 'Text', 'user_rib.bic' => 'Text', 'user_rib.code_banque' => 'Text', 'user_rib.bank' => 'Text', 'user_rib.proprio' => 'Text', 'user_rib.owner_address' => 'Text' ); $this->export_entities_array[$r] = array( - 'u.lastname'=>'user', 'u.firstname'=>'user', 'u.login'=>'user', 'ed.rowid'=>'expensereport_line', 'ed.date'=>'expensereport_line', + 'ed.rowid'=>'expensereport_line', 'ed.date'=>'expensereport_line', 'ed.tva_tx'=>'expensereport_line', 'ed.total_ht'=>'expensereport_line', 'ed.total_tva'=>'expensereport_line', 'ed.total_ttc'=>'expensereport_line', 'ed.comments'=>'expensereport_line', 'tf.code'=>'expensereport_line', 'p.project_ref'=>'expensereport_line', 'p.rowid'=>'project', 'p.ref'=>'project', + 'u.lastname'=>'user', 'u.firstname'=>'user', 'u.login'=>'user', 'user_rib.iban_prefix' => 'user', 'user_rib.bic' => 'user', 'user_rib.code_banque' => 'user', 'user_rib.bank' => 'user', 'user_rib.proprio' => 'user', 'user_rib.owner_address' => 'user' @@ -215,12 +218,15 @@ class modExpenseReport extends DolibarrModules $keyforelement = 'expensereport'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect = 'user'; $keyforelement = 'user'; $keyforaliasextra = 'extrau'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'expensereport as d'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'expensereport_extrafields as extra on d.rowid = extra.fk_object'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_rib as user_rib ON user_rib.fk_user = d.fk_user_author,'; - $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'user as u,'; + $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'user as u'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extrau ON u.rowid = extrau.fk_object,'; $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'expensereport_det as ed LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as tf ON ed.fk_c_type_fees = tf.id'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON ed.fk_projet = p.rowid'; $this->export_sql_end[$r] .= ' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index b296fa3b32c..bb044900acd 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -120,8 +120,36 @@ class modFacture extends DolibarrModules $arraydate = dol_getdate(dol_now()); $datestart = dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart), - 1=>array('label'=>'SendEmailsRemindersOnInvoiceDueDate', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture.class.php', 'objectname'=>'Facture', 'method'=>'sendEmailsRemindersOnInvoiceDueDate', 'parameters'=>"10,all,EmailTemplateCode", 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>0, 'test'=>'$conf->facture->enabled', 'datestart'=>$datestart), + 0 => array( + 'label'=>'RecurringInvoices', + 'jobtype'=>'method', + 'class'=>'compta/facture/class/facture-rec.class.php', + 'objectname'=>'FactureRec', + 'method'=>'createRecurringInvoices', + 'parameters'=>'', + 'comment'=>'Generate recurring invoices', + 'frequency'=>1, + 'unitfrequency'=>3600 * 24, + 'priority'=>50, + 'status'=>1, + 'test'=>'$conf->facture->enabled', + 'datestart'=>$datestart + ), + 1 => array( + 'label'=>'SendEmailsRemindersOnInvoiceDueDate', + 'jobtype'=>'method', + 'class'=>'compta/facture/class/facture.class.php', + 'objectname'=>'Facture', + 'method'=>'sendEmailsRemindersOnInvoiceDueDate', + 'parameters'=>"10,all,EmailTemplateCode", + 'comment'=>'Send an emails when the unpaid invoices reach a due date + n days = today. First param is the offset n of days, second parameter is "all" or a payment mode code, last paramater is the code of email template to use (an email template with EmailTemplateCode must exists. the version in the language of the thirdparty will be used in priority).', + 'frequency'=>1, + 'unitfrequency'=>3600 * 24, + 'priority'=>50, + 'status'=>0, + 'test'=>'$conf->facture->enabled', + 'datestart'=>$datestart + ), ); // Permissions @@ -214,7 +242,7 @@ class modFacture extends DolibarrModules $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("facture", "facture", "export", "other")); $this->export_fields_array[$r] = array( - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 'cd.nom'=>'State', + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom' => 'ParentCompany', 's.code_client'=>'CustomerCode', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 'cd.nom'=>'State', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', @@ -243,9 +271,9 @@ class modFacture extends DolibarrModules $this->export_fields_array[$r]['f.pos_source'] = 'POSTerminal'; } $this->export_TypeFields_array[$r] = array( - 's.rowid'=>'Numeric', 's.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', + 's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', - 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", + 'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric', 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text', 'none.rest'=>"NumericCompute", 'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text', @@ -259,7 +287,7 @@ class modFacture extends DolibarrModules $this->export_TypeFields_array[$r]['f.pos_source'] = 'Text'; } $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'company', 's.phone'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.code_client'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 'cd.nom'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'pj.ref'=>'project', 'pj.title'=>'project', 'fd.rowid'=>'invoice_line', 'fd.label'=>"invoice_line", 'fd.description'=>"invoice_line", 'fd.subprice'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_tva'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", @@ -281,8 +309,14 @@ class modFacture extends DolibarrModules $keyforelement = 'product'; $keyforaliasextra = 'extra3'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect = 'societe'; + $keyforelement = 'company'; + $keyforaliasextra = 'extra4'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra4 ON s.rowid = extra4.fk_object'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON ps.rowid = s.parent'; if (empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; } diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 71f101014ad..5d71a5abdc8 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -285,10 +285,10 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Vendor invoices and lines of invoices'; - $this->export_icon[$r] = 'bill'; + $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); $this->export_fields_array[$r] = array( - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_supplier'=>"RefSupplier", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>'DateMaxPayment', @@ -312,14 +312,14 @@ class modFournisseur extends DolibarrModules // 'fd.tva'=>"Numeric",'fd.product_type'=>'Numeric','fd.fk_product'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text' //); $this->export_TypeFields_array[$r] = array( - 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', + 's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>'Date', 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_public'=>"Text", 'fd.description'=>"Text", 'fd.tva_tx'=>"Text", 'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.tva'=>"Numeric", 'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text' ); $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'f.rowid'=>"invoice", 'f.ref'=>"invoice", 'f.ref_supplier'=>"invoice", 'f.datec'=>"invoice", 'f.datef'=>"invoice", 'f.date_lim_reglement'=>'invoice', 'f.total_ht'=>"invoice", 'f.total_ttc'=>"invoice", 'f.total_tva'=>"invoice", 'f.paye'=>"invoice", 'f.fk_statut'=>'invoice', 'f.note_public'=>"invoice", 'fd.rowid'=>'invoice_line', 'fd.description'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line", @@ -328,84 +328,18 @@ class modFournisseur extends DolibarrModules ); $this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $var = array_keys($tmpparam['options']); - $tmp = array_shift($var); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice'; - } - } - // End add extra fields - // Add extra fields line - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn_det' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extraline.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmp = array_shift(array_keys($tmpparam['options'])); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice_line'; - } - } + $keyforselect = 'facture_fourn'; + $keyforelement = 'invoice'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect = 'facture_fourn_det'; + $keyforelement = 'invoice_line'; + $keyforaliasextra = 'extraline'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields line $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON ps.rowid = s.parent'; if (is_object($user) && empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; } @@ -425,7 +359,7 @@ class modFournisseur extends DolibarrModules $r++; $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'Factures fournisseurs et reglements'; - $this->export_icon[$r] = 'bill'; + $this->export_icon[$r] = 'invoice'; $this->export_permission[$r] = array(array("fournisseur", "facture", "export")); $this->export_fields_array[$r] = array( 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', @@ -464,42 +398,10 @@ class modFournisseur extends DolibarrModules 'p.datep'=>'payment', 'p.num_paiement'=>'payment', 'p.fk_bank'=>'account', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project'); $this->export_dependencies_array[$r] = array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmp = array_shift(array_keys($tmpparam['options'])); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'invoice'; - } - } + $keyforselect = 'facture_fourn'; + $keyforelement = 'invoice'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields object $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; @@ -525,7 +427,7 @@ class modFournisseur extends DolibarrModules $this->export_icon[$r] = 'order'; $this->export_permission[$r] = array(array("fournisseur", "commande", "export")); $this->export_fields_array[$r] = array( - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'c.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', 's.tva_intra'=>'VATIntra', 'f.rowid'=>"OrderId", 'f.ref'=>"Ref", 'f.ref_supplier'=>"RefSupplier", 'f.date_creation'=>"DateCreation", 'f.date_commande'=>"OrderDate", 'f.date_livraison'=>"DateDeliveryPlanned", 'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.fk_statut'=>'Status', 'f.date_approve'=>'DateApprove', 'f.date_approve2'=>'DateApprove2', @@ -546,7 +448,7 @@ class modFournisseur extends DolibarrModules unset($this->export_fields_array['ua2.login']); } $this->export_TypeFields_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'Text', 's.address'=>'Text', 's.cp'=>'Text', 's.ville'=>'Text', 'c.code'=>'Text', 's.tel'=>'Text', 's.siren'=>'Text', + 's.rowid'=>"company", 's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.cp'=>'Text', 's.ville'=>'Text', 'c.code'=>'Text', 's.tel'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.date_creation'=>"Date", 'f.date_commande'=>"Date", 'f.date_livraison'=>"Date", 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.fk_statut'=>'Status', 'f.date_approve'=>'Date', 'f.date_approve2'=>'Date', 'f.note_public'=>"Text", 'f.note_private'=>"Text", 'fd.description'=>"Text", @@ -554,7 +456,7 @@ class modFournisseur extends DolibarrModules 'fd.product_type'=>'Numeric', 'fd.ref'=>'Text', 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text' ); $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.tva_intra'=>'company', 'ua1.login'=>'user', 'ua2.login'=>'user', 'fd.rowid'=>'order_line', 'fd.description'=>"order_line", 'fd.tva_tx'=>"order_line", 'fd.qty'=>"order_line", 'fd.remise_percent'=>"order_line", 'fd.total_ht'=>"order_line", 'fd.total_ttc'=>"order_line", 'fd.total_tva'=>"order_line", 'fd.product_type'=>'order_line', 'fd.ref'=>'order_line', 'fd.fk_product'=>'product', @@ -562,86 +464,20 @@ class modFournisseur extends DolibarrModules ); $this->export_dependencies_array[$r] = array('order_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseur' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extra.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - $tmpkey = array_keys($tmpparam['options']); - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmp = array_shift($tmpkey); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'order'; - } - } + $keyforselect = 'commande_fournisseur'; + $keyforelement = 'order'; + $keyforaliasextra = 'extra'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields object // Add extra fields line - $sql = "SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'commande_fournisseurdet' AND entity IN (0, ".$conf->entity.")"; - $resql = $this->db->query($sql); - if ($resql) { // This can fail when class is used on old database (during migration for example) - while ($obj = $this->db->fetch_object($resql)) { - $fieldname = 'extraline.'.$obj->name; - $fieldlabel = ucfirst($obj->label); - $typeFilter = "Text"; - switch ($obj->type) { - case 'int': - case 'double': - case 'price': - $typeFilter = "Numeric"; - break; - case 'date': - case 'datetime': - $typeFilter = "Date"; - break; - case 'boolean': - $typeFilter = "Boolean"; - break; - case 'sellist': - $tmp = ''; - $tmpparam = unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - - if ($tmpparam['options'] && is_array($tmpparam['options'])) { - $tmpparam_param_key = array_keys($tmpparam['options']); - $tmp = array_shift($tmpparam_param_key); - } - if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) { - $typeFilter = "List:".$tmp; - } - break; - } - $this->export_fields_array[$r][$fieldname] = $fieldlabel; - $this->export_TypeFields_array[$r][$fieldname] = $typeFilter; - $this->export_entities_array[$r][$fieldname] = 'order_line'; - } - } + $keyforselect = 'commande_fournisseurdet'; + $keyforelement = 'order_line'; + $keyforaliasextra = 'extraline'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; // End add extra fields line $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON ps.rowid = s.parent'; if (is_object($user) && empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; } diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 23cbf7eddf8..be0b39ecc7e 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -135,6 +135,28 @@ class modHoliday extends DolibarrModules //$r++; + // Cronjobs + $arraydate = dol_getdate(dol_now()); + $datestart = dol_mktime(4, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); + $this->cronjobs = array( + 0 => array( + 'label' => 'HolidayBalanceMonthlyUpdate', + 'jobtype' => 'method', + 'class' => 'holiday/class/holiday.class.php', + 'objectname' => 'Holiday', + 'method' => 'updateBalance', + 'parameters' => '', + 'comment' => 'Update holiday balance every month', + 'frequency' => 1, + 'unitfrequency' => 3600 * 24, + 'priority' => 50, + 'status' => 1, + 'test' => '$conf->holiday->enabled', + 'datestart' => $datestart + ) + ); + + // Permissions $this->rights = array(); // Permission array used by this module $r = 0; @@ -204,14 +226,18 @@ class modHoliday extends DolibarrModules $this->export_permission[$r] = array(array("holiday", "readall")); $this->export_fields_array[$r] = array( 'd.rowid'=>"LeaveId", 'd.fk_type'=>'TypeOfLeaveId', 't.code'=>'TypeOfLeaveCode', 't.label'=>'TypeOfLeaveLabel', 'd.fk_user'=>'UserID', - 'u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'u.login'=>"Login", 'd.date_debut'=>'DateStart', 'd.date_fin'=>'DateEnd', 'd.halfday'=>'HalfDay', 'none.num_open_days'=>'NbUseDaysCP', - 'd.date_valid'=>'DateApprove', 'd.fk_validator'=>"UserForApprovalID", 'ua.lastname'=>"UserForApprovalLastname", 'ua.firstname'=>"UserForApprovalFirstname", + 'd.date_debut'=>'DateStart', 'd.date_fin'=>'DateEnd', 'd.halfday'=>'HalfDay', 'none.num_open_days'=>'NbUseDaysCP', + 'd.date_valid'=>'DateApprove', 'd.fk_validator'=>"UserForApprovalID", + 'u.lastname'=>'Lastname', 'u.firstname'=>'Firstname', 'u.login'=>"Login", + 'ua.lastname'=>"UserForApprovalLastname", 'ua.firstname'=>"UserForApprovalFirstname", 'ua.login'=>"UserForApprovalLogin", 'd.description'=>'Description', 'd.statut'=>'Status' ); $this->export_TypeFields_array[$r] = array( 'd.rowid'=>"Numeric", 't.code'=>'Text', 't.label'=>'Text', 'd.fk_user'=>'Numeric', - 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'u.login'=>"Text", 'd.date_debut'=>'Date', 'd.date_fin'=>'Date', 'none.num_open_days'=>'NumericCompute', - 'd.date_valid'=>'Date', 'd.fk_validator'=>"Numeric", 'ua.lastname'=>"Text", 'ua.firstname'=>"Text", + 'd.date_debut'=>'Date', 'd.date_fin'=>'Date', 'none.num_open_days'=>'NumericCompute', + 'd.date_valid'=>'Date', 'd.fk_validator'=>"Numeric", + 'u.lastname'=>'Text', 'u.firstname'=>'Text', 'u.login'=>"Text", + 'ua.lastname'=>"Text", 'ua.firstname'=>"Text", 'ua.login'=>"Text", 'd.description'=>'Text', 'd.statut'=>'Numeric' ); $this->export_entities_array[$r] = array( @@ -225,6 +251,8 @@ class modHoliday extends DolibarrModules $keyforelement = 'holiday'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + $keyforselect = 'user'; $keyforelement = 'user'; $keyforaliasextra = 'extrau'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'holiday as d'; @@ -232,6 +260,7 @@ class modHoliday extends DolibarrModules $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_holiday_types as t ON t.rowid = d.fk_type'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua ON ua.rowid = d.fk_validator,'; $this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'user as u'; + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extrau ON u.rowid = extrau.fk_object'; $this->export_sql_end[$r] .= ' WHERE d.fk_user = u.rowid'; $this->export_sql_end[$r] .= ' AND d.entity IN ('.getEntity('holiday').')'; diff --git a/htdocs/core/modules/modKnowledgeManagement.class.php b/htdocs/core/modules/modKnowledgeManagement.class.php index 504c363b648..6d9bef40232 100644 --- a/htdocs/core/modules/modKnowledgeManagement.class.php +++ b/htdocs/core/modules/modKnowledgeManagement.class.php @@ -68,7 +68,7 @@ class modKnowledgeManagement extends DolibarrModules $this->descriptionlong = "Manage a Knowledge Management (KM) or Help-Desk base"; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = 'development'; + $this->version = 'experimental'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; @@ -261,17 +261,17 @@ class modKnowledgeManagement extends DolibarrModules // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) - $this->rights[$r][1] = 'Read objects of Knowledge Management'; // Permission label + $this->rights[$r][1] = 'Read articles'; // Permission label $this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/Update objects of Knowledge Management'; // Permission label + $this->rights[$r][1] = 'Create/Update articles'; // Permission label $this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r + 1; // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete objects of Knowledge Management'; // Permission label + $this->rights[$r][1] = 'Delete articles'; // Permission label $this->rights[$r][4] = 'knowledgerecord'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->knowledgemanagement->level1->level2) $r++; @@ -282,6 +282,7 @@ class modKnowledgeManagement extends DolibarrModules $r = 0; // Add here entries to declare new menus /* BEGIN MODULEBUILDER TOPMENU */ + /* $this->menu[$r++] = array( 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry @@ -297,60 +298,17 @@ class modKnowledgeManagement extends DolibarrModules 'target'=>'', 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both ); - /* END MODULEBUILDER TOPMENU */ - /* BEGIN MODULEBUILDER LEFTMENU KNOWLEDGERECORD - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=knowledgemanagement', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Top menu entry - 'titre'=>'KnowledgeRecord', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), - 'mainmenu'=>'knowledgemanagement', - 'leftmenu'=>'knowledgerecord', - 'url'=>'/knowledgemanagement/knowledgemanagementindex.php', - 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgerecord', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'List_KnowledgeRecord', - 'mainmenu'=>'knowledgemanagement', - 'leftmenu'=>'knowledgemanagement_knowledgerecord_list', - 'url'=>'/knowledgemanagement/knowledgerecord_list.php', - 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgerecord', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New_KnowledgeRecord', - 'mainmenu'=>'knowledgemanagement', - 'leftmenu'=>'knowledgemanagement_knowledgerecord_new', - 'url'=>'/knowledgemanagement/knowledgerecord_card.php?action=create', - 'langs'=>'knowledgemanagement@knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->write', // Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); */ + /* END MODULEBUILDER TOPMENU */ $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=knowledgemanagement', + 'fk_menu'=>'fk_mainmenu=ticket', // This is a Left menu entry 'type'=>'left', 'titre'=>'MenuKnowledgeRecord', - 'mainmenu'=>'knowledgemanagement', + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), + 'mainmenu'=>'ticket', 'leftmenu'=>'knowledgemanagement_knowledgerecord', 'url'=>'/knowledgemanagement/knowledgerecord_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. @@ -366,11 +324,11 @@ class modKnowledgeManagement extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgemanagement_knowledgerecord', + 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord', // This is a Left menu entry 'type'=>'left', 'titre'=>'ListKnowledgeRecord', - 'mainmenu'=>'knowledgemanagement', + 'mainmenu'=>'ticket', 'leftmenu'=>'knowledgemanagement_list', 'url'=>'/knowledgemanagement/knowledgerecord_list.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. @@ -386,11 +344,11 @@ class modKnowledgeManagement extends DolibarrModules ); $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'fk_menu'=>'fk_mainmenu=knowledgemanagement,fk_leftmenu=knowledgemanagement_knowledgerecord', + 'fk_menu'=>'fk_mainmenu=ticket,fk_leftmenu=knowledgemanagement_knowledgerecord', // This is a Left menu entry 'type'=>'left', 'titre'=>'NewKnowledgeRecord', - 'mainmenu'=>'knowledgemanagement', + 'mainmenu'=>'ticket', 'leftmenu'=>'knowledgemanagement_new', 'url'=>'/knowledgemanagement/knowledgerecord_card.php?action=create', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. @@ -406,6 +364,7 @@ class modKnowledgeManagement extends DolibarrModules ); /* END MODULEBUILDER LEFTMENU KNOWLEDGERECORD */ + // Exports profiles provided by this module $r = 1; /* BEGIN MODULEBUILDER EXPORT KNOWLEDGERECORD */ diff --git a/htdocs/core/modules/modPartnership.class.php b/htdocs/core/modules/modPartnership.class.php index d12cd610238..d7041eca754 100644 --- a/htdocs/core/modules/modPartnership.class.php +++ b/htdocs/core/modules/modPartnership.class.php @@ -180,10 +180,8 @@ class modPartnership extends DolibarrModules $tabtoadd = (!empty(getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR')) && getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') ? 'member' : 'thirdparty'; if ($tabtoadd == 'member') { - $this->tabs[] = array('data'=>'member:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/adherents/partnership.php?rowid=__ID__'); $fk_mainmenu = "members"; } else { - $this->tabs[] = array('data'=>'thirdparty:+partnership:Partnership:partnership@partnership:$user->rights->partnership->read:/societe/partnership.php?socid=__ID__'); $fk_mainmenu = "companies"; } @@ -214,30 +212,27 @@ class modPartnership extends DolibarrModules // 'user' to add a tab in user view // Dictionaries - $this->dictionaries = array(); - /* Example: $this->dictionaries=array( 'langs'=>'partnership@partnership', // List of tables we want to see into dictonnary editor - 'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"), + 'tabname'=>array(MAIN_DB_PREFIX."c_partnership_type"), // Label of tables - 'tablib'=>array("Table1", "Table2", "Table3"), + 'tablib'=>array("PartnershipType"), // Request to select fields - 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), + 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'c_partnership_type as f WHERE f.entity = '.$conf->entity), // Sort order - 'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"), + 'tabsqlsort'=>array("label ASC"), // List of fields (result of select to show dictionary) - 'tabfield'=>array("code,label", "code,label", "code,label"), + 'tabfield'=>array("code,label"), // List of fields (list of fields to edit a record) - 'tabfieldvalue'=>array("code,label", "code,label", "code,label"), + 'tabfieldvalue'=>array("code,label"), // List of fields (list of fields for insert) - 'tabfieldinsert'=>array("code,label", "code,label", "code,label"), + 'tabfieldinsert'=>array("code,label"), // Name of columns with primary key (try to always name it 'rowid') - 'tabrowid'=>array("rowid", "rowid", "rowid"), + 'tabrowid'=>array("rowid"), // Condition to show each dictionary - 'tabcond'=>array($conf->partnership->enabled, $conf->partnership->enabled, $conf->partnership->enabled) + 'tabcond'=>array($conf->partnership->enabled) ); - */ // Boxes/Widgets // Add here list of php file(s) stored in partnership/core/boxes that contains a class to show a widget. @@ -258,7 +253,7 @@ class modPartnership extends DolibarrModules $this->cronjobs = array( 0 => array('priority'=>60, 'label'=>'CancelPartnershipForExpiredMembers', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doCancelStatusOfMemberPartnership', 'parameters'=>'', 'comment'=>'Cancel status of partnership when subscription is expired + x days.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>1, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), - 1 => array('priority'=>61, 'label'=>'CheckDolibarrBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), + 1 => array('priority'=>61, 'label'=>'PartnershipCheckBacklink', 'jobtype'=>'method', 'class'=>'/partnership/class/partnershiputils.class.php', 'objectname'=>'PartnershipUtils', 'method'=>'doWarningOfPartnershipIfDolibarrBacklinkNotfound', 'parameters'=>'', 'comment'=>'Warning of partnership if Dolibarr backlink not found on partner website.', 'frequency'=>1, 'unitfrequency'=>86400, 'status'=>0, 'test'=>'$conf->partnership->enabled', 'datestart'=>$datestart), ); // Permissions provided by this module diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 3459973a699..3caf5db88c6 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -322,7 +322,7 @@ class modProduct extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ProductsMultiPrice"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("produit", "export")); - $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", + $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", 'p.label'=>"Label", 'pr.price_base_type'=>"PriceBase", 'pr.price_level'=>"PriceLevel", 'pr.price'=>"PriceLevelUnitPriceHT", 'pr.price_ttc'=>"PriceLevelUnitPriceTTC", 'pr.price_min'=>"MinPriceLevelUnitPriceHT", 'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC", @@ -337,7 +337,7 @@ class modProduct extends DolibarrModules // 'p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean", // 'p.datec'=>'Date','p.tms'=>'Date' //); - $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", + $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", 'p.label'=>"Label", 'pr.price_base_type'=>"product", 'pr.price_level'=>"product", 'pr.price'=>"product", 'pr.price_ttc'=>"product", 'pr.price_min'=>"product", 'pr.price_min_ttc'=>"product", @@ -348,6 +348,8 @@ class modProduct extends DolibarrModules $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'product as p'; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_price as pr ON p.rowid = pr.fk_product AND pr.entity = '.$conf->entity; // export prices only for the current entity $this->export_sql_end[$r] .= ' WHERE p.entity IN ('.getEntity('product').')'; // For product and service profile + $this->export_sql_end[$r] .= ' AND pr.date_price = (SELECT MAX(pr2.date_price) FROM '.MAIN_DB_PREFIX.'product_price as pr2 WHERE pr2.fk_product = pr.fk_product AND pr2.entity IN ('.getEntity('product').'))'; // export only latest prices not full history + $this->export_sql_end[$r] .= ' ORDER BY p.ref, pr.price_level'; } if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { @@ -356,7 +358,7 @@ class modProduct extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ProductsPricePerCustomer"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("produit", "export")); - $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", + $this->export_fields_array[$r] = array('p.rowid'=>"Id", 'p.ref'=>"Ref", 'p.label'=>"Label", 's.nom'=>'ThirdParty', 'pr.price_base_type'=>"PriceBase", 'pr.price'=>"PriceUnitPriceHT", 'pr.price_ttc'=>"PriceUnitPriceTTC", @@ -367,7 +369,7 @@ class modProduct extends DolibarrModules if (is_object($mysoc) && $usenpr) { $this->export_fields_array[$r]['pr.recuperableonly'] = 'NPR'; } - $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", + $this->export_entities_array[$r] = array('p.rowid'=>"product", 'p.ref'=>"product", 'p.label'=>"Label", 's.nom'=>'company', 'pr.price_base_type'=>"product", 'pr.price'=>"product", 'pr.price_ttc'=>"product", @@ -572,7 +574,13 @@ class modProduct extends DolibarrModules 'class' => 'CProductNature', 'method' => 'fetch', 'dict' => 'DictionaryProductNature' - ), + ), + 'p.accountancy_code_sell'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_sell_intra'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_sell_export'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy_intra'=>array('rule'=>'accountingaccount'), + 'p.accountancy_code_buy_export'=>array('rule'=>'accountingaccount'), ); $this->import_regex_array[$r] = array( diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 79529898bb0..4b508d79d7c 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -84,14 +84,14 @@ class modProductBatch extends DolibarrModules $this->const[$r][0] = "PRODUCTBATCH_LOT_ADDON"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_lot_free"; - $this->const[$r][3] = 'Module to control product codes'; + $this->const[$r][3] = 'Module to control lot number'; $this->const[$r][4] = 0; $r++; $this->const[$r][0] = "PRODUCTBATCH_SN_ADDON"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "mod_sn_free"; - $this->const[$r][3] = 'Module to control product codes'; + $this->const[$r][3] = 'Module to control serial number'; $this->const[$r][4] = 0; $r++; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index 048f8fcb508..83e2b5a0402 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -189,7 +189,7 @@ class modPropale extends DolibarrModules $this->export_label[$r] = 'ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r] = array(array("propale", "export")); $this->export_fields_array[$r] = array( - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'co.code'=>'CountryCode', 's.phone'=>'Phone', + 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 'ps.nom'=>'ParentCompany', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', 'co.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 'c.rowid'=>"Id", 'c.ref'=>"Ref", 'c.ref_client'=>"RefCustomer", 'c.fk_soc'=>"IdCompany", 'c.datec'=>"DateCreation", 'c.datep'=>"DatePropal", 'c.fin_validite'=>"DateEndPropal", 'c.remise_percent'=>"GlobalDiscount", 'c.total_ht'=>"TotalHT", 'c.total_ttc'=>"TotalTTC", 'c.fk_statut'=>'Status', 'c.note_public'=>"Note", 'c.date_livraison'=>'DeliveryDate', @@ -213,14 +213,14 @@ class modPropale extends DolibarrModules // 'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:product:label','p.ref'=>'Text','p.label'=>'Text' //); $this->export_TypeFields_array[$r] = array( - 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', + 's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 'c.ref'=>"Text", 'c.ref_client'=>"Text", 'c.datec'=>"Date", 'c.datep'=>"Date", 'c.fin_validite'=>"Date", 'c.remise_percent'=>"Numeric", 'c.total_ht'=>"Numeric", 'c.total_ttc'=>"Numeric", 'c.fk_statut'=>'Status', 'c.note_public'=>"Text", 'c.date_livraison'=>'Date', 'pj.ref'=>'Text', 'cd.description'=>"Text", 'cd.product_type'=>'Boolean', 'cd.tva_tx'=>"Numeric", 'cd.qty'=>"Numeric", 'cd.total_ht'=>"Numeric", 'cd.total_tva'=>"Numeric", 'cd.total_ttc'=>"Numeric", 'p.ref'=>'Text', 'p.label'=>'Text' ); $this->export_entities_array[$r] = array( - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'co.code'=>'company', 's.phone'=>'company', + 's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'co.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.siret'=>'company', 'c.rowid'=>"propal", 'c.ref'=>"propal", 'c.ref_client'=>"propal", 'c.fk_soc'=>"propal", 'c.datec'=>"propal", 'c.datep'=>"propal", 'c.fin_validite'=>"propal", 'c.remise_percent'=>"propal", 'c.total_ht'=>"propal", 'c.total_ttc'=>"propal", 'c.fk_statut'=>"propal", 'c.note_public'=>"propal", 'c.date_livraison'=>"propal", 'pj.ref'=>'project', 'cd.rowid'=>'propal_line', @@ -241,14 +241,14 @@ class modPropale extends DolibarrModules $keyforaliasextra = 'extra3'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $keyforselect = 'societe'; - $keyforelement = 'societe'; + $keyforelement = 'company'; $keyforaliasextra = 'extra4'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s '; $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra4 ON s.rowid = extra4.fk_object'; - + $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as ps ON ps.rowid = s.parent'; if (empty($user->rights->societe->client->voir)) { $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid'; } diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 759804b409e..3464a5e14b3 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -101,7 +101,7 @@ class modSalaries extends DolibarrModules $r++; $this->rights[$r][0] = 511; - $this->rights[$r][1] = 'Read payments of employee salaries (yours and your subordinates)'; + $this->rights[$r][1] = 'Read employee salaries and payments (yours and your subordinates)'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; @@ -125,7 +125,7 @@ class modSalaries extends DolibarrModules $r++; $this->rights[$r][0] = 517; - $this->rights[$r][1] = 'Read payments of salariests of every employee'; + $this->rights[$r][1] = 'Read salaries and payments of all employees'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'readall'; diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index c9379fb25d6..3494cb684dc 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2021 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -148,19 +149,19 @@ class modStock extends DolibarrModules $this->rights[4][4] = 'mouvement'; $this->rights[4][5] = 'creer'; + $this->rights[5][0] = 1011; + $this->rights[5][1] = 'inventoryReadPermission'; // Permission label + $this->rights[5][3] = 0; // Permission by default for new user (0/1) + $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + + $this->rights[6][0] = 1012; + $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label + $this->rights[6][3] = 0; // Permission by default for new user (0/1) + $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) + if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $this->rights[5][0] = 1011; - $this->rights[5][1] = 'inventoryReadPermission'; // Permission label - $this->rights[5][3] = 0; // Permission by default for new user (0/1) - $this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - - $this->rights[6][0] = 1012; - $this->rights[6][1] = 'inventoryCreatePermission'; // Permission label - $this->rights[6][3] = 0; // Permission by default for new user (0/1) - $this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - $this->rights[8][0] = 1014; $this->rights[8][1] = 'inventoryValidatePermission'; // Permission label $this->rights[8][3] = 0; // Permission by default for new user (0/1) diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index b374000c74c..78bcb9901af 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -122,24 +122,34 @@ class modTicket extends DolibarrModules } $this->dictionaries = array( 'langs' => 'ticket', - 'tabname' => array(MAIN_DB_PREFIX."c_ticket_type", MAIN_DB_PREFIX."c_ticket_severity", MAIN_DB_PREFIX."c_ticket_category", MAIN_DB_PREFIX."c_ticket_resolution"), - 'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"), + 'tabname' => array( + MAIN_DB_PREFIX."c_ticket_type", + MAIN_DB_PREFIX."c_ticket_severity", + MAIN_DB_PREFIX."c_ticket_category", + MAIN_DB_PREFIX."c_ticket_resolution" + ), + 'tablib' => array( + "TicketDictType", + "TicketDictSeverity", + "TicketDictCategory", + "TicketDictResolution" + ), 'tabsql' => array( 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f', - 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', + 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default, f.public, f.fk_parent FROM '.MAIN_DB_PREFIX.'c_ticket_category as f', 'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_resolution as f' ), 'tabsqlsort' => array("pos ASC", "pos ASC", "pos ASC", "pos ASC"), - 'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"), - 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"), - 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"), + 'tabfield' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), + 'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), + 'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"), 'tabrowid' => array("rowid", "rowid", "rowid", "rowid"), - 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled), + 'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)), 'tabhelp' => array( array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")), - array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"), 'public'=>$langs->trans("Enter0or1").'
    '.$langs->trans("TicketGroupIsPublicDesc")), + array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1"), 'public'=>$langs->trans("Enter0or1").'
    '.$langs->trans("TicketGroupIsPublicDesc"), 'fk_parent'=>$langs->trans("IfThisCategoryIsChildOfAnother")), array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")) ), ); @@ -200,7 +210,7 @@ class modTicket extends DolibarrModules $this->menus = array(); // List of menus to add $r = 0; - $this->menu[$r] = array('fk_menu' => 0, // Put 0 if this is a top menu + /*$this->menu[$r] = array('fk_menu' => 0, // Put 0 if this is a top menu 'type' => 'top', // This is a Top menu entry 'titre' => 'Ticket', 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), @@ -209,11 +219,11 @@ class modTicket extends DolibarrModules 'url' => '/ticket/index.php', 'langs' => 'ticket', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position' => 88, - 'enabled' => '$conf->ticket->enabled', // Define condition to show or hide menu entry. Use '$conf->ticket->enabled' if entry must be visible if module is enabled. + 'enabled' => '$conf->ticket->enabled', 'perms' => '$user->rights->ticket->read', // Use 'perms'=>'$user->rights->ticket->level1->level2' if you want your menu with a permission rules 'target' => '', 'user' => 2); // 0=Menu for internal users, 1=external users, 2=both - $r++; + $r++;*/ $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket', 'type' => 'left', @@ -283,6 +293,19 @@ class modTicket extends DolibarrModules 'target' => '', 'user' => 0); $r++; + + $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket,fk_leftmenu=ticket', + 'type' => 'left', + 'titre' => 'Categories', + 'mainmenu' => 'ticket', + 'url' => '/categories/index.php?type=12', + 'langs' => 'ticket', + 'position' => 107, + 'enabled' => '$conf->categorie->enabled', + 'perms' => '$user->rights->ticket->read', + 'target' => '', + 'user' => 0); + $r++; } /** diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index fbf7927ed1c..eaaf15d40a1 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -87,6 +87,7 @@ class modWorkflow extends DolibarrModules 0=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL', 0, 'current', 0), 1=>array('WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 'chaine', '1', 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL', 0, 'current', 0), 2=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING', 0, 'current', 0), + 3=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 0, 'current', 0), 4=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 0, 'current', 0), 5=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 0, 'current', 0), 6=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0), diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index b0fae39bb52..8e2d676bf27 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -263,73 +263,12 @@ class modWorkstation extends DolibarrModules $this->menu = array(); $r = 0; // Add here entries to declare new menus - /* BEGIN MODULEBUILDER TOPMENU */ - /*$this->menu[$r++] = array( - 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'top', // This is a Top menu entry - 'titre'=>$langs->trans('GPAO'), - 'mainmenu'=>'gpao', - 'leftmenu'=>'', - 'url'=>'/workstation/workstationindex.php', - 'langs'=>'workstation@workstation', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000 + $r, - 'enabled'=>'$conf->workstation->enabled', // Define condition to show or hide menu entry. Use '$conf->workstation->enabled' if entry must be visible if module is enabled. - 'perms'=>'1', // Use 'perms'=>'$user->rights->workstation->workstation->read' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - );*/ - /* END MODULEBUILDER TOPMENU */ - /* BEGIN MODULEBUILDER LEFTMENU WORKSTATION - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=workstation', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Top menu entry - 'titre'=>'Workstation', - 'mainmenu'=>'workstation', - 'leftmenu'=>'workstation', - 'url'=>'/workstation/workstationindex.php', - 'langs'=>'workstation@workstation', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->workstation->enabled', // Define condition to show or hide menu entry. Use '$conf->workstation->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->workstation->workstation->read', // Use 'perms'=>'$user->rights->workstation->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=workstation,fk_leftmenu=workstation', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'List_Workstation', - 'mainmenu'=>'workstation', - 'leftmenu'=>'workstation_workstation_list', - 'url'=>'/workstation/workstation_list.php', - 'langs'=>'workstation@workstation', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->workstation->enabled', // Define condition to show or hide menu entry. Use '$conf->workstation->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->workstation->workstation->read', // Use 'perms'=>'$user->rights->workstation->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=workstation,fk_leftmenu=workstation', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New_Workstation', - 'mainmenu'=>'workstation', - 'leftmenu'=>'workstation_workstation_new', - 'url'=>'/workstation/workstation_card.php?action=create', - 'langs'=>'workstation@workstation', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->workstation->enabled', // Define condition to show or hide menu entry. Use '$conf->workstation->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'$user->rights->workstation->workstation->write', // Use 'perms'=>'$user->rights->workstation->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - */ - $this->menu[$r++]=array( // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'fk_menu'=>'fk_mainmenu=mrp', // This is a Left menu entry 'type'=>'left', - 'titre'=>$langs->trans('Workstations'), + 'titre'=>'Workstations', 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), 'mainmenu'=>'mrp', 'leftmenu'=>'workstation_workstation', @@ -350,7 +289,7 @@ class modWorkstation extends DolibarrModules 'fk_menu'=>'fk_mainmenu=mrp,fk_leftmenu=workstation_workstation', // This is a Left menu entry 'type'=>'left', - 'titre'=>$langs->trans('WorkstationCreate'), + 'titre'=>'WorkstationCreate', 'mainmenu'=>'mrp', 'leftmenu'=>'workstation_workstation_left_create', 'url'=>'/workstation/workstation_card.php?action=create', @@ -370,7 +309,7 @@ class modWorkstation extends DolibarrModules 'fk_menu'=>'fk_mainmenu=mrp,fk_leftmenu=workstation_workstation', // This is a Left menu entry 'type'=>'left', - 'titre'=>$langs->trans('List'), + 'titre'=>'List', 'mainmenu'=>'mrp', 'leftmenu'=>'workstation_workstation_left_list', 'url'=>'/workstation/workstation_list.php', diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index 82d930a1aac..e029c4d5d66 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_stdandard extends ModelePDFMovement $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codestockservice = 0; // Affiche code stock-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codestockservice = 0; // Display stock-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -529,8 +529,8 @@ class pdf_stdandard extends ModelePDFMovement if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$objp->rowid; - $sql .= " AND lang='".$this->db->escape($langs->getDefaultLang())."'"; + $sql .= " WHERE fk_product = ".((int) $objp->rowid); + $sql .= " AND lang = '".$this->db->escape($langs->getDefaultLang())."'"; $sql .= " LIMIT 1"; $result = $this->db->query($sql); diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index 374ae5b4337..e93ecd1af0a 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,18 +85,18 @@ class doc_generic_mo_odt extends ModelePDFMo $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -158,7 +158,7 @@ class doc_generic_mo_odt extends ModelePDFMo $texte .= $conf->global->MRP_MO_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -175,7 +175,7 @@ class doc_generic_mo_odt extends ModelePDFMo $texte .= '
    '; // Show list of found files foreach ($listoffiles as $file) { - $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
    '; + $texte .= '- '.$file['name'].' '.img_picto('', 'listlight').'
    '; } $texte .= '
    '; } @@ -284,8 +284,12 @@ class doc_generic_mo_odt extends ModelePDFMo //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->bom->dir_temp); - + dol_mkdir($conf->mrp->dir_temp); + if (!is_writable($conf->mrp->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->mrp->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; @@ -342,11 +346,13 @@ class doc_generic_mo_odt extends ModelePDFMo dol_syslog($e->getMessage(), LOG_INFO); return -1; } + // After construction $odfHandler->contentXml contains content and // [!-- BEGIN row.lines --]*[!-- END row.lines --] has been replaced by // [!-- BEGIN lines --]*[!-- END lines --] //print html_entity_decode($odfHandler->__toString()); //print exit; + /* // Make substitutions into odt of freetext @@ -379,20 +385,22 @@ class doc_generic_mo_odt extends ModelePDFMo foreach ($tmparray as $key => $value) { try { - if (preg_match('/logo$/', $key)) { // Image + if (preg_match('/logo$/', $key)) { + // Image if (file_exists($value)) { $odfHandler->setImage($key, $value); } else { $odfHandler->setVars($key, 'ErrorFileNotFound', true, 'UTF-8'); } - } else // Text - { + } else { + // Text $odfHandler->setVars($key, $value, true, 'UTF-8'); } } catch (OdfException $e) { dol_syslog($e->getMessage(), LOG_INFO); } } + // Replace tags of lines try { $foundtagforlines = 1; @@ -403,6 +411,7 @@ class doc_generic_mo_odt extends ModelePDFMo $foundtagforlines = 0; dol_syslog($e->getMessage(), LOG_INFO); } + if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { @@ -445,14 +454,14 @@ class doc_generic_mo_odt extends ModelePDFMo $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - + */ // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { $this->error = $e->getMessage(); - dol_syslog($e->getMessage(), LOG_INFO); + dol_syslog('Error in exportAsAttachedPDF: '.$e->getMessage(), LOG_INFO); return -1; } } else { @@ -460,7 +469,7 @@ class doc_generic_mo_odt extends ModelePDFMo $odfHandler->saveToDisk($file); } catch (Exception $e) { $this->error = $e->getMessage(); - dol_syslog($e->getMessage(), LOG_INFO); + dol_syslog('Error in saveToDisk: '.$e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/mrp/mod_mo_advanced.php b/htdocs/core/modules/mrp/mod_mo_advanced.php index 3d70ded1ba2..14292f7f896 100644 --- a/htdocs/core/modules/mrp/mod_mo_advanced.php +++ b/htdocs/core/modules/mrp/mod_mo_advanced.php @@ -80,7 +80,7 @@ class mod_mo_advanced extends ModeleNumRefMos // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/mrp/modules_mo.php b/htdocs/core/modules/mrp/modules_mo.php index 82a1a9f3b56..454df89bcde 100644 --- a/htdocs/core/modules/mrp/modules_mo.php +++ b/htdocs/core/modules/mrp/modules_mo.php @@ -52,7 +52,7 @@ abstract class ModelePDFMo extends CommonDocGenerator // phpcs:enable global $conf; - $type = 'mo'; + $type = 'mrp'; $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 10926805721..dca32b26505 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -82,7 +82,7 @@ class mod_payment_ant extends ModeleNumRefPayments // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 19a752d5be7..1acf50dd95a 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -83,18 +83,18 @@ class doc_generic_product_odt extends ModelePDFProduct $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PRODUCT_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PRODUCT_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -161,7 +161,7 @@ class doc_generic_product_odt extends ModelePDFProduct $texte .= $conf->global->PRODUCT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -302,7 +302,11 @@ class doc_generic_product_odt extends ModelePDFProduct //print "conf->product->dir_temp=".$conf->product->dir_temp; dol_mkdir($conf->product->dir_temp); - + if (!is_writable($conf->product->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on product, we use it $usecontact = false; diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index 99b6ff69236..815fc4d1c66 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFProduct $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 0a302c0fb6b..0b03bd9b6a4 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -116,15 +116,15 @@ class mod_codeproduct_elephant extends ModeleProductCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte .= '  '; + $texte .= '  '; $texte .= ''; // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("ServiceCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index e0141348568..fef12717e3b 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -193,7 +193,8 @@ abstract class ModeleProductCode { global $conf; - $langs->load("admin"); + $langs->loadLangs(array("admin", "companies")); + $strikestart = ''; $strikeend = ''; if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) { diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index c580d8915c9..8ee857bfbea 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -80,7 +80,7 @@ class mod_lot_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -128,27 +128,27 @@ class mod_lot_advanced extends ModeleNumRefBatch /** * Return next free value * - * @param Product $objprod Object product + * @param Societe $objsoc Object Societe * @param Object $object Object we need next value for * @return string Value if KO, <0 if KO */ - public function getNextValue($objprod, $object) + public function getNextValue($objsoc, $object) { global $db, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->BATCH_ADVANCED_MASK; + $mask = $conf->global->LOT_ADVANCED_MASK; if (!$mask) { $this->error = 'NotConfigured'; return 0; } - $date = $object->date; + $date = dol_now(); - $numFinal = get_next_value($db, $mask, 'product_lot', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); return $numFinal; } diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php index 0d2b5a55139..59de1965a6e 100644 --- a/htdocs/core/modules/product_batch/mod_lot_standard.php +++ b/htdocs/core/modules/product_batch/mod_lot_standard.php @@ -85,17 +85,21 @@ class mod_lot_standard extends ModeleNumRefBatch $coyymm = ''; $max = ''; $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql = "SELECT MAX(CAST(SUBSTRING(batch FROM ".$posindice.") AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lot"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " WHERE batch LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { - $row = $db->fetch_row($resql); - if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; } + $obj = $db->fetch_object($resql); + if ($obj) { + $max = intval($obj->max); + } else { + $max = 0; + } } - if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + if ($max && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $max)) { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -117,23 +121,26 @@ class mod_lot_standard extends ModeleNumRefBatch // First, we get the max value $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql = "SELECT MAX(CAST(SUBSTRING(batch FROM ".$posindice.") AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lot"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " WHERE batch LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); - if ($obj) $max = intval($obj->max); - else $max = 0; + if ($obj) { + $max = intval($obj->max); + } else { + $max = 0; + } } else { dol_syslog("mod_lot_standard::getNextValue", LOG_DEBUG); return -1; } //$date=time(); - $date = $object->date_creation; + $date = dol_now(); $yymm = strftime("%y%m", $date); if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index 74f36a55fe6..54c67291d9a 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -80,7 +80,7 @@ class mod_sn_advanced extends ModeleNumRefBatch // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -139,16 +139,16 @@ class mod_sn_advanced extends ModeleNumRefBatch require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // We get cursor rule - $mask = $conf->global->BATCH_ADVANCED_MASK; + $mask = $conf->global->SN_ADVANCED_MASK; if (!$mask) { $this->error = 'NotConfigured'; return 0; } - $date = $object->date; + $date = dol_now(); - $numFinal = get_next_value($db, $mask, 'product_sn', 'ref', '', null, $date); + $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); return $numFinal; } diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php index bef5efcd9f8..845044c39f3 100644 --- a/htdocs/core/modules/product_batch/mod_sn_standard.php +++ b/htdocs/core/modules/product_batch/mod_sn_standard.php @@ -85,17 +85,21 @@ class mod_sn_standard extends ModeleNumRefBatch $coyymm = ''; $max = ''; $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql = "SELECT MAX(CAST(SUBSTRING(batch FROM ".$posindice.") AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lot"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " WHERE batch LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { - $row = $db->fetch_row($resql); - if ($row) { $coyymm = substr($row[0], 0, 6); $max = $row[0]; } + $obj = $db->fetch_object($resql); + if ($obj) { + $max = intval($obj->max); + } else { + $max = 0; + } } - if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + if ($max && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $max)) { $langs->load("errors"); $this->error = $langs->trans('ErrorNumRefModel', $max); return false; @@ -107,33 +111,36 @@ class mod_sn_standard extends ModeleNumRefBatch /** * Return next free value * - * @param Product $objprod Object product + * @param Societe $objsoc Object product * @param Object $object Object we need next value for * @return string Value if KO, <0 if KO */ - public function getNextValue($objprod, $object) + public function getNextValue($objsoc, $object) { global $db, $conf; // First, we get the max value $posindice = strlen($this->prefix) + 6; - $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql = "SELECT MAX(CAST(SUBSTRING(batch FROM ".$posindice.") AS SIGNED)) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lot"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + $sql .= " WHERE batch LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); - if ($obj) $max = intval($obj->max); - else $max = 0; + if ($obj) { + $max = intval($obj->max); + } else { + $max = 0; + } } else { dol_syslog("mod_sn_standard::getNextValue", LOG_DEBUG); return -1; } //$date=time(); - $date = $object->date_creation; + $date = dol_now(); $yymm = strftime("%y%m", $date); if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index d007b421fd7..233180630b0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -120,18 +120,18 @@ class doc_generic_project_odt extends ModelePDFProjects $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->pays_code) { $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini @@ -449,7 +449,7 @@ class doc_generic_project_odt extends ModelePDFProjects $texte .= $conf->global->PROJECT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -574,6 +574,11 @@ class doc_generic_project_odt extends ModelePDFProjects //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->projet->dir_temp); + if (!is_writable($conf->projet->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If PROJECTLEADER contact defined on project, we use it $usecontact = false; @@ -742,7 +747,7 @@ class doc_generic_project_odt extends ModelePDFProjects $sql .= ", u.lastname, u.firstname, t.thm"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE t.fk_task =".$task->id; + $sql .= " WHERE t.fk_task =".((int) $task->id); $sql .= " AND t.fk_user = u.rowid"; $sql .= " ORDER BY t.task_date DESC"; diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php index 3ab4079c1b7..480d19396c3 100644 --- a/htdocs/core/modules/project/mod_project_universal.php +++ b/htdocs/core/modules/project/mod_project_universal.php @@ -83,7 +83,7 @@ class mod_project_universal extends ModeleNumRefProjects // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 2d263aae6c0..638ab70bb84 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -121,21 +121,21 @@ class doc_generic_task_odt extends ModelePDFTask $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 0; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 0; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->pays_code) { - $this->emetteur->pays_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined } } @@ -416,7 +416,7 @@ class doc_generic_task_odt extends ModelePDFTask $texte .= $conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -524,6 +524,11 @@ class doc_generic_task_odt extends ModelePDFTask //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->projet->dir_temp); + if (!is_writable($conf->projet->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } $socobject = $project->thirdparty; @@ -657,7 +662,7 @@ class doc_generic_task_odt extends ModelePDFTask $sql .= ", u.lastname, u.firstname"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " WHERE t.fk_task =".$object->id; + $sql .= " WHERE t.fk_task =".((int) $object->id); $sql .= " AND t.fk_user = u.rowid"; $sql .= " ORDER BY t.task_date DESC"; diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index 011ac381254..3a6ef89f3fb 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -83,7 +83,7 @@ class mod_task_universal extends ModeleNumRefTask // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 4a292d4a97b..9c7e0af4df0 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -82,18 +82,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -160,7 +160,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales $texte .= $conf->global->PROPALE_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -209,7 +209,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -318,7 +318,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales //print "conf->propal->dir_temp=".$conf->propal->dir_temp; dol_mkdir($conf->propal->multidir_temp[$object->entity]); - + if (!is_writable($conf->propal->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->propal->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on proposal, we use it $usecontact = false; diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 0aed96df0e5..f75f5ecab56 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -434,13 +434,12 @@ class pdf_cyan extends ModelePDFPropales if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) { $tmpuser = new User($this->db); $tmpuser->fetch($object->user_author_id); - $notetoshow .= $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); - if ($tmpuser->email) { - $notetoshow .= ', Mail: '.$tmpuser->email; - } - if ($tmpuser->office_phone) { - $notetoshow .= ', Tel: '.$tmpuser->office_phone; - } + + $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); + if ($tmpuser->email) $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; + if ($tmpuser->office_phone) $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; + + $notetoshow = dol_concatdesc($notetoshow, $creator_info); } $tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter; diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php index 5fb7eeaa6fb..ce78f341319 100644 --- a/htdocs/core/modules/propale/mod_propale_saphir.php +++ b/htdocs/core/modules/propale/mod_propale_saphir.php @@ -85,7 +85,7 @@ class mod_propale_saphir extends ModeleNumRefPropales // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index b69ebdeb828..9f85aca1aff 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -209,7 +209,7 @@ class pdf_paiement $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } if (!empty($socid)) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } // If global param PAYMENTS_REPORT_GROUP_BY_MOD is set, payement are ordered by paiement_code if (!empty($conf->global->PAYMENTS_REPORT_GROUP_BY_MOD)) { diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 13a05b3378d..93dbc4995b4 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -80,18 +80,18 @@ class doc_generic_reception_odt extends ModelePdfReception $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva RECEPTION_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option RECEPTION_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -153,7 +153,7 @@ class doc_generic_reception_odt extends ModelePdfReception $texte .= $conf->global->RECEPTION_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -282,7 +282,11 @@ class doc_generic_reception_odt extends ModelePdfReception //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->reception->dir_temp); - + if (!is_writable($conf->reception->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->reception->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 0e4474b6b8c..68ceb87ba96 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_squille extends ModelePdfReception { - public $emetteur; // Objet societe qui emet + /** + * Issuer + * @var Societe object that emits + */ + public $emetteur; /** @@ -58,7 +62,7 @@ class pdf_squille extends ModelePdfReception $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; + $this->option_logo = 1; // Display logo // Get source company $this->emetteur = $mysoc; @@ -141,8 +145,13 @@ class pdf_squille extends ModelePdfReception $objphoto = new Product($this->db); $objphoto->fetch($object->lines[$i]->fk_product); - $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; - $dir = $conf->product->dir_output.'/'.$pdir; + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { + $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; + $dir = $conf->product->dir_output.'/'.$pdir; + } else { + $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product'); + $dir = $conf->product->dir_output.'/'.$pdir; + } $realpath = ''; @@ -442,7 +451,7 @@ class pdf_squille extends ModelePdfReception } $posYAfterDescription = $pdf->GetY(); - $nexY = $pdf->GetY(); + $nexY = max($pdf->GetY(), $posYAfterImage); $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index bcab451ab9e..0d0ced20eb4 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -61,7 +61,7 @@ class mod_reception_moonstone extends ModelNumRefReception $tooltip .= $langs->trans("GenericMaskCodes5"); $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index e091b5069e9..a358f916429 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -99,7 +99,7 @@ class modGeneratePassStandard extends ModeleGenPassword $password = ""; // define possible characters - $possible = "0123456789bcdfghjkmnpqrstvwxyz"; + $possible = "0123456789qwertyuiopasdfghjklzxcvbnmASDFGHJKLZXCVBNMQWERTYUIOP"; // set up a counter $i = 0; @@ -107,10 +107,13 @@ class modGeneratePassStandard extends ModeleGenPassword // add random characters to $password until $length is reached while ($i < $this->length) { // pick a random character from the possible ones - $char = substr($possible, mt_rand(0, dol_strlen($possible) - 1), 1); + if (function_exists('random_int')) { // Cryptographic random + $char = substr($possible, random_int(0, dol_strlen($possible) - 1), 1); + } else { + $char = substr($possible, mt_rand(0, dol_strlen($possible) - 1), 1); + } - // we don't want this character if it's already in the password - if (!strstr($password, $char)) { + if (substr_count($password, $char) <= 6) { // we don't want this character if it's already 5 times in the password $password .= $char; $i++; } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 1822a5b8c95..fdafb22e96b 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -76,12 +76,12 @@ class doc_generic_odt extends ModeleThirdPartyDoc $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo + $this->option_logo = 1; // Display logo // Retrieves transmitter $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { - $this->emetteur->country_code = substr($langs->defaultlang, -2); // Par defaut, si n'etait pas defini + $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined } } @@ -141,7 +141,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $texte .= ''; $texte .= ''; $texte .= '  '; - $texte .= ''; + $texte .= ''; $texte .= ''; $texte .= ''; $texte .= ''; @@ -167,7 +167,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -266,6 +266,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc //exit; dol_mkdir($conf->societe->multidir_temp[$object->entity]); + if (!is_writable($conf->societe->multidir_temp[$object->entity])) { + $this->error = "Failed to write in temp directory ".$conf->societe->multidir_temp[$object->entity]; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // Open and load template require_once ODTPHP_PATH.'odf.php'; diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index 9ddf77abe44..705564e7e8e 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -132,7 +132,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix customers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("CustomerCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -140,7 +140,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode // Parametrage du prefix suppliers $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("SupplierCodeModel").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index 28d0120da72..09f6cb9c29d 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -198,7 +198,8 @@ abstract class ModeleThirdPartyCode { global $conf; - $langs->load("admin"); + $langs->loadLangs(array("admin", "companies")); + $strikestart = ''; $strikeend = ''; if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) { diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index 2819adea021..5ca5019588a 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -82,18 +82,18 @@ class doc_generic_stock_odt extends ModelePDFStock $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva STOCK_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option STOCK_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -155,7 +155,7 @@ class doc_generic_stock_odt extends ModelePDFStock $texte .= $conf->global->STOCK_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -179,7 +179,7 @@ class doc_generic_stock_odt extends ModelePDFStock // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -291,7 +291,11 @@ class doc_generic_stock_odt extends ModelePDFStock //print "conf->product->dir_temp=".$conf->product->dir_temp; dol_mkdir($conf->product->dir_temp); - + if (!is_writable($conf->product->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->product->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on stock, we use it $usecontact = false; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index a57b996086b..ebc109151d6 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -137,12 +137,12 @@ class pdf_standard extends ModelePDFStock $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_codestockservice = 0; // Affiche code stock-service - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_codestockservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -315,7 +315,7 @@ class pdf_standard extends ModelePDFStock $sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) - $sql .= " AND ps.fk_entrepot = ".$object->id; + $sql .= " AND ps.fk_entrepot = ".((int) $object->id); $sql .= $this->db->order($sortfield, $sortorder); //dol_syslog('List products', LOG_DEBUG); diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8f6d12df1d0..08345647b0f 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -376,7 +376,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note = $nexY - $tab_top; @@ -1062,7 +1062,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output - * @return void + * @return int */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index 3cf0a4a209e..57d5798c29e 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -93,7 +93,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Setting the prefix $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')'; $texte .= ':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; @@ -101,19 +101,19 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices // Prefix setting of credit note $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; if ($conf->global->MAIN_FEATURE_LEVEL >= 2) { // Parametrage du prefix des replacement $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; } // Prefix setting of deposit $texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= ''; $texte .= ''; diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index 9e9799f44c6..3a2775bef82 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -86,13 +86,13 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -159,7 +159,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders $texte .= $conf->global->SUPPLIER_ORDER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -280,8 +280,12 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->commande->dir_temp); - + dol_mkdir($conf->fournisseur->commande->dir_temp); + if (!is_writable($conf->fournisseur->commande->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->fournisseur->commande->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index c60f82e9c4a..dc898c98cb5 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -148,13 +148,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; //Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; // Support add of a watermark on drafts @@ -240,8 +240,15 @@ class pdf_cornas extends ModelePDFSuppliersOrders $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index c6d9cf8da14..bb12b19c829 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -254,8 +254,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php index a609eeade08..c691b1448ef 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php @@ -85,7 +85,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php index 8f3b7ad36df..19e632a6264 100644 --- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php +++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php @@ -82,7 +82,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 4b761f8099b..717818448ec 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -84,13 +84,13 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva PROPALE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option PROPALE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts @@ -162,7 +162,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $texte .= $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -315,7 +315,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal //print "conf->propal->dir_temp=".$conf->propal->dir_temp; dol_mkdir($conf->supplier_proposal->dir_temp); - + if (!is_writable($conf->supplier_proposal->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->supplier_proposal->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If BILLING contact defined on invoice, we use it $usecontact = false; diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index c6cc6e8d1b1..5bd9b8cf339 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -145,13 +145,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION - $this->option_modereg = 1; // Affiche mode reglement - $this->option_condreg = 1; // Affiche conditions reglement - $this->option_codeproduitservice = 1; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 1; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 1; // Display payment mode + $this->option_condreg = 1; // Display payment terms + $this->option_codeproduitservice = 1; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 1; // Displays if there has been a discount $this->option_credit_note = 1; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 1; //Support add of a watermark on drafts @@ -245,14 +245,21 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { - $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + $pdir = get_exdir(0, 0, 0, 0, $objphoto, 'product'); $dir = $conf->product->dir_output.'/'.$pdir; } $realpath = ''; foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) { - $filename = $obj['photo']; - //if ($obj['photo_vignette']) $filename='thumbs/'.$obj['photo_vignette']; + if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) { // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo + if ($obj['photo_vignette']) { + $filename = $obj['photo_vignette']; + } else { + $filename = $obj['photo']; + } + } else { + $filename = $obj['photo']; + } $realpath = $dir.$filename; break; } diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php index adf53aed4e6..3b8754d9928 100644 --- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php +++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php @@ -85,7 +85,7 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index e6487db6ed1..d103dbe3b0b 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -79,7 +79,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php index eb90baef7e5..2e6172d4181 100644 --- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php +++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php @@ -81,13 +81,13 @@ class doc_generic_ticket_odt extends ModelePDFTicket $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USER_TVAOPTION - $this->option_multilang = 1; // Dispo en plusieurs langues + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USER_TVAOPTION + $this->option_multilang = 1; // Available in several languages $this->option_freetext = 0; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -150,7 +150,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $texte .= $conf->global->TICKET_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -167,7 +167,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -222,7 +222,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket // Load translation files required by the page $outputlangs->loadLangs(array("main", "companies", "bills", "dict")); - if ($conf->user->dir_output) { + if ($conf->ticket->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -236,7 +236,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $object->fetch_thirdparty(); - $dir = $conf->user->dir_output; + $dir = $conf->ticket->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -274,10 +274,14 @@ class doc_generic_ticket_odt extends ModelePDFTicket //print "newdir=".$dir; //print "newfile=".$newfile; //print "file=".$file; - //print "conf->user->dir_temp=".$conf->user->dir_temp; - - dol_mkdir($conf->user->dir_temp); + //print "conf->ticket->dir_temp=".$conf->ticket->dir_temp; + dol_mkdir($conf->ticket->dir_temp); + if (!is_writable($conf->ticket->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->ticket->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; @@ -306,7 +310,7 @@ class doc_generic_ticket_odt extends ModelePDFTicket $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->user->dir_temp, + 'PATH_TO_TMP' => $conf->ticket->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php index 1a528359221..f60b1f16481 100644 --- a/htdocs/core/modules/ticket/mod_ticket_universal.php +++ b/htdocs/core/modules/ticket/mod_ticket_universal.php @@ -81,7 +81,7 @@ class mod_ticket_universal extends ModeleNumRefTicket // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; $texte .= '  '; diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index fb24e2782c9..7ca8d29c380 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2012 Juanjo Menent - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -81,18 +81,18 @@ class doc_generic_user_odt extends ModelePDFUser $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USER_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USER_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -120,7 +120,7 @@ class doc_generic_user_odt extends ModelePDFUser $texte .= ''; $texte .= ''; $texte .= ''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { $texte .= ''; $texte .= ''; $texte .= ''; @@ -159,14 +159,14 @@ class doc_generic_user_odt extends ModelePDFUser $texte .= $conf->global->USER_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories if (count($listofdir)) { $texte .= $langs->trans("NumberOfModelFilesFound").': '.count($listoffiles).''; - if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) { + if (!empty($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT)) { // Model for creation $list = ModelePDFUser::liste_modeles($this->db); $texte .= ''; @@ -199,7 +199,7 @@ class doc_generic_user_odt extends ModelePDFUser // Add input to upload a new template file. $texte .= '
    '.$langs->trans("UploadNewTemplate").' '; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= '
    '; $texte .= ''; @@ -309,7 +309,11 @@ class doc_generic_user_odt extends ModelePDFUser //print "conf->user->dir_temp=".$conf->user->dir_temp; dol_mkdir($conf->user->dir_temp); - + if (!is_writable($conf->user->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 45a9469753e..5a1bca6377d 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -84,18 +84,18 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva USERGROUP_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option USERGROUP_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -162,7 +162,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $texte .= $conf->global->USERGROUP_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -299,7 +299,11 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup //print "conf->user->dir_temp=".$conf->user->dir_temp; dol_mkdir($conf->user->dir_temp); - + if (!is_writable($conf->user->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->user->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on user, we use it $usecontact = false; diff --git a/htdocs/core/modules/workstation/mod_workstation_advanced.php b/htdocs/core/modules/workstation/mod_workstation_advanced.php index 4e23219581c..bf783542c75 100755 --- a/htdocs/core/modules/workstation/mod_workstation_advanced.php +++ b/htdocs/core/modules/workstation/mod_workstation_advanced.php @@ -80,7 +80,7 @@ class mod_workstation_advanced extends ModeleNumRefWorkstation // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index b3079691cd5..374f381c098 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -383,7 +383,7 @@ if ($action == 'confirm_resize' && GETPOSTISSET("file") && GETPOSTISSET("sizex") $ecmfile->fullpath_orig = $fullpath; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -448,7 +448,7 @@ if ($action == 'confirm_crop') { $ecmfile->fullpath_orig = $fullpath; $ecmfile->gen_or_uploaded = 'unknown'; $ecmfile->description = ''; // indexed content - $ecmfile->keyword = ''; // keyword content + $ecmfile->keywords = ''; // keyword content $result = $ecmfile->create($user); if ($result < 0) { setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings'); @@ -487,8 +487,10 @@ print load_fiche_titre($title); $infoarray = dol_getImageSize($dir."/".GETPOST("file", 'alpha')); $height = $infoarray['height']; $width = $infoarray['width']; -print ''.$langs->trans("CurrentInformationOnImage").': '; -print $langs->trans("Width").': '.$width.' x '.$langs->trans("Height").': '.$height.'
    '; +print ''.$langs->trans("CurrentInformationOnImage").': '; +print ''; +print $langs->trans("Width").': '.$width.' x '.$langs->trans("Height").': '.$height.''; +print '
    '; print '
    '."\n"; @@ -546,36 +548,42 @@ if (!empty($conf->use_javascript_ajax)) { print ''.$langs->trans("Recenter").''; print $langs->trans("DefineNewAreaToPick").'...
    '; print '
    '; - print '
    '; - print ''; - print '
    '; - print '

    '; - print ''; - print ''; - print ' -
    - '.$langs->trans("NewSizeAfterCropping").': - - - - - - -
    + if (empty($conf->dol_no_mouse_hover)) { + print '
    '; + print ''; + print '
    '; + print '
    '; - - - - - - - -
    - -   - - '."\n"; + print ''; + print ''; + print ' +
    + '.$langs->trans("NewSizeAfterCropping").': + + + + + + +
    + + + + + + + + +
    + +   + + '."\n"; + } else { + $langs->load("other"); + print '
    '.$langs->trans("FeatureNotAvailableOnDevicesWithoutMouse").'
    '; + } print ''."\n"; print '
    '; } diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index 8581776a2d8..2b82501208a 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -20,7 +20,7 @@ /** * \file htdocs/core/search_page.php - * \brief File to return a page with search boxes + * \brief File to return a page with the complete search form (all search input fields) */ //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language @@ -77,7 +77,7 @@ $hookmanager->initHooks(array('searchform')); // Define $searchform $searchform = ''; -if ($conf->use_javascript_ajax && 1 == 2) { // select2 is ko with jmobile +if ($conf->use_javascript_ajax && 1 == 2) { // select2 is not best with smartphone if (!is_object($form)) { $form = new Form($db); } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index ddcdfdf9e4b..d9c0f650395 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -138,7 +138,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
    Contact:con " method="post"> - + diff --git a/htdocs/core/tpl/ajax/fileupload_main.tpl.php b/htdocs/core/tpl/ajax/fileupload_main.tpl.php index a4563c7536a..8be24f7450f 100644 --- a/htdocs/core/tpl/ajax/fileupload_main.tpl.php +++ b/htdocs/core/tpl/ajax/fileupload_main.tpl.php @@ -63,8 +63,11 @@ $(function () { "trans('Ok'); ?>": function() { $( "#confirm-delete" ).dialog( "close" ); if (data.url) { - $.ajax(data) - .success(function (data) { + $.ajax({ + method: "POST", + data: { token: '' }, + url: data.url + }).success(function (data) { if (data) { that._adjustMaxNumberOfFiles(1); $(this).fadeOut(function () { diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index 6d6df3a5408..88c643c641d 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -79,7 +79,6 @@ $(document).ready(function(){ function() { console.log("tableDND end of ajax call"); if (reloadpage == 1) { - //console.log(''); ref_client)) { $topicmail = $outputlangs->trans($defaulttopic, '__REF__'); } elseif (!empty($object->ref_client)) { - $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)'); + $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REF_CLIENT__)'); } // Build document if it not exists @@ -137,6 +137,13 @@ if ($action == 'presend') { $formmail->fromname = ''; $formmail->fromtype = 'special'; } + if ($object->element === 'order_supplier' && !empty($conf->global->ORDER_SUPPLIER_EMAIL_SENDER)) { + $formmail->frommail = $conf->global->ORDER_SUPPLIER_EMAIL_SENDER; + $formmail->fromname = ''; + $formmail->fromtype = 'special'; + } + + $formmail->trackid = $trackid; if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set @@ -194,7 +201,7 @@ if ($action == 'presend') { $formmail->withto = $liste; $formmail->withtofree = (GETPOSTISSET('sendto') ? (GETPOST('sendto', 'alphawithlgt') ? GETPOST('sendto', 'alphawithlgt') : '1') : '1'); $formmail->withtocc = $liste; - $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; + $formmail->withtoccc = getDolGlobalString('MAIN_EMAIL_USECCC'); $formmail->withtopic = $topicmail; $formmail->withfile = 2; $formmail->withbody = 1; diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 639be537dba..cd07c0b8191 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -47,7 +47,7 @@ foreach ($object->fields as $key => $val) { print ''; print ''; if (!empty($val['picto'])) { - print img_picto('', $val['picto']); + print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOST($key, 'int'); @@ -82,7 +82,7 @@ foreach ($object->fields as $key => $val) { } else { $value = GETPOST($key, 'alphanohtml'); } - if ($val['noteditable']) { + if (!empty($val['noteditable'])) { print $object->showOutputField($val, $key, $value, '', '', '', 0); } else { print $object->showInputField($val, $key, $value, '', '', '', 0); diff --git a/htdocs/core/tpl/commonfields_edit.tpl.php b/htdocs/core/tpl/commonfields_edit.tpl.php index 9fef2d2f2b9..9670271d1a4 100644 --- a/htdocs/core/tpl/commonfields_edit.tpl.php +++ b/htdocs/core/tpl/commonfields_edit.tpl.php @@ -48,7 +48,7 @@ foreach ($object->fields as $key => $val) { print ''; if (!empty($val['picto'])) { - print img_picto('', $val['picto']); + print img_picto('', $val['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($val['type'], array('int', 'integer'))) { $value = GETPOSTISSET($key) ?GETPOST($key, 'int') : $object->$key; diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 4b7821c2dad..f9da77c5894 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -74,7 +74,7 @@ foreach ($object->fields as $key => $val) { if ($val['type'] == 'text') { print ' wordbreak'; } - if ($val['cssview']) { + if (!empty($val['cssview'])) { print ' '.$val['cssview']; } print '">'; diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 511c03a931b..d0d4d25740c 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -2,6 +2,7 @@ /* Copyright (C) 2012 Regis Houssin * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2015-2016 Charlie BENKE + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -100,11 +101,11 @@ if ($permission) { if (empty($hideaddcontactforuser)) { ?> " /> + - '; } ?> @@ -130,23 +131,21 @@ if ($permission) { ?> " /> + - '; } ?>
    - socid; ?> - socid) ? 0 : $object->socid); // add company icon before select list if ($selectedCompany) { echo img_object('', 'company', 'class="hideonsmartphone"'); } - ?> - selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?> + $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
    diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 4a43da6d6cc..4ec69efbac8 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -47,6 +47,9 @@ if (!isset($permission)) { if (!isset($permtoedit)) { $permtoedit = $permissiontoadd; } +if (!isset($param)) { + $param = ''; +} // Drag and drop for up and down allowed on product, thirdparty, ... // The drag and drop call the page core/ajax/row.php @@ -112,7 +115,7 @@ if (!isset($savingdocmask) || !empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_ } } -if (!is_object($formfile)) { +if (empty($formfile) || !is_object($formfile)) { $formfile = new FormFile($db); } diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index f194a177178..2f44bbe9c48 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -47,7 +47,7 @@ if (empty($reshook)) { if (isset($tpl_context)) { $params['tpl_context'] = $tpl_context; } - $params['cols'] = $parameters['colspanvalue']; + $params['cols'] = key_exists('colspanvalue', $parameters) ? $parameters['colspanvalue'] : ''; print $object->showOptionals($extrafields, 'create', $params); } diff --git a/htdocs/core/tpl/extrafields_edit.tpl.php b/htdocs/core/tpl/extrafields_edit.tpl.php index 5915fb8a633..6d6b6aa8836 100644 --- a/htdocs/core/tpl/extrafields_edit.tpl.php +++ b/htdocs/core/tpl/extrafields_edit.tpl.php @@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, print $hookmanager->resPrint; if (empty($reshook)) { $params = array(); - $params['cols'] = $parameters['colspanvalue']; + $params['cols'] = isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null; print $object->showOptionals($extrafields, 'edit', $params); } diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php index ebab4e8608a..f7c9fc201f4 100644 --- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php @@ -23,6 +23,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table if (!empty($extrafields->attributes[$extrafieldsobjectkey]['list'][$key])) { $arrayfields[$extrafieldsobjectprefix.$key] = array( 'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key], + 'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key], 'checked' => (($extrafields->attributes[$extrafieldsobjectkey]['list'][$key] < 0) ? 0 : 1), 'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key], 'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && $extrafields->attributes[$extrafieldsobjectkey]['perms'][$key]), diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 4c56b0223cd..7d547d52dea 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -11,8 +11,8 @@ if (empty($extrafieldsobjectkey) && is_object($object)) { } // Loop to show all columns of extrafields from $obj, $extrafields and $db -if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... - if (is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { +if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafieldsobjectkey])) { // $extrafieldsobject is the $object->table_element like 'societe', 'socpeople', ... + if (key_exists('label', $extrafields->attributes[$extrafieldsobjectkey]) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) { if (empty($extrafieldsobjectprefix)) { $extrafieldsobjectprefix = 'ef.'; } @@ -66,6 +66,12 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = $extrafieldsobjectprefix.$tmpkey; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val'][$extrafieldsobjectprefix.$tmpkey])) { + $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] = 0; + } $totalarray['val'][$extrafieldsobjectprefix.$tmpkey] += $obj->$tmpkey; } } diff --git a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php index f1b62676887..8b7ff9ac62c 100644 --- a/htdocs/core/tpl/extrafields_list_search_sql.tpl.php +++ b/htdocs/core/tpl/extrafields_list_search_sql.tpl.php @@ -65,7 +65,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($ if (is_array($crit)) { $crit = implode(' ', $crit); // natural_search() expects a string } elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) { - $sql .= ' AND ('.$extrafieldsobjectprefix.$tmpkey.' = "'.$db->escape($crit).'")'; + $sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."')"; continue; } $sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search); diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 3b826b2ead5..e87d6df18dc 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -258,7 +258,6 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l } } - // Add code to manage list depending on others // TODO Test/enhance this with a more generic solution if (!empty($conf->use_javascript_ajax)) { diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index d8bbe0c7cc0..57a95c48ece 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -16,6 +16,7 @@ * * Output code for the filemanager * $module must be defined ('ecm', 'medias', ...) + * $formalreadyopen can be set to 1 to avoid to open the to submit files a second time */ // Protection to avoid direct call of template @@ -128,7 +129,7 @@ $nameforformuserfile = 'formuserfileecm'; print '
    '; -// To attach new file +// For to attach a new file if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) || !empty($section)) { if ((empty($section) || $section == -1) && ($module != 'medias')) { ?> @@ -141,10 +142,11 @@ if ((!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE } $sectiondir = GETPOST('file', 'alpha') ?GETPOST('file', 'alpha') : GETPOST('section_dir', 'alpha'); + print ''."\n"; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); - $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir); + print $formfile->form_attach_new_file($_SERVER["PHP_SELF"], 'none', 0, ($section ? $section : -1), $permtoupload, 48, null, '', 0, '', 0, $nameforformuserfile, '', $sectiondir, empty($formalreadyopen) ? 0 : $formalreadyopen, 0, 0, 1); } else { print ' '; } diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 62052b82cec..543bb939850 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -16,7 +16,7 @@ if (isset($totalarray['pos'])) { print '
    '; } else { if ($i == 1) { - if ($num < $limit) { + if (is_null($limit) || $num < $limit) { print ''; } else { print 'situation_cycle_ref) { + if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''; print ''; } @@ -416,7 +416,7 @@ if ($nolinesbefore) { ?> situation_cycle_ref) { + if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { $coldisplay++; print ''; $coldisplay++; @@ -432,15 +432,15 @@ if ($nolinesbefore) { - "> + "> global->DISPLAY_MARGIN_RATES)) { - echo ''; + echo ''; $coldisplay++; } if (!empty($conf->global->DISPLAY_MARK_RATES)) { - echo ''; + echo ''; $coldisplay++; } } @@ -448,7 +448,7 @@ if ($nolinesbefore) { $coldisplay += $colspan; ?> diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 6138bcecc1a..9094daaa2d1 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -130,8 +130,16 @@ $coldisplay++; $reshook = $hookmanager->executeHooks('formEditProductOptions', $parameters, $this, $action); } + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + // Do not allow editing during a situation cycle - if ($line->fk_prev_id == null) { + if (!$situationinvoicelinewithparent) { // editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows = ROWS_2; @@ -181,7 +189,7 @@ $coldisplay++; } $coldisplay++; - if ($line->fk_prev_id == null) { + if (!$situationinvoicelinewithparent) { print ''; } else { print ''; @@ -189,7 +197,7 @@ $coldisplay++; $coldisplay++; print ''; @@ -211,12 +219,12 @@ $coldisplay++; '; // Fields for situation invoice -if ($this->situation_cycle_ref) { +if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { print ''; print ''; } diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 8e9d72d40b4..3e8ef7ea411 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -132,10 +132,10 @@ if (($line->info_bits & 2) == 2) { } } } else { - $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE ? 'dayhour' : 'day'; + $format = (!empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE) ? 'dayhour' : 'day'); if ($line->fk_product > 0) { - print $form->textwithtooltip($text, $description, 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); + print $form->textwithtooltip($text, $description, 3, 0, '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { $type = (!empty($line->product_type) ? $line->product_type : $line->fk_product_type); if ($type == 1) { @@ -146,7 +146,7 @@ if (($line->info_bits & 2) == 2) { if (!empty($line->label)) { $text .= ' '.$line->label.''; - print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, '', '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); + print $form->textwithtooltip($text, dol_htmlentitiesbr($line->description), 3, 0, '', $i, 0, (!empty($line->fk_parent_line) ?img_picto('', 'rightarrow') : '')); } else { if (!empty($line->fk_parent_line)) { print img_picto('', 'rightarrow'); @@ -179,7 +179,7 @@ if (($line->info_bits & 2) == 2) { } } else { if ($line->date_start || $line->date_end) { - print '
    '.get_date_range($line->date_start, $line->date_end, $format).'
    '; + print '
    '.get_date_range($line->date_start, $line->date_end, $format).'
    '; } //print get_date_range($line->date_start, $line->date_end, $format); } @@ -288,7 +288,7 @@ if (!empty($line->remise_percent) && $line->special_code != 3) { } // Fields for situation invoices -if ($this->situation_cycle_ref) { +if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $coldisplay++; print ''; @@ -353,7 +353,15 @@ if ($outputalsopricetotalwithtax) { $coldisplay++; } -if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { +if ($this->statut == 0 && !empty($object_rights->creer) && $action != 'selectlines') { + $situationinvoicelinewithparent = 0; + if ($line->fk_prev_id != null && in_array($object->element, array('facture', 'facturedet'))) { + if ($object->type == $object::TYPE_SITUATION) { // The constant TYPE_SITUATION exists only for object invoice + // Set constant to disallow editing during a situation cycle + $situationinvoicelinewithparent = 1; + } + } + print ''; // Output of last run - print ''; + print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $langs->transnoentitiesnoconv('Online')) . ' '. $fac->ref.'
    '; + print ''; + + print '
    '; + print ''; + } + } + } //var_dump($object); // Other attributes. Fields from hook formObjectOptions and Extrafields. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index 4906a4e05e3..8595da92652 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -309,7 +309,15 @@ if (!empty($withproject)) { print ""; print '"; print '
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
    '.price($totalarray['val'][$totalarray['pos'][$i]]).''.$langs->trans("Total").''; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index b5dc9b90be0..e668d1e6d58 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -180,7 +180,7 @@ if ($disablenofollow) { } ?> -" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" /> +" name="username" class="flat input-icon-user minwidth150" value="" tabindex="1" autofocus="autofocus" /> @@ -192,7 +192,7 @@ if ($disablenofollow) { } ?> -" name="password" class="flat input-icon-password minwidth150" type="password" value="" tabindex="2" autocomplete="global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE) ? 'off' : 'on'; ?>" /> +" name="password" class="flat input-icon-password minwidth150" value="" tabindex="2" autocomplete="global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE) ? 'off' : 'on'; ?>" /> global->MAIN_EASTER_EGG_COMMITSTRIP)) { - trans('ReductionShort'); ?> '.$langs->trans('Progress').'">% % %%%% - +
    '.$form->load_tva('tva_tx', $line->tva_tx.($line->vat_src_code ? (' ('.$line->vat_src_code.')') : ''), $seller, $buyer, 0, $line->info_bits, $line->product_type, false, 1).'%fk_prev_id != null) { + if ($situationinvoicelinewithparent) { print ' readonly'; } print '> info_bits & 2) != 2) { - // I comment this because it shows info even when not required + // I comment warning of stock because it shows the info even when it should not. // for example always visible on invoice but must be visible only if stock module on and stock decrease option is on invoice validation and status is not validated // must also not be output for most entities (proposal, intervention, ...) //if($line->qty > $line->stock) print img_picto($langs->trans("StockTooLow"),"warning", 'style="vertical-align: bottom;"')." "; print 'fk_prev_id != null) { + if ($situationinvoicelinewithparent) { // Do not allow editing during a situation cycle print ' readonly'; } print '>'; @@ -249,7 +257,7 @@ $coldisplay++; info_bits & 2) != 2) { print 'fk_prev_id != null) { + if ($situationinvoicelinewithparent) { print ' readonly'; } print '>%'; diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index b530f5215cc..e1f89b18937 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -105,7 +105,7 @@ if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''.$langs->trans('ReductionShort').''.$langs->trans('Progress').''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''.$line->situation_percent.'%'; $coldisplay++; if (($line->info_bits & 2) == 2 || !empty($disableedit)) { @@ -365,7 +373,7 @@ if ($this->statut == 0 && ($object_rights->creer) && $action != 'selectlines') { print ''; $coldisplay++; - if (($line->fk_prev_id == null) && empty($disableremove)) { //La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation + if (!$situationinvoicelinewithparent && empty($disableremove)) { // For situation invoice, deletion is not possible if there is a parent company. print 'id.'">'; print img_delete(); print ''; diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 3e2fb78bdb0..8964145b430 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -91,7 +91,7 @@ $(document).ready(function () { @@ -216,7 +216,7 @@ if (!empty($morelogincontent)) { -'; + print ''; if (!empty($obj->lastoutput)) { print dol_trunc(nl2br($obj->lastoutput), 50); } diff --git a/htdocs/datapolicy/class/actions_datapolicy.class.php b/htdocs/datapolicy/class/actions_datapolicy.class.php index cbcaceec743..e54086149fe 100644 --- a/htdocs/datapolicy/class/actions_datapolicy.class.php +++ b/htdocs/datapolicy/class/actions_datapolicy.class.php @@ -121,7 +121,7 @@ class ActionsDatapolicy if ($object->update($object->id, $user, 0)) { // On supprime les contacts associé - $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$object->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".((int) $object->id); $this->db->query($sql); setEventMessages($langs->trans('ANONYMISER_SUCCESS'), array()); @@ -196,7 +196,6 @@ class ActionsDatapolicy echo $object->phone_pro.';'; echo $object->phone_perso.';'; echo $object->phone_mobile.';'; - echo $object->jabberid.';'; echo dol_print_date($object->birth).';'; exit; } elseif ($parameters['currentcontext'] == 'contactcard' && $action == 'send_datapolicy') { diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 4855c9c1e49..a845b7aff95 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -249,7 +249,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; * View */ -llxHeader('', $langs->trans('Delivery'), 'Livraison'); +$title = $langs->trans('Delivery'); + +llxHeader('', $title, 'Livraison'); $form = new Form($db); $formfile = new FormFile($db); diff --git a/htdocs/don/admin/donation.php b/htdocs/don/admin/donation.php index 9fd6f176c7a..f14fae538ab 100644 --- a/htdocs/don/admin/donation.php +++ b/htdocs/don/admin/donation.php @@ -116,8 +116,10 @@ if ($action == 'set_DONATION_ACCOUNTINGACCOUNT') { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + $action = ''; // To avoid to execute next actions } else { setEventMessages($langs->trans("Error"), null, 'errors'); + $action = ''; // To avoid to execute next actions } } @@ -132,14 +134,15 @@ if ($action == 'set_DONATION_MESSAGE') { if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + $action = ''; // To avoid to execute next actions } else { setEventMessages($langs->trans("Error"), null, 'errors'); + $action = ''; // To avoid to execute next actions } } -/* - * Action - */ +// Other cases +$reg = array(); if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 0763ff9b7e5..1b3c72906b4 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -64,6 +64,7 @@ $result = restrictedArea($user, 'don', $id); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); +$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('doncard', 'globalcard')); @@ -118,6 +119,8 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) { } } + +// Action update object if ($action == 'update') { if (!empty($cancel)) { header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode($id)); @@ -170,6 +173,8 @@ if ($action == 'update') { } } + +// Action add/create object if ($action == 'add') { if (!empty($cancel)) { header("Location: index.php"); @@ -228,6 +233,8 @@ if ($action == 'add') { } } } + +// Action delete object if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights->don->supprimer) { $object->fetch($id); $result = $object->delete($user); @@ -239,6 +246,8 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights- setEventMessages($object->error, $object->errors, 'errors'); } } + +// Action validation if ($action == 'valid_promesse') { $object->fetch($id); if ($object->valid_promesse($id, $user->id) >= 0) { @@ -248,6 +257,8 @@ if ($action == 'valid_promesse') { setEventMessages($object->error, $object->errors, 'errors'); } } + +// Action cancel if ($action == 'set_cancel') { $object->fetch($id); if ($object->set_cancel($id) >= 0) { @@ -256,6 +267,8 @@ if ($action == 'set_cancel') { setEventMessages($object->error, $object->errors, 'errors'); } } + +// Action set paid if ($action == 'set_paid') { $object->fetch($id); if ($object->setPaid($id, $modepayment) >= 0) { @@ -268,6 +281,7 @@ if ($action == 'set_paid') { $object->setProject($projectid); } + // Actions to build doc include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -329,9 +343,11 @@ if ($action == 'builddoc') * View */ +$title = $langs->trans("Donation"); + $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden'; -llxHeader('', $langs->trans("Donation"), $help_url); +llxHeader('', $title, $help_url); $form = new Form($db); $formfile = new FormFile($db); diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index b960a2fdb8f..cfd9e8ccd8b 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -16,9 +16,9 @@ * along with this program. If not, see . */ - use Luracast\Restler\RestException; +use Luracast\Restler\RestException; - require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; +require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; /** * API class for donations @@ -33,7 +33,7 @@ class Donations extends DolibarrApi * @var array $FIELDS Mandatory fields, checked when create and update object */ public static $FIELDS = array( - 'socid' + 'amount' ); /** @@ -123,7 +123,7 @@ class Donations extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($thirdparty_ids) { - $sql .= " AND t.fk_soc = ".$thirdparty_ids." "; + $sql .= " AND t.fk_soc = ".((int) $thirdparty_ids)." "; } // Add sql filters @@ -199,7 +199,7 @@ class Donations extends DolibarrApi }*/ if ($this->don->create(DolibarrApiAccess::$user) < 0) { - throw new RestException(500, "Error creating order", array_merge(array($this->don->error), $this->don->errors)); + throw new RestException(500, "Error creating donation", array_merge(array($this->don->error), $this->don->errors)); } return $this->don->id; @@ -311,7 +311,7 @@ class Donations extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - $result = $this->don->valid(DolibarrApiAccess::$user, $idwarehouse, $notrigger); + $result = $this->don->valid_promesse($id, DolibarrApiAccess::$user->id, $notrigger); if ($result == 0) { throw new RestException(304, 'Error nothing done. May be object is already validated'); } @@ -364,7 +364,7 @@ class Donations extends DolibarrApi private function _validate($data) { $don = array(); - foreach (Orders::$FIELDS as $field) { + foreach (Donations::$FIELDS as $field) { if (!isset($data[$field])) { throw new RestException(400, $field." field missing"); } diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0376ade3f31..181b3fc0ca3 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -380,7 +380,7 @@ class Don extends CommonObject $sql .= ", phone"; $sql .= ", phone_mobile"; $sql .= ") VALUES ("; - $sql .= "'".$this->db->idate($now)."'"; + $sql .= "'".$this->db->idate($this->date ? $this->date : $now)."'"; $sql .= ", ".$conf->entity; $sql .= ", ".price2num($this->amount); $sql .= ", ".($this->modepaymentid ? $this->modepaymentid : "null"); @@ -476,8 +476,8 @@ class Don extends CommonObject $sql .= ",address='".$this->db->escape($this->address)."'"; $sql .= ",zip='".$this->db->escape($this->zip)."'"; $sql .= ",town='".$this->db->escape($this->town)."'"; - $sql .= ",fk_country = ".($this->country_id > 0 ? $this->country_id : '0'); - $sql .= ",public=".$this->public; + $sql .= ",fk_country = ".($this->country_id > 0 ? ((int) $this->country_id) : '0'); + $sql .= ",public=".((int) $this->public); $sql .= ",fk_projet=".($this->fk_project > 0 ? $this->fk_project : 'null'); $sql .= ",note_private=".(!empty($this->note_private) ? ("'".$this->db->escape($this->note_private)."'") : "NULL"); $sql .= ",note_public=".(!empty($this->note_public) ? ("'".$this->db->escape($this->note_public)."'") : "NULL"); @@ -486,8 +486,8 @@ class Don extends CommonObject $sql .= ",email='".$this->db->escape(trim($this->email))."'"; $sql .= ",phone='".$this->db->escape(trim($this->phone))."'"; $sql .= ",phone_mobile='".$this->db->escape(trim($this->phone_mobile))."'"; - $sql .= ",fk_statut=".$this->statut; - $sql .= " WHERE rowid = ".$this->id; + $sql .= ",fk_statut=".((int) $this->statut); + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::Update", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 82c3ddde7fa..b5775ce18ac 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -189,8 +189,8 @@ class PaymentDonation extends CommonObject $sql .= " fk_user_creat, fk_bank)"; $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->datepaid)."',"; - $sql .= " ".$totalamount.","; - $sql .= " ".$this->paymenttype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', "; + $sql .= " ".price2num($totalamount).","; + $sql .= " ".((int) $this->paymenttype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', "; $sql .= " ".($this->ext_payment_id ? "'".$this->db->escape($this->ext_payment_id)."'" : "null").", ".($this->ext_payment_site ? "'".$this->db->escape($this->ext_payment_site)."'" : "null").","; $sql .= " ".$user->id.", 0)"; diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 0bd4edbc77b..374306bc7b0 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -188,7 +188,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'don'; - $permission = $user->rights->don->creer; + $permissiontoadd = $user->rights->don->creer; $permtoedit = $user->rights->don->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 2e153d73b95..13f9b1d4a96 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -47,6 +47,8 @@ $socid = 0; if ($user->socid) { $socid = $user->socid; } +$hookmanager->initHooks(array('donnote')); + $result = restrictedArea($user, 'don', $id, ''); $object = new Don($db); @@ -58,7 +60,13 @@ $permissionnote = $user->rights->don->creer; // Used by the include of actions_s /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} if ($action == 'classin' && $user->rights->don->creer) { $object->fetch($id); diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 917e30edb50..23e6c0a46c0 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -42,8 +42,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -209,38 +208,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
    '; -//if (empty($socid)) -//{ - // Show filter box - print '
    '; - print ''; +// Show filter box +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
    '.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
    '.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
    '.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
    '.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
    '; - print ''; - print '

    '; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
    '; +print ''; +print '

    '; print '
    '; print ''; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 52897e84b1a..c2961794bbc 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -196,7 +196,7 @@ class EcmDirectory extends CommonObject $sql .= " '".$this->db->escape($conf->entity)."',"; $sql .= " '".$this->db->escape($this->fk_parent)."',"; $sql .= " '".$this->db->escape($this->description)."',"; - $sql .= " ".$this->cachenbofdoc.","; + $sql .= " ".((int) $this->cachenbofdoc).","; $sql .= " '".$this->db->idate($this->date_c)."',"; $sql .= " '".$this->db->escape($this->fk_user_c)."'"; $sql .= ")"; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index b292dd33429..035a7aee9c6 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -425,7 +425,7 @@ class EcmFiles extends CommonObject //$sql .= " AND t.entity = ".$conf->entity; // hashforshare already unique } elseif ($src_object_type && $src_object_id) { // Warning: May return several record, and only first one is returned ! - $sql .= " AND t.src_object_type ='".$this->db->escape($src_object_type)."' AND t.src_object_id = ".$this->db->escape($src_object_id); + $sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id); $sql .= " AND t.entity = ".$conf->entity; } else { $sql .= ' AND t.rowid = '.((int) $id); // rowid already unique diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4cf557acde6..1416983e3a3 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -188,7 +188,7 @@ if ($action == 'add' && $permtoadd) { exit; } } -} elseif ($action == 'confirm_deletesection' && $confirm == 'yes') { +} elseif ($action == 'confirm_deletesection' && $confirm == 'yes' && $permtoadd) { // Deleting file $result = $ecmdir->delete($user); setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs'); diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 4c93e005266..d84a7330e69 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -88,17 +88,23 @@ if ($module == 'ecm') { } // Permissions +$permtoread = 0; $permtoadd = 0; $permtoupload = 0; if ($module == 'ecm') { + $permtoread = $user->rights->ecm->read; $permtoadd = $user->rights->ecm->setup; $permtoupload = $user->rights->ecm->upload; } if ($module == 'medias') { + $permtoread = ($user->rights->mailing->lire || $user->rights->website->read); $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); } +if (!$permtoread) { + accessforbidden(); +} /* @@ -106,7 +112,7 @@ if ($module == 'medias') { */ // Upload file -if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { +if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC) && $permtoupload) { if (dol_mkdir($upload_dir) >= 0) { $resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir."/".dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']); if (is_numeric($resupload) && $resupload > 0) { @@ -131,7 +137,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { } // Remove file -if ($action == 'confirm_deletefile' && $confirm == 'yes') { +if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permtoupload) { $langs->load("other"); $file = $upload_dir."/".GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret = dol_delete_file($file); @@ -145,7 +151,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { } // Remove dir -if ($action == 'confirm_deletedir' && $confirm == 'yes') { +if ($action == 'confirm_deletedir' && $confirm == 'yes' && $permtoupload) { $backtourl = DOL_URL_ROOT."/ecm/index.php"; if ($module == 'medias') { $backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1"; @@ -181,7 +187,7 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes') { } // Update dirname or description -if ($action == 'update' && !GETPOST('cancel', 'alpha')) { +if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permtoadd) { $error = 0; if ($module == 'ecm') { diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 93885c2843a..5ca1667ac9f 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -36,10 +36,6 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -if (!$user->rights->ecm->setup) { - accessforbidden(); -} - // Get parameters $socid = GETPOST("socid", "int"); @@ -105,6 +101,14 @@ if ($result < 0) { exit; } +// Permissions +$permtoread = $user->rights->ecm->read; +$permtoadd = $user->rights->ecm->setup; +$permtoupload = $user->rights->ecm->upload; + +if (!$permtoread) { + accessforbidden(); +} /* @@ -123,7 +127,7 @@ if ($cancel) { } // Rename file -if ($action == 'update') { +if ($action == 'update' && $permtoadd) { $error = 0; $oldlabel = GETPOST('urlfile', 'alpha'); @@ -201,7 +205,7 @@ if ($action == 'update') { $object->fullpath_orig = ''; $object->gen_or_uploaded = 'unknown'; $object->description = ''; // indexed content - $object->keyword = ''; // keyword content + $object->keywords = ''; // keyword content $result = $object->create($user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'warnings'); diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php index d2f3f7b4792..505e432f982 100644 --- a/htdocs/ecm/file_note.php +++ b/htdocs/ecm/file_note.php @@ -22,7 +22,7 @@ /** * \file htdocs/ecm/file_note.php * \ingroup ecm - * \brief Fiche de notes sur une ecm file + * \brief Tab for notes on an ECM file */ require '../main.inc.php'; @@ -39,10 +39,6 @@ $ref = GETPOST('ref', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); -if (!$user->rights->ecm->setup) { - accessforbidden(); -} - // Get parameters $socid = GETPOST("socid", "int"); // Security check @@ -109,6 +105,13 @@ if ($result < 0) { $permissionnote = $user->rights->ecm->setup; // Used by the include of actions_setnotes.inc.php +$permtoread = $user->rights->ecm->read; + +if (!$permtoread) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 26bf242b0f2..3a8d33343c7 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -34,12 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; // Load translation files required by the page $langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts")); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'ecm', 0); - // Get parameters $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'aZ09'); @@ -81,6 +75,12 @@ $userstatic = new User($db); $error = 0; +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'ecm', 0); + /* * Actions diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index bcfff8aa2da..d54dcf14d1e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -440,15 +440,13 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act continue; // If condition to show is ok } - $var = false; - print '"; print '
    '.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print "
    '; @@ -496,6 +504,41 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $keyforbreak='pubregister'; include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; + $object->fetchObjectLinked(); + + + if (is_array($object->linkedObjects) && count($object->linkedObjects)>0 && array_key_exists("facture", $object->linkedObjects)) { + foreach ($object->linkedObjects["facture"] as $fac) { + /** + * @var $fac Facture + */ + if (empty($fac->paye)) { + $key = 'paymentlink_'.$fac->id; + print '
    '; + $sourcetouse = 'boothlocation'; + $reftouse = $fac->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$object->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + print ''; + print '
    '.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print "
    '; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index fc3673d618f..8b064c12b72 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -266,8 +266,15 @@ if (!empty($withproject)) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; - //TODO fill with ics + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print ""; print ''; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 3e480efca54..270c87fb15c 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -103,7 +103,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } @@ -173,7 +173,10 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' + && $massaction != 'presend_attendees' + && $massaction != 'confirm_presend' + && $massaction != 'confirm_presend_attendees') { $massaction = ''; } @@ -211,6 +214,7 @@ if (empty($reshook)) { $objectclass = 'ConferenceOrBooth'; $objectlabel = 'ConferenceOrBooth'; $uploaddir = $conf->eventorganization->dir_output; + include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -253,20 +257,6 @@ if ($projectid > 0) { llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; if ($projectid > 0) { // To verify role of users @@ -427,7 +417,15 @@ if ($projectid > 0) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print ""; @@ -447,6 +445,7 @@ if ($projectid > 0) { // -------------------------------------------------------------------- $sql = 'SELECT '; $sql .= $object->getFieldList('t'); + // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -586,12 +585,13 @@ $arrayofmassactions = array( //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), + 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("ConferenceOrBooth"), + 'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'presend_attendees', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); @@ -615,9 +615,11 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort $topicmail = "SendConferenceOrBoothRef"; $modelmail = "conferenceorbooth"; $objecttmp = new ConferenceOrBooth($db); -$trackid = 'xxxx'.$object->id; +$trackid = 'conferenceorbooth_'.$object->id; +include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + if ($search_all) { foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); @@ -791,6 +793,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 8a3767f0606..fe5ea292e8b 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -1,6 +1,5 @@ - * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -337,7 +336,15 @@ if (!empty($withproject)) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print ""; print ''; @@ -571,10 +578,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print '
    + print ' + '; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index e282da6a4d9..e8e86a2641a 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -112,7 +112,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -128,7 +128,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } @@ -234,7 +234,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".$confOrBooth->id; +$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".((int) $confOrBooth->id); if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } @@ -499,7 +499,15 @@ if ($confOrBooth->id > 0) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + + // Show message + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + print $message; print ""; print ''; @@ -788,6 +796,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 46620112311..fd72b1588e7 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -115,8 +115,13 @@ $permissiontoadd = $user->rights->eventorganization->conferenceorboothattendee-> * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* * View diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php new file mode 100644 index 00000000000..483a1e5bc84 --- /dev/null +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -0,0 +1,315 @@ + + * Copyright (C) 2018-2021 Nicolas ZABOURI + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2019 Ferran Marcet + * Copyright (C) 2019-2021 Frédéric France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +/** + * \file htdocs/core/actions_massactions.inc.php + * \brief Code for actions done with massaction button (send by email, merge pdf, delete, ...) + */ + + +// $massaction must be defined +// $objectclass and $objectlabel must be defined +// $parameters, $object, $action must be defined for the hook. + +// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined +// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $toselect may be defined +// $diroutputmassaction may be defined + + +// Protection +if (empty($objectclass) || empty($uploaddir)) { + dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined'); + exit; +} + +// For backward compatibility +if (!empty($permtoread) && empty($permissiontoread)) { + $permissiontoread = $permtoread; +} +if (!empty($permtocreate) && empty($permissiontoadd)) { + $permissiontoadd = $permtocreate; +} +if (!empty($permtodelete) && empty($permissiontodelete)) { + $permissiontodelete = $permtodelete; +} + + +// Mass actions. Controls on number of lines checked. +$maxformassaction = (empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS) ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); +if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) { + $error++; + setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); +} +if (!$error && is_array($toselect) && count($toselect) > $maxformassaction) { + setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors'); + $error++; +} + +if (!$error && $massaction == 'confirm_presend_attendees' && !GETPOST('sendmail')) { // If we do not choose button send (for example when we change template or limit), we must not send email, but keep on send email form + $massaction = 'presend_attendees'; +} +if (!$error && $massaction == 'confirm_presend_attendees') { + $resaction = ''; + $nbsent = 0; + $nbignored = 0; + $langs->load("mails"); + include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + + $listofobjectid = array(); + + $listofobjectref = array(); + $oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0); + + if (!$error) { + require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php'; + $attendee = new ConferenceOrBoothAttendee($db); + $listofselectedid = array(); + $listofselectedref = array(); + $objecttmp = new $objectclass($db); + + foreach ($toselect as $toselectid) { + $result = $objecttmp->fetch($toselectid); + if ($result > 0) { + $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm' => $objecttmp->id)); + if (is_array($attendees) && count($attendees) > 0) { + foreach ($attendees as $attmail) { + if (!empty($attmail->email)) { + $attmail->fetch_thirdparty(); + $listofselectedid[$attmail->email] = $attmail; + $listofselectedref[$attmail->email] = $objecttmp; + } + } + } + } + } + } + + // Check mandatory parameters + if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) { + $error++; + setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); + $massaction = 'presend_attendees'; + } + + $receiver = $_POST['receiver']; + if (!is_array($receiver)) { + if (empty($receiver) || $receiver == '-1') { + $receiver = array(); + } else { + $receiver = array($receiver); + } + } + if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 1) { // if only one recipient, receiver is mandatory + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings'); + $massaction = 'presend_attendees'; + } + + if (!GETPOST('subject', 'restricthtml')) { + $error++; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings'); + $massaction = 'presend_attendees'; + } + + if (!$error) { + $objecttmp->fetch_thirdparty(); + foreach ($listofselectedid as $email => $attendees) { + $sendto = ''; + $sendtocc = ''; + $sendtobcc = ''; + $sendtoid = array(); + + // Define $sendto + $sendto = $attendees->thirdparty->name . '<' . trim($attendees->email) . '>'; + + // Define $sendtocc + $receivercc = $_POST['receivercc']; + if (!is_array($receivercc)) { + if ($receivercc == '-1') { + $receivercc = array(); + } else { + $receivercc = array($receivercc); + } + } + $tmparray = array(); + if (trim($_POST['sendtocc'])) { + $tmparray[] = trim($_POST['sendtocc']); + } + $sendtocc = implode(',', $tmparray); + + + $langs->load("commercial"); + + $reg = array(); + $fromtype = GETPOST('fromtype'); + if ($fromtype === 'user') { + $from = $user->getFullName($langs) . ' <' . $user->email . '>'; + } elseif ($fromtype === 'company') { + $from = $conf->global->MAIN_INFO_SOCIETE_NOM . ' <' . $conf->global->MAIN_INFO_SOCIETE_MAIL . '>'; + } elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) { + $tmp = explode(',', $user->email_aliases); + $from = trim($tmp[($reg[1] - 1)]); + } elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) { + $tmp = explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES); + $from = trim($tmp[($reg[1] - 1)]); + } elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) { + $sql = 'SELECT rowid, label, email FROM ' . MAIN_DB_PREFIX . 'c_email_senderprofile WHERE rowid = ' . (int) $reg[1]; + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + if ($obj) { + $from = $obj->label . ' <' . $obj->email . '>'; + } + } else { + $from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>'; + } + + $replyto = $from; + $subject = GETPOST('subject', 'restricthtml'); + $message = GETPOST('message', 'restricthtml'); + + $sendtobcc = GETPOST('sendtoccc'); + + // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object + // Make substitution in email content + $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $attendees); + + if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { + $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT; + $url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : ""); + $url_link .= '&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED; + $html_link = '' . $langs->trans('DownloadICSLink') . ''; + } + $substitutionarray['__EVENTORGANIZATION_ICS_LINK__'] = $html_link; + $substitutionarray['__EVENTORGANIZATION_URL_LINK__'] = $url_link; + $substitutionarray['__CHECK_READ__'] = ''; + + $parameters = array('mode' => 'formemail'); + + if (!empty($listofobjectref)) { + $parameters['listofobjectref'] = $listofobjectref; + } + + complete_substitutions_array($substitutionarray, $langs, $attendees, $parameters); + + $subjectreplaced = make_substitutions($subject, $substitutionarray); + $messagereplaced = make_substitutions($message, $substitutionarray); + + + if (empty($sendcontext)) { + $sendcontext = 'standard'; + } + + // Send mail (substitutionarray must be done just before this) + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + $mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, array(), array(), array(), $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', "attendees_".$attendees->id, '', $sendcontext); + if ($mailfile->error) { + $resaction .= '
    ' . $mailfile->error . '
    '; + } else { + $result = $mailfile->sendfile(); + if ($result) { + $resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)) . '
    '; // Must not contain " + $error = 0; + + dol_syslog("Try to insert email event into agenda for objid=" . $attendees->id . " => objectobj=" . get_class($attendees)); + + $actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto; + if ($message) { + if ($sendtocc) { + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc); + } + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced); + $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":"); + $actionmsg = dol_concatdesc($actionmsg, $messagereplaced); + } + $actionmsg2 = ''; + + $objectobj2 = $listofselectedref[$email]; + // Initialisation donnees + $objectobj2->actionmsg = $actionmsg; // Long text + $objectobj2->actionmsg2 = $actionmsg2; // Short text + $objectobj2->fk_element = $objectobj2->id; + $objectobj2->elementtype = $objectobj2->element; + + $triggername = 'CONFERENCEORBOOTHATTENDEE_SENTBYMAIL'; + if (!empty($triggername)) { + // Call trigger + $result = $objectobj2->call_trigger($triggername, $user); + if ($result < 0) { + $error++; + } + // End call triggers + + if ($error) { + setEventMessages($db->lasterror(), $objectobj2->errors, 'errors'); + dol_syslog("Error in trigger " . $triggername . ' ' . $db->lasterror(), LOG_ERR); + } + } + + $nbsent++; // Nb of object sent + } else { + $langs->load("other"); + if ($mailfile->error) { + $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto); + $resaction .= '
    ' . $mailfile->error . '
    '; + } elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { + $resaction .= '
    No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS
    '; + } else { + $resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '
    (unhandled error)
    '; + } + } + } + } + } + $resaction .= ($resaction ? '
    ' : $resaction); + $resaction .= '' . $langs->trans("ResultOfMailSending") . ':
    ' . "\n"; + $resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n
    "; + $resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n
    "; + $resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n
    "; + + if ($nbsent) { + $action = ''; // Do not show form post if there was at least one successfull sent + //setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs'); + setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs'); + setEventMessages($resaction, null, 'mesgs'); + } else { + //setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file + setEventMessages($resaction, null, 'warnings'); + } + + $action = 'list'; + $massaction = ''; +} + + + +$parameters['toselect'] = $toselect; +$parameters['uploaddir'] = $uploaddir; +$parameters['massaction'] = $massaction; +$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null; + +$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} diff --git a/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php new file mode 100644 index 00000000000..f2bb6f0c3ae --- /dev/null +++ b/htdocs/eventorganization/tpl/linkedobjectblock.tpl.php @@ -0,0 +1,61 @@ + + * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2014 Marcos García + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// Protection to avoid direct call of template +if (empty($conf) || !is_object($conf)) { + print "Error, template page can't be called as URL"; + exit; +} + +echo "\n"; + +global $user; + +$langs = $GLOBALS['langs']; +$linkedObjectBlock = $GLOBALS['linkedObjectBlock']; +$langs->load("eventorganization"); + +$total = 0; +foreach ($linkedObjectBlock as $key => $objectlink) { + echo ''; + echo '' . $langs->trans(get_class($objectlink)) . ''; + echo ''.$objectlink->getNomUrl(1).''; + echo ''; + if (get_class($objectlink)=='ConferenceOrBooth') { + print dol_trunc($objectlink->label, 20); + } + print ''; + echo ''; + if (get_class($objectlink)=='ConferenceOrBoothAttendee') { + print dol_print_date($objectlink->date_subscription); + } else { + print dol_print_date($objectlink->datep); + } + print ''; + echo ''; + if (get_class($objectlink)=='ConferenceOrBoothAttendee') { + print price($objectlink->amount); + } + print ''; + echo ''.$objectlink->getLibStatut(3).''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''; +} + +echo "\n"; diff --git a/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php new file mode 100644 index 00000000000..17c78babfea --- /dev/null +++ b/htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php @@ -0,0 +1,130 @@ + + * Copyright (C) 2013-2014 Laurent Destailleur + * Copyright (C) 2015 Marcos García + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see https://www.gnu.org/ + */ + +// Following var must be set: +// $arrayofselected = array of id selected +// $object +// $objecttmp=new Propal($db); +// $topicmail="SendSupplierProposalRef"; +// $modelmail="supplier_proposal_send"; +// $trackid='ord'.$object->id; + +if ($massaction == 'presend_attendees') { + $langs->load("mails"); + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; + $attendee = new ConferenceOrBoothAttendee($db); + $listofselectedid = array(); + $listofselectedref = array(); + + if (!GETPOST('cancel', 'alpha')) { + foreach ($arrayofselected as $toselectid) { + $result = $objecttmp->fetch($toselectid); + if ($result > 0) { + $attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$objecttmp->id)); + if (is_array($attendees) && count($attendees)>0) { + foreach ($attendees as $attmail) { + if (!empty($attmail->email)) { + $listofselectedid[$attmail->email] = $attmail->id; + $listofselectedref[$attmail->id][$toselectid] = $objecttmp->ref; + } + } + } + } + } + } + + print ''; + print ''; + + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + print dol_get_fiche_head(null, '', ''); + + // Cree l'objet formulaire mail + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $formmail->withform = -1; + $formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user')); + + if ($formmail->fromtype === 'user') { + $formmail->fromid = $user->id; + } + $formmail->trackid = $trackid; + if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set + include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid); + } + $formmail->withfrom = 1; + $liste = $langs->trans("AllRecipientSelected", count($listofselectedid)); + $formmail->withtoreadonly = 1; + + $formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1); + + $formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste; + $formmail->withtofree = empty($liste) ? 1 : 0; + $formmail->withtocc = 1; + $formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC; + $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__'); + $formmail->withfile = 0; + // $formmail->withfile = 2; Not yet supported in mass action + $formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document" + $formmail->withbody = 1; + $formmail->withdeliveryreceipt = 1; + $formmail->withcancel = 1; + + // Make substitution in email content + $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object); + + $substitutionarray['__EMAIL__'] = $sendto; + $substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '' : ''; + $substitutionarray['__PERSONALIZED__'] = ''; // deprecated + $substitutionarray['__CONTACTCIVNAME__'] = ''; + + $parameters = array( + 'mode' => 'formemail' + ); + complete_substitutions_array($substitutionarray, $langs, $object, $parameters); + + // Tableau des substitutions + $formmail->substit = $substitutionarray; + + // Tableau des parametres complementaires du post + $formmail->param['action'] = $action; + $formmail->param['models'] = $modelmail; + $formmail->param['models_id'] = empty(GETPOST('modelmailselected', 'int'))?$conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES:GETPOST('modelmailselected', 'int'); + $formmail->param['id'] = join(',', $arrayofselected); + // $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id; + if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedid) > $conf->global->MAILING_LIMIT_SENDBYWEB) { + $langs->load("errors"); + print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB); + print ' - '.$langs->trans("GoBack").''; + $arrayofmassactions = array(); + } else { + print $formmail->get_form(); + } + + print dol_get_fiche_end(); +} +// Allow Pre-Mass-Action hook (eg for confirmation dialog) +$parameters = array( + 'toselect' => $toselect, + 'uploaddir' => isset($uploaddir) ? $uploaddir : null +); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index cc441d9f50f..582b23aec45 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1020,6 +1020,9 @@ if ($action == 'create') { // Load shipments already done for same order $object->loadExpeditions(); + + $alreadyQtyBatchSetted = $alreadyQtySetted = array(); + if ($numAsked) { print ''; print ''.$langs->trans("Description").''; @@ -1044,6 +1047,15 @@ if ($action == 'create') { print "\n"; } + $warehouse_id = GETPOST('entrepot_id', 'int'); + $warehousePicking = array(); + // get all warehouse children for picking + if ($warehouse_id > 0) { + $warehousePicking[] = $warehouse_id; + $warehouseObj = new Entrepot($db); + $warehouseObj->get_children_warehouses($warehouse_id, $warehousePicking); + } + $indiceAsked = 0; while ($indiceAsked < $numAsked) { $product = new Product($db); @@ -1142,10 +1154,9 @@ if ($action == 'create') { } else { $quantityToBeDelivered = $quantityAsked - $quantityDelivered; } - $warehouse_id = GETPOST('entrepot_id', 'int'); $warehouseObject = null; - if ($warehouse_id > 0 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection + if (count($warehousePicking) == 1 || !($line->fk_product > 0) || empty($conf->stock->enabled)) { // If warehouse was already selected or if product is not a predefined, we go into this part with no multiwarehouse selection print ''; //ship from preselected location $stock = + $product->stock_warehouse[$warehouse_id]->real; // Convert to number @@ -1293,6 +1304,7 @@ if ($action == 'create') { $subj = 0; // Define nb of lines suggested for this order line $nbofsuggested = 0; + foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if ($stock_warehouse->real > 0) { $nbofsuggested++; @@ -1300,6 +1312,11 @@ if ($action == 'create') { } $tmpwarehouseObject = new Entrepot($db); foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { // $stock_warehouse is product_stock + if (!empty($warehousePicking) && !in_array($warehouse_id, $warehousePicking)) { + // if a warehouse was selected by user, picking is limited to this warehouse and his children + continue; + } + $tmpwarehouseObject->fetch($warehouse_id); if ($stock_warehouse->real > 0) { $stock = + $stock_warehouse->real; // Convert it to number @@ -1309,7 +1326,31 @@ if ($action == 'create') { print ''; print ''; if ($line->product_type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print ''; + if (isset($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { + $deliverableQty = min($quantityToBeDelivered, $stock - $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]); + } else { + if (!isset($alreadyQtySetted[$line->fk_product])) { + $alreadyQtySetted[$line->fk_product] = array(); + } + + $deliverableQty = min($quantityToBeDelivered, $stock); + } + + if ($deliverableQty < 0) $deliverableQty = 0; + + $tooltip = ''; + if (!empty($alreadyQtySetted[$line->fk_product][intval($warehouse_id)])) { + $tooltip = ' class="classfortooltip" title="'.$langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtySetted[$line->fk_product][intval($warehouse_id)].'" '; + } + + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)] = $deliverableQty + $alreadyQtySetted[$line->fk_product][intval($warehouse_id)]; + + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; + if (GETPOSTISSET($inputName)) { + $deliverableQty = GETPOST($inputName, 'int'); + } + + print ''; print ''; } else { print $langs->trans("NA"); @@ -1366,27 +1407,50 @@ if ($action == 'create') { $tmpwarehouseObject = new Entrepot($db); $productlotObject = new Productlot($db); + // Define nb of lines suggested for this order line $nbofsuggested = 0; foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { - foreach ($stock_warehouse->detail_batch as $dbatch) { - $nbofsuggested++; - } + $nbofsuggested+=count($stock_warehouse->detail_batch); } } + foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) { $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { - //var_dump($dbatch); $batchStock = + $dbatch->qty; // To get a numeric - $deliverableQty = min($quantityToBeDelivered, $batchStock); - if ($deliverableQty < 0) { - $deliverableQty = 0; + if (isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { + $deliverableQty = min($quantityToBeDelivered, $batchStock - $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]); + } else { + if (!isset($alreadyQtyBatchSetted[$line->fk_product])) { + $alreadyQtyBatchSetted[$line->fk_product] = array(); + } + + if (!isset($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch])) { + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch] = array(); + } + + $deliverableQty = min($quantityToBeDelivered, $batchStock); } + + if ($deliverableQty < 0) $deliverableQty = 0; + + $inputName = 'qtyl'.$indiceAsked.'_'.$subj; + if (GETPOSTISSET($inputName)) { + $deliverableQty = GETPOST($inputName, 'int'); + } + + $tooltipClass = $tooltipTitle = ''; + if (!empty($alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)])) { + $tooltipClass = ' classfortooltip'; + $tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; + } + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)]; + print ''; - print ''; + print ''; print ''; print ''; @@ -1982,7 +2046,7 @@ if ($action == 'create') { //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; - $sql .= " AND obj.fk_".$origin." = ".$origin_id; + $sql .= " AND obj.fk_".$origin." = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_origin_line"; $sql .= " AND ed.fk_expedition = e.rowid"; //if ($filter) $sql.= $filter; @@ -2138,7 +2202,8 @@ if ($action == 'create') { // only show lot numbers from src warehouse when shipping from multiple warehouses $line->fetch($detail_batch->fk_expeditiondet); } - print ''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id).''; + $entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id; + print ''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).''; print ''; } // add a 0 qty lot row to be able to add a lot diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index dcd619da76e..eaf66e59125 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -140,7 +140,7 @@ class Shipments extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { @@ -530,14 +530,9 @@ class Shipments extends DolibarrApi if ($result < 0) { throw new RestException(500, 'Error when validating Shipment: '.$this->shipment->error); } - $result = $this->shipment->fetch($id); - if (!$result) { - throw new RestException(404, 'Shipment not found'); - } - if (!DolibarrApi::_checkAccessToResource('expedition', $this->shipment->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } + // Reload shipment + $result = $this->shipment->fetch($id); $this->shipment->fetchObjectLinked(); return $this->_cleanObjectDatas($this->shipment); @@ -626,6 +621,47 @@ class Shipments extends DolibarrApi } */ + /** + * Close a shipment (Classify it as "Delivered") + * + * @param int $id Expedition ID + * @param int $notrigger Disabled triggers + * + * @url POST {id}/close + * + * @return int + */ + public function close($id, $notrigger = 0) + { + if (!DolibarrApiAccess::$user->rights->expedition->creer) { + throw new RestException(401); + } + + $result = $this->shipment->fetch($id); + if (!$result) { + throw new RestException(404, 'Shipment not found'); + } + + if (!DolibarrApi::_checkAccessToResource('expedition', $this->commande->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + $result = $this->shipment->setClosed(); + if ($result == 0) { + throw new RestException(304, 'Error nothing done. May be object is already closed'); + } + if ($result < 0) { + throw new RestException(500, 'Error when closing Order: '.$this->commande->error); + } + + // Reload shipment + $result = $this->shipment->fetch($id); + + $this->shipment->fetchObjectLinked(); + + return $this->_cleanObjectDatas($this->shipment); + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index f7c5a1d32a8..ee7324a22c4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -468,11 +468,11 @@ class Expedition extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Create the detail (eat-by date) of the expedition line + * Create the detail of the expedition line. Create 1 record into expeditiondet for each warehouse and n record for each lot in this warehouse into expeditiondet_batch. * - * @param object $line_ext full line informations + * @param object $line_ext Objet with full information of line. $line_ext->detail_batch must be an array of ExpeditionLineBatch * @param array $array_options extrafields array - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ public function create_line_batch($line_ext, $array_options = 0) { @@ -496,7 +496,7 @@ class Expedition extends CommonObject // create shipment batch lines for stockLocation foreach ($tab as $detbatch) { if ($detbatch->entrepot_id == $stockLocation) { - if (!($detbatch->create($line_id) > 0)) { // Create an expeditionlinebatch + if (!($detbatch->create($line_id) > 0)) { // Create an ExpeditionLineBatch $error++; } } @@ -2125,7 +2125,7 @@ class Expedition extends CommonObject if (!empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; $sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as em"; - $sql .= " WHERE em.rowid = ".$this->shipping_method_id; + $sql .= " WHERE em.rowid = ".((int) $this->shipping_method_id); $resql = $this->db->query($sql); if ($resql) { @@ -2981,8 +2981,8 @@ class ExpeditionLigne extends CommonObjectLine // update line $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql .= " fk_entrepot = ".($this->entrepot_id > 0 ? $this->entrepot_id : 'null'); - $sql .= " , qty = ".$qty; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " , qty = ".((float) price2num($qty, 'MS')); + $sql .= " WHERE rowid = ".((int) $this->id); if (!$this->db->query($sql)) { $this->errors[] = $this->db->lasterror()." - sql=$sql"; diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 736cfba6e42..03066869450 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -186,7 +186,7 @@ class ExpeditionLineBatch extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as eb"; if ($fk_product > 0) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.batch = eb.batch AND pl.fk_product = ".$fk_product; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.batch = eb.batch AND pl.fk_product = ".((int) $fk_product); } $sql .= " WHERE fk_expeditiondet=".(int) $id_line_expdet; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index c392187d607..200a4b67aac 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -177,7 +177,7 @@ if ($id > 0 || !empty($ref)) { print dol_get_fiche_end(); $modulepart = 'expedition'; - $permission = $user->rights->expedition->creer; + $permissiontoadd = $user->rights->expedition->creer; $permtoedit = $user->rights->expedition->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index a1070d02ef1..5a110d33f2a 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -282,7 +282,7 @@ if ($search_user > 0) { } $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } if ($socid > 0) { $sql .= ' AND s.rowid = '.$socid; @@ -292,7 +292,7 @@ if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no $sql .= " AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($search_status <> '' && $search_status >= 0) { $sql .= " AND e.fk_statut = ".((int) $search_status); @@ -322,7 +322,7 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) { $sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')'; } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { // The contact on a shipment is also the contact of the order. @@ -353,7 +353,7 @@ if ($sall) { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } if ($search_categ_cus > 0) { - $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus); + $sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus); } if ($search_categ_cus == -2) { $sql .= " AND cc.fk_categorie IS NULL"; diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index a9076162015..d9282481603 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -69,6 +69,8 @@ $permissionnote = $user->rights->expedition->creer; // Used by the include of ac if ($user->socid) { $socid = $user->socid; } + +$hookmanager->initHooks(array('expeditionnote')); $result = restrictedArea($user, 'expedition', $object->id, ''); @@ -76,7 +78,13 @@ $result = restrictedArea($user, 'expedition', $object->id, ''); * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 8f5903dd988..42b8630bd3c 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -626,7 +626,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' p.surface, p.surface_units, p.volume, p.volume_units'; $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; - $sql .= " WHERE cd.fk_commande = ".$object->id; + $sql .= " WHERE cd.fk_commande = ".((int) $object->id); $sql .= " ORDER BY cd.rang, cd.rowid"; //print $sql; diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 6bdc495472c..42cac2d3c92 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -41,8 +41,7 @@ if ($user->socid > 0) { $nowyear = dol_print_date(dol_now(), "%Y"); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -214,38 +213,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
    '; -//if (empty($socid)) -//{ - // Show filter box - print ''; - print ''; +// Show filter box +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
    '.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
    '.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
    '.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
    '.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
    '; - print ''; - print '

    '; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
    '; +print ''; +print '

    '; print '
    '; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index cb6dcfc94b8..048209fbf7d 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -159,7 +159,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; - if (GETPOSTISSET('sendit')) { // If we just submit a file + if (!empty(GETPOST('sendit', 'alpha'))) { // If we just submit a file if ($action == 'updateline') { $action = 'editline'; // To avoid to make the updateline now } else { @@ -1084,7 +1084,7 @@ if (empty($reshook)) { $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int'); - $qty = GETPOST('qty', 'int'); + $qty = price2num(GETPOST('qty', 'alpha')); if (empty($qty)) { $qty = 1; } @@ -1101,21 +1101,21 @@ if (empty($reshook)) { $action = ''; } - // Si aucune date n'est rentrée + // If no date entered if (empty($date) || $date == "--") { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); + } elseif ($date < $object->date_debut || $date > ($object->date_fin + (24 * 3600 - 1))) { + // Warning if date out of range + $langs->load("errors"); + setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings'); } - // Si aucun prix n'est rentré + + // If no price entered if ($value_unit == 0) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PriceUTTC")), null, 'errors'); } - // Warning if date out of range - if ($date < $object->date_debut || $date > ($object->date_fin + (24 * 3600 - 1))) { - $langs->load("errors"); - setEventMessages($langs->trans("WarningDateOfLineMustBeInExpenseReportRange"), null, 'warnings'); - } if (!$error) { $type = 0; // TODO What if service ? We should take the type product/service from the type of expense report llx_c_type_fees @@ -1215,12 +1215,12 @@ if (empty($reshook)) { } } - $rowid = $_POST['rowid']; + $rowid = GETPOST('rowid', 'int'); $type_fees_id = GETPOST('fk_c_type_fees', 'int'); $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int'); $projet_id = $fk_project; $comments = GETPOST('comments', 'restricthtml'); - $qty = GETPOST('qty', 'int'); + $qty = price2num(GETPOST('qty', 'alpha')); $vatrate = GETPOST('vatrate', 'alpha'); // if VAT is not used in Dolibarr, set VAT rate to 0 because VAT rate is necessary. @@ -1438,16 +1438,15 @@ if ($action == 'create') { print '
    '; print ''; -} else { - if ($id > 0 || $ref) { - $result = $object->fetch($id, $ref); +} elseif ($id > 0 || $ref) { + $result = $object->fetch($id, $ref); - $res = $object->fetch_optionals(); + $res = $object->fetch_optionals(); - if ($result > 0) { - if (!in_array($object->fk_user_author, $user->getAllChildIds(1))) { - if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) - && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance))) { + if ($result > 0) { + if (!in_array($object->fk_user_author, $user->getAllChildIds(1))) { + if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous) + && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance))) { print load_fiche_titre($langs->trans('TripCard'), '', 'trip'); print '
    '; @@ -1459,735 +1458,736 @@ if ($action == 'create') { $db->close(); exit; - } + } + } + + $head = expensereport_prepare_head($object); + + if ($action == 'edit' && ($object->status < 3 || $object->status == 99)) { + print "
    \n"; + print ''; + print ''; + + print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); + + if ($object->status == 99) { + print ''; + } else { + print ''; } - $head = expensereport_prepare_head($object); + $linkback = ''.$langs->trans("BackToList").''; - if ($action == 'edit' && ($object->status < 3 || $object->status == 99)) { - print "\n"; - print ''; - print ''; + print ''; - print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); + print ''; + print ''; + print ''; - if ($object->status == 99) { - print ''; - } else { - print ''; - } + // Ref + print ''; - $linkback = ''.$langs->trans("BackToList").''; - - print '
    '.$langs->trans("User").''; + $userfee = new User($db); + if ($object->fk_user_author > 0) { + $userfee->fetch($object->fk_user_author); + print $userfee->getNomUrl(-1); + } + print '
    '.$langs->trans("Ref").''; + print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + print '
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { print ''; - print ''; + print ''; + print ''; + print ''; + } + + if ($object->status < 3) { + print ''; + print ''; // Approbator + print ''; + print ''; + } else { + print ''; + print ''; print ''; + } - // Ref - print ''; + print ''; + print ''; + } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + // Other attributes + //$cols = 3; + //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; - if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { - print ''; - print ''; - print ''; - print ''; + print '
    '.$langs->trans("DateStart").''; + print $form->selectDate($object->date_debut, 'date_debut'); + print '
    '.$langs->trans("DateEnd").''; + print $form->selectDate($object->date_fin, 'date_fin'); + print '
    '.$langs->trans("User").''.$langs->trans("ModePaiement").''; + $form->select_types_paiements($object->fk_c_paiement, 'fk_c_paiement'); + print '
    '.$langs->trans("VALIDATOR").''; + $include_users = $object->fetch_users_approver_expensereport(); + $s = $form->select_dolusers($object->fk_user_validator, "fk_user_validator", 1, "", 0, $include_users); + print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); + print '
    '.$langs->trans("VALIDOR").''; $userfee = new User($db); - if ($object->fk_user_author > 0) { - $userfee->fetch($object->fk_user_author); - print $userfee->getNomUrl(-1); - } + $userfee->fetch($object->fk_user_valid); + print $userfee->getNomUrl(-1); print '
    '.$langs->trans("Ref").''; - print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); + if ($object->status == 6) { + print '
    '.$langs->trans("AUTHORPAIEMENT").''; + $userfee = new User($db); + $userfee->fetch($user->id); + print $userfee->getNomUrl(-1); print '
    '.$langs->trans("DateStart").''; - print $form->selectDate($object->date_debut, 'date_debut'); - print '
    '.$langs->trans("DateEnd").''; - print $form->selectDate($object->date_fin, 'date_fin'); - print '
    '.$langs->trans("ModePaiement").''; - $form->select_types_paiements($object->fk_c_paiement, 'fk_c_paiement'); - print '
    '; + + print dol_get_fiche_end(); + + print '
    '; + print ''; + print '     '; + print '
    '; + + print '
    '; + } else { + print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); + + // Clone confirmation + if ($action == 'clone') { + // Create an array for form + $criteriaforfilter = 'hierarchyme'; + if (!empty($user->rights->expensereport->readall)) { + $criteriaforfilter = ''; } + $formquestion = array( + 'text' => '', + array('type' => 'other', 'name' => 'fk_user_author', 'label' => $langs->trans("SelectTargetUser"), 'value' => $form->select_dolusers((GETPOST('fk_user_author', 'int') > 0 ? GETPOST('fk_user_author', 'int') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter, '', '0', 0, 0, '', 0, '', 'maxwidth150')) + ); + // Paiement incomplet. On demande si motif = escompte ou autre + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); + } - if ($object->status < 3) { - print ''; - print ''.$langs->trans("VALIDATOR").''; // Approbator - print ''; - $include_users = $object->fetch_users_approver_expensereport(); - $s = $form->select_dolusers($object->fk_user_validator, "fk_user_validator", 1, "", 0, $include_users); - print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); - print ''; - print ''; - } else { - print ''; - print ''.$langs->trans("VALIDOR").''; - print ''; + if ($action == 'save') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("SaveTrip"), $langs->trans("ConfirmSaveTrip"), "confirm_validate", "", "", 1); + } + + if ($action == 'save_from_refuse') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("SaveTrip"), $langs->trans("ConfirmSaveTrip"), "confirm_save_from_refuse", "", "", 1); + } + + if ($action == 'delete') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteTrip"), $langs->trans("ConfirmDeleteTrip"), "confirm_delete", "", "", 1); + } + + if ($action == 'validate') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("ValideTrip"), $langs->trans("ConfirmValideTrip"), "confirm_approve", "", "", 1); + } + + if ($action == 'paid') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("PaidTrip"), $langs->trans("ConfirmPaidTrip"), "confirm_paid", "", "", 1); + } + + if ($action == 'cancel') { + $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text", 'label'=>''.$langs->trans("Comment").'', 'name'=>"detail_cancel", 'value'=>"")); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1); + } + + if ($action == 'setdraft') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("BrouillonnerTrip"), $langs->trans("ConfirmBrouillonnerTrip"), "confirm_setdraft", "", "", 1); + } + + if ($action == 'refuse') { // Deny + $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text", 'label'=>$langs->trans("Comment"), 'name'=>"detail_refuse", 'value'=>"")); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Deny"), '', "confirm_refuse", $array_input, "yes", 1); + } + + if ($action == 'delete_line') { + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid', 'int'), $langs->trans("DeleteLine"), $langs->trans("ConfirmDeleteLine"), "confirm_delete_line", '', 'yes', 1); + } + + // Print form confirm + print $formconfirm; + + // Expense report card + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref = '
    '; + /* + // Ref customer + $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); + // Thirdparty + $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
    '.$langs->trans('Project') . ' '; + if ($user->rights->commande->creer) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
    '; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
    '; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + }*/ + $morehtmlref .= '
    '; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + print '
    '; + print '
    '; + + print ''; + + // Author + print ''; + print ''; + print ''; + + // Period + print ''; + print ''; + print ''; + print ''; + if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { + print ''; + print ''; + print ''; + print ''; + } + + // Validation date + print ''; + print ''; + print ''; + print ''; + + // User to inform for approval + if ($object->status <= ExpenseReport::STATUS_VALIDATED) { // informed + print ''; + print ''; // approver + print ''; - } - - if ($object->status == 6) { - print ''; - print ''; - print ''; - } - - // Other attributes - //$cols = 3; - //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; - - print '
    '.$langs->trans("User").''; + if ($object->fk_user_author > 0) { + $userauthor = new User($db); + $result = $userauthor->fetch($object->fk_user_author); + if ($result < 0) { + dol_print_error('', $userauthor->error); + } elseif ($result > 0) { + print $userauthor->getNomUrl(-1); + } + } + print '
    '.$langs->trans("Period").''; + print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0); + print '
    '.$langs->trans("ModePaiement").''.$object->fk_c_paiement.'
    '.$langs->trans("DATE_SAVE").''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); + if ($object->status == 2 && $object->hasDelay('toapprove')) { + print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); + } + if ($object->status == 5 && $object->hasDelay('topay')) { + print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); + } + print '
    '.$langs->trans("VALIDATOR").''; + if ($object->fk_user_validator > 0) { $userfee = new User($db); - $userfee->fetch($object->fk_user_valid); - print $userfee->getNomUrl(-1); - print '
    '.$langs->trans("AUTHORPAIEMENT").''; - $userfee = new User($db); - $userfee->fetch($user->id); - print $userfee->getNomUrl(-1); - print '
    '; - - print dol_get_fiche_end(); - - print '
    '; - print ''; - print '     '; - print '
    '; - - print ''; - } else { - print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); - - // Clone confirmation - if ($action == 'clone') { - // Create an array for form - $criteriaforfilter = 'hierarchyme'; - if (!empty($user->rights->expensereport->readall)) { - $criteriaforfilter = ''; - } - $formquestion = array( - 'text' => '', - array('type' => 'other', 'name' => 'fk_user_author', 'label' => $langs->trans("SelectTargetUser"), 'value' => $form->select_dolusers((GETPOST('fk_user_author', 'int') > 0 ? GETPOST('fk_user_author', 'int') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter, '', '0', 0, 0, '', 0, '', 'maxwidth150')) - ); - // Paiement incomplet. On demande si motif = escompte ou autre - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); - } - - if ($action == 'save') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("SaveTrip"), $langs->trans("ConfirmSaveTrip"), "confirm_validate", "", "", 1); - } - - if ($action == 'save_from_refuse') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("SaveTrip"), $langs->trans("ConfirmSaveTrip"), "confirm_save_from_refuse", "", "", 1); - } - - if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteTrip"), $langs->trans("ConfirmDeleteTrip"), "confirm_delete", "", "", 1); - } - - if ($action == 'validate') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("ValideTrip"), $langs->trans("ConfirmValideTrip"), "confirm_approve", "", "", 1); - } - - if ($action == 'paid') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("PaidTrip"), $langs->trans("ConfirmPaidTrip"), "confirm_paid", "", "", 1); - } - - if ($action == 'cancel') { - $array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text", 'label'=>''.$langs->trans("Comment").'', 'name'=>"detail_cancel", 'value'=>"")); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1); - } - - if ($action == 'setdraft') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("BrouillonnerTrip"), $langs->trans("ConfirmBrouillonnerTrip"), "confirm_setdraft", "", "", 1); - } - - if ($action == 'refuse') { // Deny - $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text", 'label'=>$langs->trans("Comment"), 'name'=>"detail_refuse", 'value'=>"")); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Deny"), '', "confirm_refuse", $array_input, "yes", 1); - } - - if ($action == 'delete_line') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid', 'int'), $langs->trans("DeleteLine"), $langs->trans("ConfirmDeleteLine"), "confirm_delete_line", '', 'yes', 1); - } - - // Print form confirm - print $formconfirm; - - // Expense report card - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
    '; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
    '.$langs->trans('Project') . ' '; - if ($user->rights->commande->creer) - { - if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
    '; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
    '; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ - $morehtmlref .= '
    '; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - print '
    '; - print '
    '; - print '
    '; - - print ''; - - // Author - print ''; - print ''; - print ''; - - // Period - print ''; - print ''; - print ''; - print ''; - if (!empty($conf->global->EXPENSEREPORT_ASK_PAYMENTMODE_ON_CREATION)) { - print ''; - print ''; - print ''; - print ''; - } - - // Validation date - print ''; - print ''; - print ''; - print ''; - - // User to inform for approval - if ($object->status <= ExpenseReport::STATUS_VALIDATED) { // informed - print ''; - print ''; // approver - print ''; - } elseif ($object->status == ExpenseReport::STATUS_CANCELED) { - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - } else { - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - } - - if ($object->status == 99 || !empty($object->detail_refuse)) { - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; } + print ''; + } elseif ($object->status == ExpenseReport::STATUS_CANCELED) { + print ''; + print ''; + print ''; - if ($object->status == $object::STATUS_CLOSED) { - /* TODO this fields are not yet filled - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } else { + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + } + + if ($object->status == 99 || !empty($object->detail_refuse)) { + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; - */ } - - // Other attributes - $cols = 2; - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
    '.$langs->trans("User").''; - if ($object->fk_user_author > 0) { - $userauthor = new User($db); - $result = $userauthor->fetch($object->fk_user_author); - if ($result < 0) { - dol_print_error('', $userauthor->error); - } elseif ($result > 0) { - print $userauthor->getNomUrl(-1); - } - } - print '
    '.$langs->trans("Period").''; - print get_date_range($object->date_debut, $object->date_fin, 'day', $langs, 0); - print '
    '.$langs->trans("ModePaiement").''.$object->fk_c_paiement.'
    '.$langs->trans("DATE_SAVE").''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); - if ($object->status == 2 && $object->hasDelay('toapprove')) { - print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); - } - if ($object->status == 5 && $object->hasDelay('topay')) { - print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); - } - print '
    '.$langs->trans("VALIDATOR").''; - if ($object->fk_user_validator > 0) { - $userfee = new User($db); - $result = $userfee->fetch($object->fk_user_validator); - if ($result > 0) { - print $userfee->getNomUrl(-1); - } - if (empty($userfee->email) || !isValidEmail($userfee->email)) { - $langs->load("errors"); - print img_warning($langs->trans("ErrorBadEMail", $userfee->email)); - } - } - print '
    '.$langs->trans("CANCEL_USER").''; - if ($object->fk_user_cancel > 0) { - $userfee = new User($db); - $result = $userfee->fetch($object->fk_user_cancel); - if ($result > 0) { - print $userfee->getNomUrl(-1); - } - } - print '
    '.$langs->trans("MOTIF_CANCEL").''.$object->detail_cancel.'
    '.$langs->trans("DATE_CANCEL").''.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'
    '.$langs->trans("ApprovedBy").''; - if ($object->fk_user_approve > 0) { - $userapp = new User($db); - $result = $userapp->fetch($object->fk_user_approve); - if ($result > 0) { - print $userapp->getNomUrl(-1); - } - } - print '
    '.$langs->trans("DateApprove").''.dol_print_date($object->date_approve, 'dayhour', 'tzuser').'
    '.$langs->trans("REFUSEUR").''; - $userfee = new User($db); - $result = $userfee->fetch($object->fk_user_refuse); + $result = $userfee->fetch($object->fk_user_validator); if ($result > 0) { print $userfee->getNomUrl(-1); } - print '
    '.$langs->trans("DATE_REFUS").''.dol_print_date($object->date_refuse, 'dayhour', 'tzuser'); - if ($object->detail_refuse) { - print ' - '.$object->detail_refuse; + if (empty($userfee->email) || !isValidEmail($userfee->email)) { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadEMail", $userfee->email)); } - print '
    '.$langs->trans("CANCEL_USER").''; + if ($object->fk_user_cancel > 0) { + $userfee = new User($db); + $result = $userfee->fetch($object->fk_user_cancel); + if ($result > 0) { + print $userfee->getNomUrl(-1); + } + } + print '
    '.$langs->trans("AUTHORPAIEMENT").''; - $userfee=new User($db); - $userfee->fetch($object->fk_user_paid); + print '
    '.$langs->trans("MOTIF_CANCEL").''.$object->detail_cancel.'
    '.$langs->trans("DATE_CANCEL").''.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'
    '.$langs->trans("ApprovedBy").''; + if ($object->fk_user_approve > 0) { + $userapp = new User($db); + $result = $userapp->fetch($object->fk_user_approve); + if ($result > 0) { + print $userapp->getNomUrl(-1); + } + } + print '
    '.$langs->trans("DateApprove").''.dol_print_date($object->date_approve, 'dayhour', 'tzuser').'
    '.$langs->trans("REFUSEUR").''; + $userfee = new User($db); + $result = $userfee->fetch($object->fk_user_refuse); + if ($result > 0) { print $userfee->getNomUrl(-1); - print '
    '.$langs->trans("DATE_PAIEMENT").''.$object->date_paiement.'
    '; - - print '
    '; - print '
    '; - print '
    '; - print '
    '; - - print ''; - - // Amount - print ''; - print ''; - print ''; - $rowspan = 5; - if ($object->status <= ExpenseReport::STATUS_VALIDATED) { - $rowspan++; - } elseif ($object->status == ExpenseReport::STATUS_CANCELED) { - $rowspan += 2; - } else { - $rowspan += 2; - } - if ($object->status == ExpenseReport::STATUS_REFUSED || !empty($object->detail_refuse)) { - $rowspan += 2; - } - if ($object->status == ExpenseReport::STATUS_CLOSED) { - $rowspan += 2; - } - print ""; - print ''; + print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; + } - print ''; - print ''; - print ''; - print ''; + if ($object->status == $object::STATUS_CLOSED) { + /* TODO this fields are not yet filled + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + */ + } - // List of payments already done - $nbcols = 3; - if (!empty($conf->banque->enabled)) { - $nbrows++; - $nbcols++; + // Other attributes + $cols = 2; + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + + print '
    '.$langs->trans("AmountHT").''.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AmountVAT").''.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''.$langs->trans("DATE_REFUS").''.dol_print_date($object->date_refuse, 'dayhour', 'tzuser'); + if ($object->detail_refuse) { + print ' - '.$object->detail_refuse; + } + print '
    '.$langs->trans("AmountTTC").''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AUTHORPAIEMENT").''; + $userfee=new User($db); + $userfee->fetch($object->fk_user_paid); + print $userfee->getNomUrl(-1); + print '
    '.$langs->trans("DATE_PAIEMENT").''.$object->date_paiement.'
    '; + + print '
    '; + print '
    '; + print '
    '; + print '
    '; + + print ''; + + // Amount + print ''; + print ''; + print ''; + $rowspan = 5; + if ($object->status <= ExpenseReport::STATUS_VALIDATED) { + $rowspan++; + } elseif ($object->status == ExpenseReport::STATUS_CANCELED) { + $rowspan += 2; + } else { + $rowspan += 2; + } + if ($object->status == ExpenseReport::STATUS_REFUSED || !empty($object->detail_refuse)) { + $rowspan += 2; + } + if ($object->status == ExpenseReport::STATUS_CLOSED) { + $rowspan += 2; + } + print ""; + print ''; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + + // List of payments already done + $nbcols = 3; + if (!empty($conf->banque->enabled)) { + $nbrows++; + $nbcols++; + } + + print '
    '.$langs->trans("AmountHT").''.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AmountVAT").''.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'
    '.$langs->trans("AmountTTC").''.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'
    '; + + print ''; + print ''; + print ''; + print ''; + if (!empty($conf->banque->enabled)) { + print ''; + } + print ''; + print ''; + print ''; + + // Payments already done (from payment on this expensereport) + $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,"; + $sql .= "c.code as p_code, c.libelle as payment_type,"; + $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal"; + $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; + $sql .= " WHERE e.rowid = '".$id."'"; + $sql .= " AND p.fk_expensereport = e.rowid"; + $sql .= ' AND e.entity IN ('.getEntity('expensereport').')'; + $sql .= " ORDER BY dp"; + + $resql = $db->query($sql); + if ($resql) { + $num = $db->num_rows($resql); + $i = 0; $totalpaid = 0; + while ($i < $num) { + $objp = $db->fetch_object($resql); + + $paymentexpensereportstatic->id = $objp->rowid; + $paymentexpensereportstatic->datepaye = $db->jdate($objp->dp); + $paymentexpensereportstatic->ref = $objp->rowid; + $paymentexpensereportstatic->num_payment = $objp->num_payment; + $paymentexpensereportstatic->payment_code = $objp->payment_code; + + print ''; + print ''; + print '\n"; + $labeltype = $langs->trans("PaymentType".$objp->p_code) != ("PaymentType".$objp->p_code) ? $langs->trans("PaymentType".$objp->p_code) : $objp->payment_type; + print "\n"; + if (!empty($conf->banque->enabled)) { + $bankaccountstatic->id = $objp->baid; + $bankaccountstatic->ref = $objp->baref; + $bankaccountstatic->label = $objp->baref; + $bankaccountstatic->number = $objp->banumber; + + if (!empty($conf->accounting->enabled)) { + $bankaccountstatic->account_number = $objp->account_number; + + $accountingjournal = new AccountingJournal($db); + $accountingjournal->fetch($objp->fk_accountancy_journal); + $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); + } + + print ''; + } + print '"; + print ''; + print ""; + $totalpaid += $objp->amount; + $i++; + } + if (!is_null($totalpaid)) { + $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop } - print '
    '.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
    '; + print $paymentexpensereportstatic->getNomUrl(1); + print ''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'; + if ($bankaccountstatic->id) { + print $bankaccountstatic->getNomUrl(1, 'transactions'); + } + print ''.price($objp->amount)."
    '; + $remaintopay = price2num($object->total_ttc - $totalpaid); + $resteapayeraffiche = $remaintopay; + + $cssforamountpaymentcomplete = 'amountpaymentcomplete'; + + if ($object->status == ExpenseReport::STATUS_REFUSED) { + $cssforamountpaymentcomplete = 'amountpaymentneutral'; + $resteapayeraffiche = 0; + } elseif ($object->paid == 0) { + $cssforamountpaymentcomplete = 'amountpaymentneutral'; + } + print ''; + print ''; + + print ''; + print ''; + + $db->free($resql); + } else { + dol_print_error($db); + } + print "
    '.$langs->trans("AlreadyPaid").':'.price($totalpaid).'
    '.$langs->trans("AmountExpected").':'.price($object->total_ttc).'
    '.$langs->trans("RemainderToPay").':'.price($resteapayeraffiche).'
    "; + + print '
    '; + print '
    '; + print '
    '; + + print '

    '; + + print '
    '; + + $actiontouse = 'updateline'; + if (($object->status == 0 || $object->status == 99) && $action != 'editline') { + $actiontouse = 'addline'; + } + + print '
    '; + print ''; + print ''; + print ''; + print ''; + + print '
    '; + print ''; + + if (!empty($object->lines)) { + $i = 0; $total = 0; print ''; - print ''; - print ''; - print ''; - if (!empty($conf->banque->enabled)) { - print ''; + print ''; + //print ''; + print ''; + if (!empty($conf->projet->enabled)) { + print ''; + } + print ''; + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } + print ''; + print ''; + print ''; + print ''; + print ''; + if ($action != 'editline') { + print ''; + print ''; + } + // Picture + print ''; + // Ajout des boutons de modification/suppression + if (($object->status < 2 || $object->status == 99) && $user->rights->expensereport->creer) { + print ''; } - print ''; - print ''; print ''; - // Payments already done (from payment on this expensereport) - $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount, p.fk_bank,"; - $sql .= "c.code as p_code, c.libelle as payment_type,"; - $sql .= "ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal"; - $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."payment_expensereport as p"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id"; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; - $sql .= " WHERE e.rowid = '".$id."'"; - $sql .= " AND p.fk_expensereport = e.rowid"; - $sql .= ' AND e.entity IN ('.getEntity('expensereport').')'; - $sql .= " ORDER BY dp"; + foreach ($object->lines as &$line) { + $numline = $i + 1; - $resql = $db->query($sql); - if ($resql) { - $num = $db->num_rows($resql); - $i = 0; $totalpaid = 0; - while ($i < $num) { - $objp = $db->fetch_object($resql); + if ($action != 'editline' || $line->rowid != GETPOST('rowid', 'int')) { + print ''; - $paymentexpensereportstatic->id = $objp->rowid; - $paymentexpensereportstatic->datepaye = $db->jdate($objp->dp); - $paymentexpensereportstatic->ref = $objp->rowid; - $paymentexpensereportstatic->num_payment = $objp->num_payment; - $paymentexpensereportstatic->payment_code = $objp->payment_code; - - print ''; - print ''; - print '\n"; - $labeltype = $langs->trans("PaymentType".$objp->p_code) != ("PaymentType".$objp->p_code) ? $langs->trans("PaymentType".$objp->p_code) : $objp->payment_type; - print "\n"; - if (!empty($conf->banque->enabled)) { - $bankaccountstatic->id = $objp->baid; - $bankaccountstatic->ref = $objp->baref; - $bankaccountstatic->label = $objp->baref; - $bankaccountstatic->number = $objp->banumber; - if (!empty($conf->accounting->enabled)) { - $bankaccountstatic->account_number = $objp->account_number; + // Date + print ''; - $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch($objp->fk_accountancy_journal); - $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1); - } - - print ''; } - print '"; - print ''; - print ""; - $totalpaid += $objp->amount; - $i++; - } - if (!is_null($totalpaid)) { - $totalpaid = price2num($totalpaid); // Round $totalpaid to fix floating problem after addition into loop - } - $remaintopay = price2num($object->total_ttc - $totalpaid); - $resteapayeraffiche = $remaintopay; + // Type of fee + print ''; - $cssforamountpaymentcomplete = 'amountpaymentcomplete'; - - if ($object->status == ExpenseReport::STATUS_REFUSED) { - $cssforamountpaymentcomplete = 'amountpaymentneutral'; - $resteapayeraffiche = 0; - } elseif ($object->paid == 0) { - $cssforamountpaymentcomplete = 'amountpaymentneutral'; - } - print ''; - print ''; - - print ''; - print ''; - - $db->free($resql); - } else { - dol_print_error($db); - } - print "
    '.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('LineNb').''.$langs->trans('Piece').''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('CarCategory').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; + print ''.$langs->trans('Amount').' 
    '; - print $paymentexpensereportstatic->getNomUrl(1); + // Num + print ''; + print $numline; print ''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'.dol_print_date($db->jdate($line->date), 'day').''; - if ($bankaccountstatic->id) { - print $bankaccountstatic->getNomUrl(1, 'transactions'); + // Project + if (!empty($conf->projet->enabled)) { + print ''; + if ($line->fk_project > 0) { + $projecttmp->id = $line->fk_project; + $projecttmp->ref = $line->projet_ref; + $projecttmp->title = $line->projet_title; + print $projecttmp->getNomUrl(1); } print ''.price($objp->amount)."
    '; + $labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code)); + print $labeltype; + print '
    '.$langs->trans("AlreadyPaid").':'.price($totalpaid).'
    '.$langs->trans("AmountExpected").':'.price($object->total_ttc).'
    '.$langs->trans("RemainderToPay").':'.price($resteapayeraffiche).'
    "; - - print '
    '; - print '
    '; - print '
    '; - - print '

    '; - - print '
    '; - - $actiontouse = 'updateline'; - if (($object->status == 0 || $object->status == 99) && $action != 'editline') { - $actiontouse = 'addline'; - } - - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
    '; - print ''; - - if (!empty($object->lines)) { - $i = 0; $total = 0; - - print ''; - print ''; - //print ''; - print ''; - if (!empty($conf->projet->enabled)) { - print ''; - } - print ''; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } - print ''; - print ''; - print ''; - print ''; - print ''; - if ($action != 'editline') { - print ''; - print ''; - } - // Picture - print ''; - // Ajout des boutons de modification/suppression - if (($object->status < 2 || $object->status == 99) && $user->rights->expensereport->creer) { - print ''; - } - print ''; - - foreach ($object->lines as &$line) { - $numline = $i + 1; - - if ($action != 'editline' || $line->rowid != GETPOST('rowid', 'int')) { - print ''; - - // Num - print ''; + } - // Date - print ''; + // Comment + print ''; + // VAT rate + print ''; + // Unit price HT + print ''; - // Project - if (!empty($conf->projet->enabled)) { - print ''; - } + print ''; - // Type of fee - print ''; + print ''; - // IK - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } + if ($action != 'editline') { + print ''; + print ''; + } - // Comment - print ''; - // VAT rate - print ''; - // Unit price HT - print ''; + // Column with preview + print ''; - - print ''; - - if ($action != 'editline') { - print ''; - print ''; - } - - // Column with preview - print ''; + + // Ajout des boutons de modification/suppression + if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) { + print ''; - - // Ajout des boutons de modification/suppression - if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->rights->expensereport->creer) { - print ''; - } - - print ''; } - if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { - // Add line with link to add new file or attach line to an existing file - $colspan = 10; - if (!empty($conf->projet->enabled)) { - $colspan++; - } - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - $colspan++; - } + print ''; + } - print ''; + if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { + // Add line with link to add new file or attach line to an existing file + $colspan = 10; + if (!empty($conf->projet->enabled)) { + $colspan++; + } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + $colspan++; + } - print ''; + print ''; - print ''; + + print ''; + print ''."\n"; + print ''; - $filenamelinked = ''; - if ($line->fk_ecm_files > 0) { - $result = $ecmfilesstatic->fetch($line->fk_ecm_files); - if ($result > 0) { - $filenamelinked = $ecmfilesstatic->filename; - } + $filenamelinked = ''; + if ($line->fk_ecm_files > 0) { + $result = $ecmfilesstatic->fetch($line->fk_ecm_files); + if ($result > 0) { + $filenamelinked = $ecmfilesstatic->filename; } - - $tredited = 'tredited'; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; - - print ''; - - print ''; - - // Select date - print ''; - - // Select project - if (!empty($conf->projet->enabled)) { - print ''; - } - - // Select type - print ''; - - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } - - // Add comments - print ''; - - // VAT - print ''; - - // Unit price - print ''; - - // Unit price with tax - print ''; - - // Quantity - print ''; - - //print ''; - //print ''; - - // Picture - print ''; - - print ''; - - print ''; } - $i++; - } - } + $tredited = 'tredited'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; - // Add a new line - if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) - && $action != 'editline' - && $user->rights->expensereport->creer) { + print ''; + + print ''; + + // Select date + print ''; + + // Select project + if (!empty($conf->projet->enabled)) { + print ''; + } + + // Select type + print ''; + + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } + + // Add comments + print ''; + + // VAT + print ''; + + // Unit price + print ''; + + // Unit price with tax + print ''; + + // Quantity + print ''; + + //print ''; + //print ''; + + // Picture + print ''; + + print ''; + + print ''; + } + + $i++; + } + } + + // Add a new line + if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) + && $action != 'editline' + && $user->rights->expensereport->creer) { $colspan = 11; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - $colspan++; - } - if (!empty($conf->projet->enabled)) { - $colspan++; - } - if ($action != 'editline') { - $colspan++; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + $colspan++; + } + if (!empty($conf->projet->enabled)) { + $colspan++; + } + if ($action != 'editline') { + $colspan++; + } $nbFiles = $nbLinks = 0; $arrayoffiles = array(); - if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref); - $arrayoffiles = dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); - $nbFiles = count($arrayoffiles); - $nbLinks = Link::count($db, $object->element, $object->id); - } + if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref); + $arrayoffiles = dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png|'.preg_quote(dol_sanitizeFileName($object->ref.'.pdf'), '/').')$'); + $nbFiles = count($arrayoffiles); + $nbLinks = Link::count($db, $object->element, $object->id); + } // Add line with link to add new file or attach to an existing file print ''; @@ -2326,46 +2333,65 @@ if ($action == 'create') { print ''.$langs->trans("UploadANewFileNow"); print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); print ''; - if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { - print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); - print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); - print ''; - } + if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { + print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); + print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + } + print ''."\n"; print ''."\n"; print ''; - include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_linktofile.tpl.php'; + include DOL_DOCUMENT_ROOT.'/expensereport/tpl/expensereport_addfile.tpl.php'; print ''; print ''; print ''; - if (!empty($conf->projet->enabled)) { - print ''; - } + if (!empty($conf->projet->enabled)) { + print ''; + } print ''; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } print ''; print ''; print ''; @@ -2388,23 +2414,23 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { - print ''; - } + if (!empty($conf->projet->enabled)) { + print ''; + } // Select type print ''; - if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { - print ''; - } + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + } // Add comments print ''; @@ -2438,52 +2464,58 @@ if ($action == 'create') { // Picture print ''; - if ($action != 'editline') { - print ''; - print ''; - } + if ($action != 'editline') { + print ''; + print ''; + } print ''; print ''; - } // Fin si c'est payé/validé + } // Fin si c'est payé/validé - print '
    '.$langs->trans('LineNb').''.$langs->trans('Piece').''.$langs->trans('Date').''.$langs->trans('Project').''.$langs->trans('Type').''.$langs->trans('CarCategory').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('PriceUTTC').''.$langs->trans('Qty').''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; - print '
    '; - print $numline; + // IK + if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + print ''; + print dol_getIdFromCode($db, $line->fk_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); print ''.dol_print_date($db->jdate($line->date), 'day').''.dol_nl2br($line->comments).''.vatrate($line->vatrate, true).''; + if (!empty($line->value_unit_ht)) { + print price($line->value_unit_ht); + } else { + $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $line->vatrate)); + $pricenettoshow = price2num($line->value_unit / (1 + $tmpvat / 100), 'MU'); + print $pricenettoshow; + } + print ''; - if ($line->fk_project > 0) { - $projecttmp->id = $line->fk_project; - $projecttmp->ref = $line->projet_ref; - $projecttmp->title = $line->projet_title; - print $projecttmp->getNomUrl(1); - } - print ''.price($line->value_unit).''; - $labeltype = ($langs->trans(($line->type_fees_code)) == $line->type_fees_code ? $line->type_fees_libelle : $langs->trans($line->type_fees_code)); - print $labeltype; - print ''.dol_escape_htmltag($line->qty).''; - print dol_getIdFromCode($db, $line->fk_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label'); - print ''.price($line->total_ht).''.price($line->total_ttc).''.dol_nl2br($line->comments).''.vatrate($line->vatrate, true).''; - if (!empty($line->value_unit_ht)) { - print price($line->value_unit_ht); - } else { - $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $line->vatrate)); - $pricenettoshow = price2num($line->value_unit / (1 + $tmpvat / 100), 'MU'); - print $pricenettoshow; - } - print ''; + if ($line->fk_ecm_files > 0) { + $modulepart = 'expensereport'; + $maxheightmini = 32; - print ''.price($line->value_unit).''.dol_escape_htmltag($line->qty).''.price($line->total_ht).''.price($line->total_ttc).''; - if ($line->fk_ecm_files > 0) { - $modulepart = 'expensereport'; - $maxheightmini = 32; - - $result = $ecmfilesstatic->fetch($line->fk_ecm_files); - if ($result > 0) { - $relativepath = preg_replace('/expensereport\//', '', $ecmfilesstatic->filepath); - $fileinfo = pathinfo($ecmfilesstatic->filepath.'/'.$ecmfilesstatic->filename); - if (image_format_supported($fileinfo['basename']) > 0) { - $minifile = getImageFileNameForSize($fileinfo['basename'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original - if (!dol_is_file($conf->expensereport->dir_output.'/'.$relativepath.'/'.$minifile)) { - $minifile = getImageFileNameForSize($fileinfo['basename'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension - } - //print $file['path'].'/'.$minifile.'
    '; - $urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.'/'.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity)); - if (empty($urlforhref)) { - $urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])); - print ''; - } else { - print ''; - } - print ''; - print ''; + $result = $ecmfilesstatic->fetch($line->fk_ecm_files); + if ($result > 0) { + $relativepath = preg_replace('/expensereport\//', '', $ecmfilesstatic->filepath); + $fileinfo = pathinfo($ecmfilesstatic->filepath.'/'.$ecmfilesstatic->filename); + if (image_format_supported($fileinfo['basename']) > 0) { + $minifile = getImageFileNameForSize($fileinfo['basename'], '_mini'); // For new thumbs using same ext (in lower case howerver) than original + if (!dol_is_file($conf->expensereport->dir_output.'/'.$relativepath.'/'.$minifile)) { + $minifile = getImageFileNameForSize($fileinfo['basename'], '_mini', '.png'); // For backward compatibility of old thumbs that were created with filename in lower case and with .png extension + } + //print $file['path'].'/'.$minifile.'
    '; + $urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.'/'.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity)); + if (empty($urlforhref)) { + $urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension'])); + print ''; } else { - $modulepart = 'expensereport'; - $thumbshown = 0; - if (preg_match('/\.pdf$/i', $ecmfilesstatic->filename)) { - $filepdf = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename; - $fileimage = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename.'_preview.png'; - $relativepathimage = $relativepath.'/'.$ecmfilesstatic->filename.'_preview.png'; + print ''; + } + print ''; + print ''; + } else { + $modulepart = 'expensereport'; + $thumbshown = 0; + if (preg_match('/\.pdf$/i', $ecmfilesstatic->filename)) { + $filepdf = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename; + $fileimage = $conf->expensereport->dir_output.'/'.$relativepath.'/'.$ecmfilesstatic->filename.'_preview.png'; + $relativepathimage = $relativepath.'/'.$ecmfilesstatic->filename.'_preview.png'; - $pdfexists = file_exists($filepdf); - if ($pdfexists) { - // Conversion du PDF en image png si fichier png non existant - if (!file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) { - if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) { // If you experience trouble with pdf thumb generation and imagick, you can disable here. - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png - if ($ret < 0) { - $error++; - } + $pdfexists = file_exists($filepdf); + if ($pdfexists) { + // Conversion du PDF en image png si fichier png non existant + if (!file_exists($fileimage) || (filemtime($fileimage) < filemtime($filepdf))) { + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) { // If you experience trouble with pdf thumb generation and imagick, you can disable here. + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $ret = dol_convert_file($filepdf, 'png', $fileimage, '0'); // Convert first page of PDF into a file _preview.png + if ($ret < 0) { + $error++; } } } + } - if ($pdfexists && !$error) { - $heightforphotref = 70; - if (!empty($conf->dol_optimize_smallscreen)) { - $heightforphotref = 60; - } - // If the preview file is found - if (file_exists($fileimage)) { - $thumbshown = 1; - print ''; - } + if ($pdfexists && !$error) { + $heightforphotref = 70; + if (!empty($conf->dol_optimize_smallscreen)) { + $heightforphotref = 60; + } + // If the preview file is found + if (file_exists($fileimage)) { + $thumbshown = 1; + print ''; } } + } - if (!$thumbshown) { - print img_mime($ecmfilesstatic->filename); - } + if (!$thumbshown) { + print img_mime($ecmfilesstatic->filename); } } } + } + print '
    '; + + print 'rowid.'">'; + print img_edit(); + print '   '; + print 'rowid.'">'; + print img_delete(); + print ''; + print ''; - - print 'rowid.'">'; - print img_edit(); - print '   '; - print 'rowid.'">'; - print img_delete(); - print ''; - - print '
    '; - print $numline; - print '
    '; - print ''.$langs->trans("UploadANewFileNow"); - print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + print $numline; + print ''; + print ''.$langs->trans("UploadANewFileNow"); + print img_picto($langs->trans("UploadANewFileNow"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); + print ''; + if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { + print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); + print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); print ''; - if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { - print '   -   '.$langs->trans("AttachTheNewLineToTheDocument"); - print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly'); - print ''; - } + } - print ''."\n"; - print '
    '; - print $form->selectDate($line->date, 'date'); - print ''; - $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); - print ''; - print $formexpensereport->selectTypeExpenseReport($line->fk_c_type_fees, 'fk_c_type_fees'); - print ''; - $params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->rowid, 'date' => $line->dates); - print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params); - print ''; - print ''; - print ''; - print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $line->vatrate), $mysoc, '', 0, 0, '', false, 1); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; - //print $line->fk_ecm_files; - print ''; - print ''; - print ''; - print '
    '; - print '
    '; + print $form->selectDate($line->date, 'date'); + print ''; + $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + print ''; + print $formexpensereport->selectTypeExpenseReport($line->fk_c_type_fees, 'fk_c_type_fees'); + print ''; + $params = array('fk_expense' => $object->id, 'fk_expense_det' => $line->rowid, 'date' => $line->dates); + print $form->selectExpenseCategories($line->fk_c_exp_tax_cat, 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params); + print ''; + print ''; + print ''; + print $form->load_tva('vatrate', (GETPOSTISSET("vatrate") ? GETPOST("vatrate") : $line->vatrate), $mysoc, '', 0, 0, '', false, 1); + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''.$langs->trans('AmountHT').''.$langs->trans('AmountTTC').''; + //print $line->fk_ecm_files; + print ''; + print ''; + print ''; + print '
    '; + print '
    '.$langs->trans('Date').''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''.$langs->trans('Type').''.$langs->trans('CarCategory').''.$langs->trans('CarCategory').''.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''; - $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); - print ''; + $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); + print ''; print $formexpensereport->selectTypeExpenseReport($fk_c_type_fees, 'fk_c_type_fees', 1); print ''; - $params = array('fk_expense' => $object->id); - print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0); - print ''; + $params = array('fk_expense' => $object->id); + print $form->selectExpenseCategories('', 'fk_c_exp_tax_cat', 1, array(), 'fk_c_type_fees', $userauthor->default_c_exp_tax_cat, $params, 0); + print ''; @@ -2414,9 +2440,9 @@ if ($action == 'create') { // Select VAT print ''; $defaultvat = -1; - if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { - $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; - } + if (!empty($conf->global->EXPENSEREPORT_NO_DEFAULT_VAT)) { + $conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS = 'none'; + } print $form->load_tva('vatrate', ($vatrate != '' ? $vatrate : $defaultvat), $mysoc, '', 0, 0, '', false, 1); print '
    '; - print '
    '; + print ''; + print '
    '; - print ''; + '; - print ''; + print ''; - print dol_get_fiche_end(); - } - } else { - dol_print_error($db); + print dol_get_fiche_end(); } + } else { + dol_print_error($db); } +} else { + print 'Record not found'; + + llxFooter(); + exit(1); } + /* * Action bar */ + print '
    '; if ($action != 'create' && $action != 'edit') { @@ -2528,7 +2560,7 @@ if ($action != 'create' && $action != 'edit') { print ''; // setdraft (le statut refusée est identique à brouillon) - //print ''.$langs->trans('BROUILLONNER').''; + //print ''.$langs->trans('ReOpen').''; // Enregistrer depuis le statut "Refusée" print ''; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index be09b670d84..b3601c00deb 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (c) 2018 Frédéric France + * Copyright (c) 2018-2021 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -990,9 +990,9 @@ class ExpenseReport extends CommonObject $total_ttc = $total_ht + $total_tva; $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " total_ht = ".$total_ht; - $sql .= " , total_ttc = ".$total_ttc; - $sql .= " , total_tva = ".$total_tva; + $sql .= " total_ht = ".price2num($total_ht, 'MT'); + $sql .= " , total_ttc = ".price2num($total_ttc, 'MT'); + $sql .= " , total_tva = ".price2num($total_tva, 'MT'); $sql .= " WHERE rowid = ".((int) $id); $result = $this->db->query($sql); if ($result) : @@ -1645,6 +1645,7 @@ class ExpenseReport extends CommonObject * Return clicable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option Where point the link ('', 'document', ..) * @param int $max Max length of shown ref * @param int $short 1=Return just URL * @param string $moretitle Add more text to title tooltip @@ -1652,7 +1653,7 @@ class ExpenseReport extends CommonObject * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string String with URL */ - public function getNomUrl($withpicto = 0, $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) + public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1) { global $langs, $conf; @@ -1684,17 +1685,16 @@ class ExpenseReport extends CommonObject $label .= ' - '.$moretitle; } - //if ($option != 'nolink') - //{ - // Add param to save lastsearch_values or not + if ($option != 'nolink') { + // Add param to save lastsearch_values or not $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { - $add_save_lastsearch_values = 1; + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } } - if ($add_save_lastsearch_values) { - $url .= '&save_lastsearch_values=1'; - } - //} $ref = $this->ref; if (empty($ref)) { @@ -1720,7 +1720,7 @@ class ExpenseReport extends CommonObject $result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); } if ($withpicto != 2) { - $result .= ($max ?dol_trunc($ref, $max) : $ref); + $result .= ($max ? dol_trunc($ref, $max) : $ref); } $result .= $linkend; @@ -2119,7 +2119,7 @@ class ExpenseReport extends CommonObject $this->line->fk_ecm_files = $fk_ecm_files; - $this->line->id = $rowid; + $this->line->id = ((int) $rowid); // Select des infos sur le type fees $sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees"; @@ -2478,9 +2478,9 @@ class ExpenseReport extends CommonObject $now = dol_now(); if ($option == 'toapprove') { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); } else { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } } @@ -2697,20 +2697,20 @@ class ExpenseReportLine $sql .= ' (fk_expensereport, fk_c_type_fees, fk_projet,'; $sql .= ' tva_tx, vat_src_code, comments, qty, value_unit, total_ht, total_tva, total_ttc, date, rule_warning_message, fk_c_exp_tax_cat, fk_ecm_files)'; $sql .= " VALUES (".$this->db->escape($this->fk_expensereport).","; - $sql .= " ".$this->db->escape($this->fk_c_type_fees).","; - $sql .= " ".$this->db->escape((!empty($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : ((!empty($this->fk_projet) && $this->fk_projet > 0) ? $this->fk_projet : 'null')).","; - $sql .= " ".$this->db->escape($this->vatrate).","; + $sql .= " ".((int) $this->fk_c_type_fees).","; + $sql .= " ".((int) (!empty($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : ((!empty($this->fk_projet) && $this->fk_projet > 0) ? $this->fk_projet : 'null')).","; + $sql .= " ".((float) $this->vatrate).","; $sql .= " '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."',"; $sql .= " '".$this->db->escape($this->comments)."',"; - $sql .= " ".$this->db->escape($this->qty).","; - $sql .= " ".$this->db->escape($this->value_unit).","; - $sql .= " ".$this->db->escape($this->total_ht).","; - $sql .= " ".$this->db->escape($this->total_tva).","; - $sql .= " ".$this->db->escape($this->total_ttc).","; + $sql .= " ".((float) $this->qty).","; + $sql .= " ".((float) $this->value_unit).","; + $sql .= " ".((float) price2num($this->total_ht)).","; + $sql .= " ".((float) price2num($this->total_tva)).","; + $sql .= " ".((float) price2num($this->total_ttc)).","; $sql .= " '".$this->db->idate($this->date)."',"; $sql .= " ".(empty($this->rule_warning_message) ? 'null' : "'".$this->db->escape($this->rule_warning_message)."'").","; - $sql .= " ".$this->db->escape($this->fk_c_exp_tax_cat).","; - $sql .= " ".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null'); + $sql .= " ".((int) $this->fk_c_exp_tax_cat).","; + $sql .= " ".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null'); $sql .= ")"; $resql = $this->db->query($sql); @@ -2811,30 +2811,30 @@ class ExpenseReportLine // Update line in database $sql = "UPDATE ".MAIN_DB_PREFIX."expensereport_det SET"; $sql .= " comments='".$this->db->escape($this->comments)."'"; - $sql .= ",value_unit=".$this->db->escape($this->value_unit); - $sql .= ",qty=".$this->db->escape($this->qty); - $sql .= ",date='".$this->db->idate($this->date)."'"; - $sql .= ",total_ht=".$this->db->escape($this->total_ht).""; - $sql .= ",total_tva=".$this->db->escape($this->total_tva).""; - $sql .= ",total_ttc=".$this->db->escape($this->total_ttc).""; - $sql .= ",tva_tx=".$this->db->escape($this->vatrate); - $sql .= ",vat_src_code='".$this->db->escape($this->vat_src_code)."'"; - $sql .= ",rule_warning_message='".$this->db->escape($this->rule_warning_message)."'"; - $sql .= ",fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat); - $sql .= ",fk_ecm_files=".($this->fk_ecm_files > 0 ? $this->fk_ecm_files : 'null'); + $sql .= ", value_unit = ".((float) $this->value_unit); + $sql .= ", qty=".((float) $this->qty); + $sql .= ", date='".$this->db->idate($this->date)."'"; + $sql .= ", total_ht=".((float) price2num($this->total_ht, 'MT')).""; + $sql .= ", total_tva=".((float) price2num($this->total_tva, 'MT')).""; + $sql .= ", total_ttc=".((float) price2num($this->total_ttc, 'MT')).""; + $sql .= ", tva_tx=".((float) $this->vatrate); + $sql .= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'"; + $sql .= ", rule_warning_message='".$this->db->escape($this->rule_warning_message)."'"; + $sql .= ", fk_c_exp_tax_cat=".$this->db->escape($this->fk_c_exp_tax_cat); + $sql .= ", fk_ecm_files=".($this->fk_ecm_files > 0 ? ((int) $this->fk_ecm_files) : 'null'); if ($this->fk_c_type_fees) { - $sql .= ",fk_c_type_fees=".$this->db->escape($this->fk_c_type_fees); + $sql .= ", fk_c_type_fees = ".((int) $this->fk_c_type_fees); } else { - $sql .= ",fk_c_type_fees=null"; + $sql .= ", fk_c_type_fees=null"; } if ($this->fk_project > 0) { - $sql .= ",fk_projet=".$this->db->escape($this->fk_project); + $sql .= ", fk_projet=".((int) $this->fk_project); } else { - $sql .= ",fk_projet=null"; + $sql .= ", fk_projet=null"; } - $sql .= " WHERE rowid = ".$this->db->escape($this->rowid ? $this->rowid : $this->id); + $sql .= " WHERE rowid = ".((int) ($this->rowid ? $this->rowid : $this->id)); - dol_syslog("ExpenseReportLine::update sql=".$sql); + dol_syslog("ExpenseReportLine::update"); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index c673316d491..6e3e8d34137 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -168,8 +168,8 @@ class PaymentExpenseReport extends CommonObject $sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)"; $sql .= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->datepaid)."',"; - $sql .= " ".$totalamount.","; - $sql .= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.","; + $sql .= " ".price2num($totalamount).","; + $sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).","; $sql .= " 0)"; dol_syslog(get_class($this)."::create", LOG_DEBUG); diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 147f0842e4c..d7ecea8fcc9 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -154,7 +154,7 @@ if ($object->id) { $modulepart = 'expensereport'; - $permission = $user->rights->expensereport->creer; + $permissiontoadd = $user->rights->expensereport->creer; $permtoedit = $user->rights->expensereport->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 8198883e58f..c87cc08fb40 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro @@ -132,6 +132,30 @@ foreach ($listoftype as $code => $label) { $dataseries[] = array($label, (isset($somme[$code]) ? (int) $somme[$code] : 0)); } +// Sort array with most important first +$dataseries = dol_sort_array($dataseries, 1, 'desc'); + +// Merge all entrie after the $KEEPNFIRST one into one entry called "Other..." (to avoid to have too much entries in graphic). +$KEEPNFIRST = 7; // Keep first $KEEPNFIRST one + 1 with the remain +$i = 0; +if (count($dataseries) > ($KEEPNFIRST + 1)) { + foreach ($dataseries as $key => $val) { + if ($i < $KEEPNFIRST) { + $i++; + continue; + } + // Here $key = $KEEPNFIRST + $dataseries[$KEEPNFIRST][0] = $langs->trans("Others").'...'; + if ($key == $KEEPNFIRST) { + $i++; + continue; + } + $dataseries[$KEEPNFIRST][1] += $dataseries[$key][1]; + unset($dataseries[$key]); + $i++; + } +} + if ($conf->use_javascript_ajax) { print ''; @@ -221,10 +245,10 @@ if ($result) { $userstatic->photo = $obj->photo; print ''; - print ''.$expensereportstatic->getNomUrl(1).''; - print ''.$userstatic->getNomUrl(-1).''; - print ''.price($obj->total_ht).''; - print ''.price($obj->total_ttc).''; + print ''.$expensereportstatic->getNomUrl(1).''; + print ''.$userstatic->getNomUrl(-1).''; + print ''.price($obj->total_ht).''; + print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->dm), 'day').''; print ''; print $expensereportstatic->getLibStatut(3); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index ce1dc4e3c09..1f3468d06fc 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -107,12 +107,23 @@ $search_amount_vat = GETPOST('search_amount_vat', 'alpha'); $search_amount_ttc = GETPOST('search_amount_ttc', 'alpha'); $search_status = (GETPOST('search_status', 'intcomma') != '' ?GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); -$year_start = GETPOST('year_start', 'int'); -$month_start = GETPOST('month_start', 'int'); -$day_start = GETPOST('day_start', 'int'); -$year_end = GETPOST('year_end', 'int'); -$month_end = GETPOST('month_end', 'int'); -$day_end = GETPOST('day_end', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_startendday = GETPOST('search_date_startendday', 'int'); +$search_date_startendmonth = GETPOST('search_date_startendmonth', 'int'); +$search_date_startendyear = GETPOST('search_date_startendyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_startend = dol_mktime(23, 59, 59, $search_date_startendmonth, $search_date_startendday, $search_date_startendyear); + +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_endendday = GETPOST('search_date_endendday', 'int'); +$search_date_endendmonth = GETPOST('search_date_endendmonth', 'int'); +$search_date_endendyear = GETPOST('search_date_endendyear', 'int'); +$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear); // Use tzserver +$search_date_endend = dol_mktime(23, 59, 59, $search_date_endendmonth, $search_date_endendday, $search_date_endendyear); $optioncss = GETPOST('optioncss', 'alpha'); @@ -197,11 +208,22 @@ if (empty($reshook)) { $search_amount_vat = ""; $search_amount_ttc = ""; $search_status = ""; - $month_start = ""; - $year_start = ""; - $month_end = ""; - $year_end = ""; - $day_end = ""; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_startendday = ''; + $search_date_startendmonth = ''; + $search_date_startendyear = ''; + $search_date_start = ''; + $search_date_startend = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; + $search_date_endendday = ''; + $search_date_endendmonth = ''; + $search_date_endendyear = ''; + $search_date_end = ''; + $search_date_endend = ''; $toselect = ''; $search_array_options = array(); } @@ -277,9 +299,19 @@ if (!empty($search_ref)) { $sql .= natural_search('d.ref', $search_ref); } // Date Start -$sql .= dolSqlDateFilter("d.date_debut", $day_start, $month_start, $year_start); +if ($search_date_start) { + $sql .= " AND d.date_debut >= '".$db->idate($search_date_start)."'"; +} +if ($search_date_startend) { + $sql .= " AND d.date_debut <= '".$db->idate($search_date_startend)."'"; +} // Date End -$sql .= dolSqlDateFilter("d.date_fin", $day_end, $month_end, $year_end); +if ($search_date_end) { + $sql .= " AND d.date_fin >= '".$db->idate($search_date_end)."'"; +} +if ($search_date_endend) { + $sql .= " AND d.date_fin <= '".$db->idate($search_date_endend)."'"; +} if ($search_amount_ht != '') { $sql .= natural_search('d.total_ht', $search_amount_ht, 1); @@ -342,6 +374,44 @@ if ($resql) { if ($search_ref) { $param .= "&search_ref=".urlencode($search_ref); } + // Start date + if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); + } + if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); + } + if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); + } + if ($search_date_startendday) { + $param .= '&search_date_startendday='.urlencode($search_date_startendday); + } + if ($search_date_startendmonth) { + $param .= '&search_date_startendmonth='.urlencode($search_date_startendmonth); + } + if ($search_date_startendyear) { + $param .= '&search_date_startendyear='.urlencode($search_date_startendyear); + } + // End date + if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); + } + if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); + } + if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); + } + if ($search_date_endendday) { + $param .= '&search_date_endendday='.urlencode($search_date_endendday); + } + if ($search_date_endendmonth) { + $param .= '&search_date_endendmonth='.urlencode($search_date_endendmonth); + } + if ($search_date_endendyear) { + $param .= '&search_date_endendyear='.urlencode($search_date_endendyear); + } if ($search_user) { $param .= "&search_user=".urlencode($search_user); } @@ -489,22 +559,23 @@ if ($resql) { // Date start if (!empty($arrayfields['d.date_debut']['checked'])) { print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - - print ''; - $formother->select_year($year_start, 'year_start', 1, $min_year, $max_year); + print '
    '; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_startend ? $search_date_startend : -1, 'search_date_startend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print ''; } // Date end if (!empty($arrayfields['d.date_fin']['checked'])) { print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($year_end, 'year_end', 1, $min_year, $max_year); + print '
    '; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search_date_endend ? $search_date_endend : -1, 'search_date_endend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; print ''; } // Date valid diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php index b0156c6a475..5649f2144e4 100644 --- a/htdocs/expensereport/note.php +++ b/htdocs/expensereport/note.php @@ -44,6 +44,8 @@ $socid = 0; if ($user->socid) { $socid = $user->socid; } +$hookmanager->initHooks(array('expensereportnote')); + $result = restrictedArea($user, 'expensereport', $id, 'expensereport'); @@ -68,12 +70,17 @@ if ($object->id > 0) { } } - /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 87bac2dde1a..5f8a9f628b5 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -55,8 +55,7 @@ $result = restrictedArea($user, 'expensereport', $id, ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; @@ -225,7 +224,7 @@ print ''.$langs->tra // Company /* print ''.$langs->trans("ThirdParty").''; -print $form->select_company($socid,'socid','',1,1,0,array(),0,'','style="width: 95%"'); +print $form->select_company($socid,'socid','',1,1,0,array(),0,'widthcentpercentminusx maxwidth300',''); print ''; */ // User @@ -234,7 +233,8 @@ $include = ''; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) { $include = 'hierarchy'; } -print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Status print ''.$langs->trans("Status").''; @@ -251,7 +251,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

    '; @@ -274,8 +274,8 @@ foreach ($data as $val) { print ''; print ''.$oldyear.''; print '0'; - print '0'; - print '0'; + print '0'; + print '0'; print ''; } @@ -283,8 +283,8 @@ foreach ($data as $val) { print ''; print ''.$year.''; print ''.$val['nb'].''; - print ''.price(price2num($val['total'], 'MT'), 1).''; - print ''.price(price2num($val['avg'], 'MT'), 1).''; + print ''.price(price2num($val['total'], 'MT'), 1).''; + print ''.price(price2num($val['avg'], 'MT'), 1).''; print ''; $oldyear = $year; } diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index 640f4c17b5d..9264400a71f 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -18,6 +18,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { $modulepart = 'expensereport'; $maxheightmini = 48; $relativepath = (!empty($object->ref) ?dol_sanitizeFileName($object->ref) : '').'/'; $filei = 0; + // Loop on each attached file foreach ($arrayoffiles as $file) { $urlforhref = array(); $filei++; @@ -71,13 +72,13 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { } // If the preview file is found if (file_exists($fileimage)) { - $thumbshown = ''; + $thumbshown = ''; } } } if (empty($urlforhref) || empty($thumbshown)) { - print ''; + print ''; } else { print ''; } @@ -85,7 +86,12 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { print $thumbshown ? $thumbshown : img_mime($minifile); - print '
    '; + print '
    '; + if (empty($urlforhref) || empty($thumbshown)) { + print ''; + } else { + print ''; + } } print '
    '; $checked = ''; @@ -106,7 +112,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) { if (!empty($filenamelinked) && $filenamelinked == $file['relativename']) { $checked = ' checked'; } - print '
    '; + print '
    '; print ''; print '
    '; diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 8c1bf9642b1..b8960572255 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -54,11 +54,12 @@ class Export public $array_export_examplevalues = array(); // array with examples for fields public $array_export_help = array(); // array with tooltip help for fields - // To store export modules + // To store export templates public $hexa; // List of fields in the export profile public $hexafiltervalue; // List of search criteria in the export profile public $datatoexport; public $model_name; // Name of export profile + public $fk_user; public $sqlusedforexport; @@ -720,8 +721,6 @@ class Export $this->db->begin(); - $filter = ''; - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'export_model ('; $sql .= 'label,'; $sql .= 'type,'; @@ -732,11 +731,10 @@ class Export $sql .= "'".$this->db->escape($this->model_name)."',"; $sql .= " '".$this->db->escape($this->datatoexport)."',"; $sql .= " '".$this->db->escape($this->hexa)."',"; - $sql .= ' '.($user->id > 0 ? $user->id : 'null').","; + $sql .= ' '.(isset($this->fk_user) ? (int) $this->fk_user : 'null').","; $sql .= " '".$this->db->escape($this->hexafiltervalue)."'"; $sql .= ")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $this->db->commit(); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index b3d0cf49a32..c0a48b97222 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -335,6 +335,7 @@ if ($action == 'add_export_model') { $objexport->datatoexport = $datatoexport; $objexport->hexa = $hexa; $objexport->hexafiltervalue = $hexafiltervalue; + $objexport->fk_user = (GETPOST('visibility', 'aZ09') == 'all' ? 0 : $user->id); $result = $objexport->create($user); if ($result >= 0) { @@ -516,11 +517,7 @@ if ($step == 2 && $datatoexport) { print ''; print '
    '; print ''.$langs->trans("SelectExportFields").' '; - if (empty($conf->global->EXPORTS_SHARE_MODELS)) { - $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); - } else { - $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1); - } + $htmlother->select_export_model($exportmodelid, 'exportmodelid', $datatoexport, 1, $user->id); print ' '; print ''; print '
    '; @@ -1007,20 +1004,28 @@ if ($step == 4 && $datatoexport) { print ''; print ''; print ''; - print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; + print ''; + $tmpuser = new User($db); + // List of existing export profils - $sql = "SELECT rowid, label"; + $sql = "SELECT rowid, label, fk_user, entity"; $sql .= " FROM ".MAIN_DB_PREFIX."export_model"; $sql .= " WHERE type = '".$db->escape($datatoexport)."'"; - if (empty($conf->global->EXPORTS_SHARE_MODELS)) { - $sql .= " AND fk_user=".$user->id; + if (empty($conf->global->EXPORTS_SHARE_MODELS)) { // EXPORTS_SHARE_MODELS means all templates are visible, whatever is owner. + $sql .= " AND fk_user IN (0, ".((int) $user->id).")"; } $sql .= " ORDER BY rowid"; $resql = $db->query($sql); @@ -1029,9 +1034,19 @@ if ($step == 4 && $datatoexport) { $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 51f417399df..799aadd24cd 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index b31ced3556f..e0fa5b90f4c 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2021 NextGestion +/* Copyright (C) 2017-2021 Laurent Destailleur + * Copyright (C) 2021 NextGestion * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,63 +22,13 @@ * \brief Page to create/edit/view partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "other")); @@ -164,23 +114,45 @@ if (empty($reshook)) { $fk_partner = ($managedfor == 'member') ? GETPOST('fk_member', 'int') : GETPOST('fk_soc', 'int'); $obj_partner = ($managedfor == 'member') ? $object->fk_member : $object->fk_soc; - if ($action == 'add' || ($action == 'update' && $obj_partner != $fk_partner)) { - $fpartnership = new Partnership($db); - - $partnershipid = $fpartnership->fetch(0, "", $fk_partner); - if ($partnershipid > 0) { - setEventMessages($langs->trans('PartnershipAlreadyExist').' : '.$fpartnership->getNomUrl(0, '', 1), '', 'errors'); - $action = ($action == 'add') ? 'create' : 'edit'; - } - } - - $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record - // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + $triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record + // Action accept object - if ($action == 'confirm_accept' && $confirm == 'yes' && $permissiontoadd) { + if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) { + $result = $object->validate($user); + if ($result >= 0) { + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { + if (method_exists($object, 'generateDocument')) { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); + } + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + $newlang = $object->thirdparty->default_lang; + } + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + + $ret = $object->fetch($id); // Reload to get new records + + $model = $object->model_pdf; + + $retgen = $object->generateDocument($model, $outputlangs, 0, 0, 0); + if ($retgen < 0) { + setEventMessages($object->error, $object->errors, 'warnings'); + } + } + } + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } elseif ($action == 'confirm_accept' && $confirm == 'yes' && $permissiontoadd) { $result = $object->accept($user); if ($result >= 0) { // Define output language @@ -203,7 +175,7 @@ if (empty($reshook)) { $model = $object->model_pdf; - $retgen = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + $retgen = $object->generateDocument($model, $outputlangs, 0, 0, 0); if ($retgen < 0) { setEventMessages($object->error, $object->errors, 'warnings'); } @@ -275,8 +247,6 @@ if ($object->id > 0 && $object->status == $object::STATUS_REFUSED) $object->fiel /* * View - * - * Put here all code to build page */ $form = new Form($db); @@ -287,22 +257,6 @@ $title = $langs->trans("Partnership"); $help_url = ''; llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', 'object_'.$object->picto); @@ -417,7 +371,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1); } - // Refuse confirmatio + // Refuse confirmation if ($action == 'refuse') { //Form to close proposal (signed or not) $formquestion = array( @@ -435,22 +389,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToRefuse'), $text, 'confirm_refuse', $formquestion, '', 1, 250); } - // Confirmation of action xxxx - if ($action == 'xxx') { - $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - // Call Hook formConfirm $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook @@ -568,10 +506,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' + '; @@ -623,24 +562,35 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); + } + + if ($object->status == $object::STATUS_DRAFT) { + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); } // Back to draft if ($object->status != $object::STATUS_DRAFT) { - print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('SetToDraft'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken(), '', $permissiontoadd); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit', '', $permissiontoadd); - - // Accept + // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); - //print dolGetButtonAction($langs->trans('Accept'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes', '', 0); - print ''.$langs->trans("Validate").''; + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); + } + } + + // Approve + if ($object->status == $object::STATUS_VALIDATED) { + if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { + print dolGetButtonAction($langs->trans('Approved'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_accept&confirm=yes&token='.newToken(), '', $permissiontoadd); + } else { + $langs->load("errors"); + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Approved"), 'default', '#', '', 0); } } @@ -656,8 +606,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Refuse if ($permissiontoadd) { - if ($object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { - print ''.$langs->trans("Refuse").''."\n"; + if ($object->status != $object::STATUS_DRAFT && $object->status != $object::STATUS_ACCEPTED && $object->status != $object::STATUS_CANCELED && $object->status != $object::STATUS_REFUSED) { + print dolGetButtonAction($langs->trans('Refuse'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=refuse&token='.newToken(), '', $permissiontoadd); } } diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 632047acf25..1c416cf690c 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -22,41 +22,14 @@ * \brief Tab for contacts linked to Partnership */ + // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies", "other", "mails")); diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index d6f89c07d00..e7fae7ee7ff 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies", "other", "mails")); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 1ae90d0d4cf..f5b72dca2d2 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -22,57 +22,8 @@ * \brief List page for partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -80,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; // load partnership libraries -require_once __DIR__.'/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); @@ -88,12 +39,12 @@ require_once __DIR__.'/class/partnership.class.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "members", "other")); -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button +$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'partnershiplist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -113,9 +64,9 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical objects -$object = new Partnership($db); -$extrafields = new ExtraFields($db); -$adherent = new Adherent($db); +$object = new Partnership($db); +$extrafields = new ExtraFields($db); +$adherent = new Adherent($db); $diroutputmassaction = $conf->partnership->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('partnershiplist')); // Note that conf->hooks_modules contains array @@ -131,7 +82,7 @@ if ($managedfor != 'member' && $sortfield == 'd.datefin') $sortfield = ''; // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { - reset($object->fields); // Reset is required to avoid key() to return null. + reset($object->fields); // Reset is required to avoid key() to return null. $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { @@ -159,7 +110,7 @@ if ($filter) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -175,7 +126,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } @@ -185,8 +136,8 @@ 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->partnership->read; -$permissiontoadd = $user->rights->partnership->write; +$permissiontoread = $user->rights->partnership->read; +$permissiontoadd = $user->rights->partnership->write; $permissiontodelete = $user->rights->partnership->delete; // Security check @@ -354,13 +305,13 @@ foreach ($search as $key => $val) { } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + $sql .= " AND t.".$columnName." <= '".$db->idate($search[$key])."'"; } } } @@ -447,20 +398,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); -// Example : Adding jquery code -print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -587,7 +524,7 @@ foreach ($object->fields as $key => $val) { print ''; $var = true; - if ($num > 0) - { + if ($num > 0) { $i = 0; - while ($i < $num) - { - + while ($i < $num) { $obj = $db->fetch_object($resql); print '"; } - } - else - { - + } else { print ''; } print "
    '.$langs->trans("ExportModelName").' '.$langs->trans("Visibility").'
    '; + print ''; + $arrayvisibility = array('private'=>$langs->trans("Private"), 'all'=>$langs->trans("Everybody")); + print $form->selectarray('visibility', $arrayvisibility, 'private'); + print ''; print ''; print '
    '; print $obj->label; - print ''; + print ''; + if (empty($obj->fk_user)) { + print $langs->trans("Everybody"); + } else { + $tmpuser->fetch($obj->fk_user); + print $tmpuser->getNomUrl(1); + } + print ''; print 'rowid.'">'; print img_delete(); print ''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index fb031d81583..44ff46b233c 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -388,7 +388,7 @@ if ($action == 'create') { $sql = 'SELECT l.rowid, l.description, l.duree'; $sql .= " FROM ".MAIN_DB_PREFIX."fichinterdet as l"; - $sql .= " WHERE l.fk_fichinter= ".$object->id; + $sql .= " WHERE l.fk_fichinter= ".((int) $object->id); //$sql.= " AND l.fk_product is null "; $sql .= " ORDER BY l.rang"; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 88c5a1cefc0..d15f036b963 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -51,7 +51,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->loadLangs(array('bills', 'companies', 'interventions')); +$langs->loadLangs(array('bills', 'companies', 'interventions', 'stocks')); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); @@ -1079,7 +1079,7 @@ if ($action == 'create') { // Confirm back to open if ($action == 'reopen') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Reopen'), $langs->trans('ConfirmReopenIntervention', $object->ref), 'confirm_reopen', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReopenIntervention', $object->ref), 'confirm_reopen', '', 0, 1); } // Confirm deletion of line @@ -1546,8 +1546,9 @@ if ($action == 'create') { // Validate if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) { - print ''; + print ''; + } else { + print '
    '.$langs->trans("Validate").'
    '; } } @@ -1582,7 +1583,7 @@ if ($action == 'create') { } } - // create intervention model + // Create intervention model if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print '
    '; print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 1c1c1ab37be..0bb5d2522ab 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -57,7 +57,7 @@ class Fichinter extends CommonObject 'datee' =>array('type'=>'date', 'label'=>'Datee', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'datet' =>array('type'=>'date', 'label'=>'Datet', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'duree' =>array('type'=>'double', 'label'=>'Duree', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>1), + 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>105, 'showoncombobox'=>2), 'note_private' =>array('type'=>'text', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), 'note_public' =>array('type'=>'text', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>115), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>120), @@ -379,8 +379,8 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter SET "; $sql .= "description = '".$this->db->escape($this->description)."'"; - $sql .= ", duree = ".$this->duration; - $sql .= ", fk_projet = ".$this->fk_project; + $sql .= ", duree = ".((int) $this->duration); + $sql .= ", fk_projet = ".((int) $this->fk_project); $sql .= ", note_private = ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null"); $sql .= ", note_public = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : "null"); $sql .= ", fk_user_modif = ".$user->id; @@ -1499,8 +1499,8 @@ class FichinterLigne extends CommonObjectLine $sql .= " VALUES (".$this->fk_fichinter.","; $sql .= " '".$this->db->escape($this->desc)."',"; $sql .= " '".$this->db->idate($this->datei)."',"; - $sql .= " ".$this->duration.","; - $sql .= ' '.$rangToUse; + $sql .= " ".((int) $this->duration).","; + $sql .= ' '.((int) $rangToUse); $sql .= ')'; dol_syslog("FichinterLigne::insert", LOG_DEBUG); diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 576e6be0e5e..71f52212978 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -170,7 +170,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'ficheinter'; - $permission = $user->rights->ficheinter->creer; + $permissiontoadd = $user->rights->ficheinter->creer; $permtoedit = $user->rights->ficheinter->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 8ddba32a661..3f86fc18795 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -225,7 +226,7 @@ if (!empty($conf->projet->enabled)) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } if (!empty($conf->contrat->enabled)) { - $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_supplier, c.ref_supplier as contrat_ref_supplier"; + $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier"; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -244,21 +245,21 @@ if (!empty($conf->projet->enabled)) { if (!empty($conf->contrat->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } - if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (f.rowid = ef.fk_object)"; } if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; } + // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; + if (!$user->rights->societe->client->voir && empty($socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } - $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; $sql .= " AND f.fk_soc = s.rowid"; @@ -572,6 +573,9 @@ if ($resql) { $total = 0; $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val'] = array(); + $totalarray['val']['fd.duree'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index fcc790bf8c2..01a8d82cf5a 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -42,6 +42,7 @@ $action = GETPOST('action', 'aZ09'); if ($user->socid) { $socid = $user->socid; } +$hookmanager->initHooks(array('fichinternote')); $result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $object = new Fichinter($db); @@ -53,7 +54,13 @@ $permissionnote = $user->rights->ficheinter->creer; // Used by the include of ac * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 29a5f9976b0..7a7adb639b3 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -44,8 +44,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $object_status = GETPOST('object_status', 'intcomma'); @@ -211,48 +210,47 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
    '; -//if (empty($socid)) -//{ - // Show filter box - print '
    '; - print ''; - print ''; +// Show filter box +print ''; +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; +print ''; +print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; - $filter = 's.client IN (1,2,3)'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
    '.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - // Status - print '
    '.$langs->trans("Status").''; - $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short - $liststatus = $objectstatic->statuts_short; +print ''; +print ''; +// Company +print ''; +// User +print ''; - // Year - print ''; +// Year +print ''; - print ''; - print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; +$filter = 's.client IN (1,2,3)'; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
    '.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +// Status +print '
    '.$langs->trans("Status").''; +$tmp = $objectstatic->LibStatut(0); // To force load of $this->statuts_short +$liststatus = $objectstatic->statuts_short; if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 } - print $form->selectarray('object_status', $liststatus, $object_status, 1, 0, 0, '', 1); - print '
    '.$langs->trans("Year").''; +print $form->selectarray('object_status', $liststatus, $object_status, 1, 0, 0, '', 1); +print '
    '.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
    '; - print ''; - print '

    '; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
    '; +print ''; +print '

    '; print '
    '; print ''; diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 2c7795b9ac8..1f7a51c706d 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '14.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '15.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { @@ -349,7 +349,7 @@ if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_ if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) { $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass); - $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this as it is used to know the password was initially crypted + $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially crypted } else { $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass); } diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index e0cd9beff0c..889484cec44 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -43,7 +43,7 @@ $idprod = GETPOST('idprod', 'int'); $prices = array(); // Load translation files required by the page -$langs->loadLangs(array("stocks", "margins")); +$langs->loadLangs(array("stocks", "margins", "products")); /* diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 90934062910..866fd31318e 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -592,7 +592,7 @@ if ($object->id > 0) { $sql .= " WHERE p.fk_soc =".$object->id; $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " ORDER BY p.date_valid DESC"; - $sql .= " ".$db->plimit($MAXLIST); + $sql .= $db->plimit($MAXLIST); $resql = $db->query($sql); if ($resql) { @@ -694,7 +694,8 @@ if ($object->id > 0) { $sql .= " WHERE p.fk_soc =".$object->id; $sql .= " AND p.entity IN (".getEntity('commande_fournisseur').")"; $sql .= " ORDER BY p.date_commande DESC"; - $sql .= " ".$db->plimit($MAXLIST); + $sql .= $db->plimit($MAXLIST); + $resql = $db->query($sql); if ($resql) { $i = 0; @@ -842,9 +843,9 @@ if ($object->id > 0) { if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { $langs->load("orders"); if ($object->status == 1) { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddSupplierOrderShort").''; } else { - print ''.$langs->trans("AddOrder").''; + print ''.$langs->trans("AddSupplierOrderShort").''; } } diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 34939bb599a..df1bf36b723 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -155,7 +155,7 @@ class SupplierInvoices extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 09c9209629f..d4eedcd0fd9 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -171,7 +171,7 @@ class SupplierOrders extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 83251c93499..ff84e67122c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2021 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,6 +157,8 @@ class CommandeFournisseur extends CommonOrder public $user_approve_id; public $user_approve_id2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set + public $refuse_note; + public $extraparams = array(); /** @@ -280,6 +283,11 @@ class CommandeFournisseur extends CommonOrder const STATUS_REFUSED = 9; + /** + * The constant used into source field to track the order was generated by the replenishement feature + */ + const SOURCE_ID_REPLENISHMENT = 42; + /** @@ -453,7 +461,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,"; $sql .= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,"; $sql .= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,"; - $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,"; + $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch, p.barcode as product_barcode,"; $sql .= " l.fk_unit,"; $sql .= " l.date_start, l.date_end,"; $sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc'; @@ -463,7 +471,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".$this->socid; } $sql .= " WHERE l.fk_commande = ".$this->id; if ($only_product) { @@ -509,6 +517,8 @@ class CommandeFournisseur extends CommonOrder $line->libelle = $objp->product_label; // deprecated $line->product_label = $objp->product_label; $line->product_desc = $objp->product_desc; + $line->product_tobatch = $objp->product_tobatch; + $line->product_barcode = $objp->product_barcode; $line->ref = $objp->product_ref; // Ref of product $line->product_ref = $objp->product_ref; // Ref of product @@ -690,7 +700,7 @@ class CommandeFournisseur extends CommonOrder public function LibStatut($status, $mode = 0, $billed = 0) { // phpcs:enable - global $conf, $langs; + global $conf, $langs, $hookmanager; if (empty($this->statuts) || empty($this->statutshort)) { $langs->load('orders'); @@ -749,6 +759,11 @@ class CommandeFournisseur extends CommonOrder $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); + $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed); + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook + if ($reshook > 0) { + return $hookmanager->resPrint; + } return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); } @@ -3005,13 +3020,13 @@ class CommandeFournisseur extends CommonOrder $response->warning_delay = $conf->commande->fournisseur->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("SuppliersOrdersToProcess"); $response->labelShort = $langs->trans("Opened"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=1,2&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img = img_object('', "order"); if ($mode === 'awaiting') { $response->label = $langs->trans("SuppliersOrdersAwaitingReception"); $response->labelShort = $langs->trans("AwaitingReception"); - $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?statut=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; + $response->url = DOL_URL_ROOT.'/fourn/commande/list.php?search_status=3,4&mainmenu=commercial&leftmenu=orders_suppliers'; } while ($obj = $this->db->fetch_object($resql)) { @@ -3046,7 +3061,7 @@ class CommandeFournisseur extends CommonOrder if ($this->methode_commande_id > 0) { $sql = "SELECT rowid, code, libelle as label"; $sql .= " FROM ".MAIN_DB_PREFIX.'c_input_method'; - $sql .= " WHERE active=1 AND rowid = ".$this->db->escape($this->methode_commande_id); + $sql .= " WHERE active=1 AND rowid = ".((int) $this->methode_commande_id); $resql = $this->db->query($sql); if ($resql) { @@ -3669,19 +3684,19 @@ class CommandeFournisseurLigne extends CommonOrderLine $sql .= "'".$this->db->escape($this->rang)."',"; $sql .= "'".$this->db->escape($this->qty)."', "; $sql .= " ".(empty($this->vat_src_code) ? "''" : "'".$this->db->escape($this->vat_src_code)."'").","; - $sql .= " ".$this->tva_tx.", "; - $sql .= " ".$this->localtax1_tx.","; - $sql .= " ".$this->localtax2_tx.","; + $sql .= " ".price2num($this->tva_tx).", "; + $sql .= " ".price2num($this->localtax1_tx).","; + $sql .= " ".price2num($this->localtax2_tx).","; $sql .= " '".$this->db->escape($this->localtax1_type)."',"; $sql .= " '".$this->db->escape($this->localtax2_type)."',"; - $sql .= " ".$this->remise_percent.", ".price2num($this->subprice, 'MU').", '".$this->db->escape($this->ref_supplier)."',"; + $sql .= " ".((float) $this->remise_percent).", ".price2num($this->subprice, 'MU').", '".$this->db->escape($this->ref_supplier)."',"; $sql .= " ".price2num($this->total_ht).","; $sql .= " ".price2num($this->total_tva).","; $sql .= " ".price2num($this->total_localtax1).","; $sql .= " ".price2num($this->total_localtax2).","; $sql .= " ".price2num($this->total_ttc).","; $sql .= ($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : "null"); - $sql .= ", ".($this->fk_multicurrency ? $this->fk_multicurrency : "null"); + $sql .= ", ".($this->fk_multicurrency ? ((int) $this->fk_multicurrency) : "null"); $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", ".($this->multicurrency_subprice ? price2num($this->multicurrency_subprice) : '0'); $sql .= ", ".($this->multicurrency_total_ht ? price2num($this->multicurrency_total_ht) : '0'); diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 0f8b8341a3d..cd1ff267fb7 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -220,13 +220,12 @@ class CommandeFournisseurDispatch extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_CREATE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Call triggers + $result=$this->call_trigger('LINERECEPTION_CREATE', $user); + if ($result < 0) { + $error++; + } + // End call triggers } } @@ -333,7 +332,6 @@ class CommandeFournisseurDispatch extends CommonObject */ public function update($user, $notrigger = 0) { - global $conf, $langs; $error = 0; // Clean parameters @@ -411,12 +409,12 @@ class CommandeFournisseurDispatch extends CommonObject } if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you + // Call triggers $result = $this->call_trigger('LINERECEPTION_UPDATE', $user); if ($result < 0) { $error++; } - //// End call triggers + // End call triggers } } @@ -444,24 +442,22 @@ class CommandeFournisseurDispatch extends CommonObject */ public function delete($user, $notrigger = 0) { - global $conf, $langs; $error = 0; $this->db->begin(); if (!$error) { if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Call triggers + $result = $this->call_trigger('LINERECEPTION_DELETE', $user); + if ($result < 0) { + $error++; + } + // End call triggers } } - // Remove extrafields + // Remove extrafields if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) { @@ -496,7 +492,6 @@ class CommandeFournisseurDispatch extends CommonObject } - /** * Load an object from its id and create a new one in database * diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 78925c74b9f..7b5bbbc50c5 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -214,6 +214,11 @@ class FactureFournisseur extends CommonInvoice public $mode_reglement_id; public $mode_reglement_code; + /** + * @var int transport mode id + */ + public $transport_mode_id; + public $extraparams = array(); /** @@ -670,6 +675,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ' s.nom as socnom, s.rowid as socid,'; $sql .= ' t.fk_incoterms, t.location_incoterms,'; $sql .= " i.libelle as label_incoterms,"; + $sql .= ' t.fk_transport_mode,'; $sql .= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; @@ -708,7 +714,7 @@ class FactureFournisseur extends CommonInvoice $this->remise = $obj->remise; $this->close_code = $obj->close_code; $this->close_note = $obj->close_note; - $this->tva = $obj->tva; + $this->tva = $obj->tva; $this->total_localtax1 = $obj->localtax1; $this->total_localtax2 = $obj->localtax2; $this->total_ht = $obj->total_ht; @@ -723,7 +729,7 @@ class FactureFournisseur extends CommonInvoice $this->fk_project = $obj->fk_project; $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_label; // deprecated + $this->cond_reglement = $obj->cond_reglement_label; // deprecated $this->cond_reglement_label = $obj->cond_reglement_label; $this->cond_reglement_doc = $obj->cond_reglement_doc; $this->fk_account = $obj->fk_account; @@ -742,14 +748,15 @@ class FactureFournisseur extends CommonInvoice $this->fk_incoterms = $obj->fk_incoterms; $this->location_incoterms = $obj->location_incoterms; $this->label_incoterms = $obj->label_incoterms; + $this->transport_mode_id = $obj->fk_transport_mode; // Multicurrency - $this->fk_multicurrency = $obj->fk_multicurrency; + $this->fk_multicurrency = $obj->fk_multicurrency; $this->multicurrency_code = $obj->multicurrency_code; - $this->multicurrency_tx = $obj->multicurrency_tx; + $this->multicurrency_tx = $obj->multicurrency_tx; $this->multicurrency_total_ht = $obj->multicurrency_total_ht; - $this->multicurrency_total_tva = $obj->multicurrency_total_tva; - $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + $this->multicurrency_total_tva = $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; $this->extraparams = (array) json_decode($obj->extraparams, true); @@ -1361,7 +1368,7 @@ class FactureFournisseur extends CommonInvoice } $sql .= ', fk_user_closing = '.$user->id; $sql .= ", date_closing = '".$this->db->idate($now)."'"; - $sql .= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.((int) $this->id); $resql = $this->db->query($sql); if ($resql) { @@ -1417,18 +1424,17 @@ class FactureFournisseur extends CommonInvoice */ public function setUnpaid($user) { - global $conf, $langs; $error = 0; $this->db->begin(); $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn'; - $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null'; + $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null,'; $sql .= ' date_closing=null,'; $sql .= ' fk_user_closing=null'; - $sql .= ' WHERE rowid = '.$this->id; + $sql .= ' WHERE rowid = '.((int) $this->id); - dol_syslog("FactureFournisseur::set_unpaid", LOG_DEBUG); + dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { // Call trigger @@ -1955,7 +1961,7 @@ class FactureFournisseur extends CommonInvoice $this->line->remise_percent = $remise_percent; $this->line->date_start = $date_start; $this->line->date_end = $date_end; - $this->line->ventil = $ventil; + $this->line->fk_code_ventilation = $ventil; $this->line->rang = $rang; $this->line->info_bits = $info_bits; $this->line->fk_remise_except = $fk_remise_except; @@ -3228,8 +3234,8 @@ class SupplierInvoiceLine extends CommonObjectLine $this->ref_supplier = $obj->ref_supplier; $this->product_desc = $obj->product_desc; - $this->subprice = $obj->pu_ht; - $this->pu_ht = $obj->pu_ht; + $this->subprice = $obj->pu_ht; + $this->pu_ht = $obj->pu_ht; $this->pu_ttc = $obj->pu_ttc; $this->tva_tx = $obj->tva_tx; $this->localtax1_tx = $obj->localtax1_tx; @@ -3239,7 +3245,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->qty = $obj->qty; $this->remise_percent = $obj->remise_percent; - $this->fk_remise_except = $obj->fk_remise_except; + $this->fk_remise_except = $obj->fk_remise_except; $this->tva = $obj->total_tva; // deprecated $this->total_ht = $obj->total_ht; $this->total_tva = $obj->total_tva; @@ -3395,8 +3401,8 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", pu_ttc = ".price2num($this->pu_ttc); $sql .= ", qty = ".price2num($this->qty); $sql .= ", remise_percent = ".price2num($this->remise_percent); - if ($this->fk_remise_except) $sql.= ", fk_remise_except=".$this->fk_remise_except; - else $sql.= ", fk_remise_except=null"; + if ($this->fk_remise_except) $sql .= ", fk_remise_except=".((int) $this->fk_remise_except); + else $sql .= ", fk_remise_except=null"; $sql .= ", vat_src_code = '".$this->db->escape(empty($this->vat_src_code) ? '' : $this->vat_src_code)."'"; $sql .= ", tva_tx = ".price2num($this->tva_tx); $sql .= ", localtax1_tx = ".price2num($this->localtax1_tx); @@ -3408,10 +3414,10 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= ", total_localtax1= ".price2num($this->total_localtax1); $sql .= ", total_localtax2= ".price2num($this->total_localtax2); $sql .= ", total_ttc = ".price2num($this->total_ttc); - $sql .= ", fk_product = ".$fk_product; - $sql .= ", product_type = ".$this->product_type; - $sql .= ", info_bits = ".$this->info_bits; - $sql .= ", fk_unit = ".$fk_unit; + $sql .= ", fk_product = ".((int) $fk_product); + $sql .= ", product_type = ".((int) $this->product_type); + $sql .= ", info_bits = ".((int) $this->info_bits); + $sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null'); // Multicurrency $sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice).""; @@ -3419,7 +3425,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= " , multicurrency_total_tva=".price2num($this->multicurrency_total_tva).""; $sql .= " , multicurrency_total_ttc=".price2num($this->multicurrency_total_ttc).""; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); @@ -3544,7 +3550,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->error = 'ErrorProductTypeMustBe0orMore'; return -1; } - if (!empty($this->fk_product)) { + if (!empty($this->fk_product) && $this->fk_product > 0) { // Check product exists $result = Product::isExistingObject('product', $this->fk_product); if ($result <= 0) { @@ -3577,18 +3583,18 @@ class SupplierInvoiceLine extends CommonObjectLine $sql .= " ".price2num($this->localtax2_tx).","; $sql .= " '".$this->db->escape($this->localtax1_type)."',"; $sql .= " '".$this->db->escape($this->localtax2_type)."',"; - $sql .= ' '.(!empty($this->fk_product) ? $this->fk_product : "null").','; - $sql .= " ".$this->product_type.","; + $sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").','; + $sql .= " ".((int) $this->product_type).","; $sql .= " ".price2num($this->remise_percent).","; - $sql .= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").','; + $sql .= ' '.(! empty($this->fk_remise_except) ? ((int) $this->fk_remise_except) : "null").','; $sql .= " ".price2num($this->subprice).","; $sql .= " ".(!empty($this->qty) ?price2num($this->total_ttc / $this->qty) : price2num($this->total_ttc)).","; $sql .= " ".(!empty($this->date_start) ? "'".$this->db->idate($this->date_start)."'" : "null").","; $sql .= " ".(!empty($this->date_end) ? "'".$this->db->idate($this->date_end)."'" : "null").","; $sql .= ' '.(!empty($this->fk_code_ventilation) ? $this->fk_code_ventilation : 0).','; - $sql .= ' '.$this->rang.','; - $sql .= ' '.$this->special_code.','; - $sql .= " '".$this->db->escape($this->info_bits)."',"; + $sql .= ' '.((int) $this->rang).','; + $sql .= ' '.((int) $this->special_code).','; + $sql .= " ".((int) $this->info_bits).","; $sql .= " ".price2num($this->total_ht).","; $sql .= " ".price2num($this->total_tva).","; $sql .= " ".price2num($this->total_ttc).","; @@ -3627,7 +3633,7 @@ class SupplierInvoiceLine extends CommonObjectLine if ($discount->fk_facture_line > 0) { if (empty($noerrorifdiscountalreadylinked)) { $this->error = $langs->trans("ErrorDiscountAlreadyUsed", $discount->id); - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } @@ -3635,20 +3641,20 @@ class SupplierInvoiceLine extends CommonObjectLine $result = $discount->link_to_invoice($this->rowid, 0); if ($result < 0) { $this->error = $discount->error; - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } } else { $this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } else { $this->error = $discount->error; - dol_syslog(get_class($this) . "::insert Error " . $this->error, LOG_ERR); + dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 21b4ec377a2..3eaed8d27b8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -455,28 +455,28 @@ class ProductFournisseur extends Product $sql .= (isset($fk_multicurrency) ? "'".$this->db->escape($fk_multicurrency)."'" : 'null').","; $sql .= (isset($multicurrency_code) ? "'".$this->db->escape($multicurrency_code)."'" : 'null').","; $sql .= " '".$this->db->idate($now)."',"; - $sql .= " ".$this->id.","; - $sql .= " ".$fourn->id.","; + $sql .= " ".((int) $this->id).","; + $sql .= " ".((int) $fourn->id).","; $sql .= " '".$this->db->escape($ref_fourn)."',"; $sql .= " '".$this->db->escape($desc_fourn)."',"; $sql .= " ".$user->id.","; - $sql .= " ".$buyprice.","; - $sql .= " ".$qty.","; - $sql .= " ".$remise_percent.","; - $sql .= " ".$remise.","; - $sql .= " ".$unitBuyPrice.","; - $sql .= " ".$tva_tx.","; - $sql .= " ".$charges.","; - $sql .= " ".$availability.","; + $sql .= " ".price2num($buyprice).","; + $sql .= " ".((float) $qty).","; + $sql .= " ".((float) $remise_percent).","; + $sql .= " ".((float) $remise).","; + $sql .= " ".price2num($unitBuyPrice).","; + $sql .= " ".price2num($tva_tx).","; + $sql .= " ".price2num($charges).","; + $sql .= " ".((int) $availability).","; $sql .= " ".($newdefaultvatcode ? "'".$this->db->escape($newdefaultvatcode)."'" : "null").","; - $sql .= " ".$newnpr.","; + $sql .= " ".((int) $newnpr).","; $sql .= $conf->entity.","; - $sql .= ($delivery_time_days != '' ? $delivery_time_days : 'null').","; + $sql .= ($delivery_time_days != '' ? ((int) $delivery_time_days) : 'null').","; $sql .= (empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'").","; $sql .= (empty($barcode) ? 'NULL' : "'".$this->db->escape($barcode)."'").","; $sql .= (empty($fk_barcode_type) ? 'NULL' : "'".$this->db->escape($fk_barcode_type)."'"); if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) { - $sql .= ", ".(empty($this->packaging) ? 1 : $this->db->escape($this->packaging)); + $sql .= ", ".(empty($this->packaging) ? '1' : "'".$this->db->escape($this->packaging)."'"); } $sql .= ")"; @@ -789,14 +789,14 @@ class ProductFournisseur extends Product $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; $sql .= " AND pfp.entity = ".$conf->entity; // only current entity - $sql .= " AND pfp.fk_product = ".$prodid; + $sql .= " AND pfp.fk_product = ".((int) $prodid); $sql .= " AND pfp.fk_soc = s.rowid"; $sql .= " AND s.status = 1"; // only enabled society if ($qty > 0) { - $sql .= " AND pfp.quantity <= ".$qty; + $sql .= " AND pfp.quantity <= ".((float) $qty); } if ($socid > 0) { - $sql .= ' AND pfp.fk_soc = '.$socid; + $sql .= ' AND pfp.fk_soc = '.((int) $socid); } dol_syslog(get_class($this)."::find_min_price_product_fournisseur", LOG_DEBUG); @@ -1001,7 +1001,7 @@ class ProductFournisseur extends Product $sql .= " WHERE pfp.entity IN (".getEntity('productprice').")"; $sql .= " AND pfpl.fk_user = u.rowid"; $sql .= " AND pfp.rowid = pfpl.fk_product_fournisseur"; - $sql .= " AND pfpl.fk_product_fournisseur = ".$product_fourn_price_id; + $sql .= " AND pfpl.fk_product_fournisseur = ".((int) $product_fourn_price_id); if (empty($sortfield)) { $sql .= " ORDER BY pfpl.datec"; } else { @@ -1253,10 +1253,10 @@ class ProductFournisseur extends Product $sql .= (isset($fk_multicurrency) ? "'".$this->db->escape($fk_multicurrency)."'" : 'null').","; $sql .= (isset($multicurrency_code) ? "'".$this->db->escape($multicurrency_code)."'" : 'null').","; $sql .= "'".$this->db->idate($datec)."',"; - $sql .= " ".$this->product_fourn_price_id.","; + $sql .= " ".((int) $this->product_fourn_price_id).","; $sql .= " ".$user->id.","; $sql .= " ".price2num($buyprice).","; - $sql .= " ".$qty; + $sql .= " ".price2num($qty); $sql .= ")"; $resql = $this->db->query($sql); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 9c201497566..0affc7dcce4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -66,12 +66,15 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'purchaseordercard'; // To manage different context of search + +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); + $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $lineid = GETPOST('lineid', 'int'); - -$lineid = GETPOST('lineid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility @@ -153,12 +156,16 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($cancel) { - if (!empty($backtopage)) { - header("Location: ".$backtopage); - exit; + $backurlforlist = DOL_URL_ROOT.'/fourn/commande/list.php'.($socid > 0 ? '&socid='.((int) $socid) : ''); + + if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { + $backtopage = $backurlforlist; + } else { + $backtopage = DOL_URL_ROOT.'/fourn/commande/card.php?id='.($id > 0 ? $id : '__ID__'); + } } - $action = ''; } include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once @@ -960,6 +967,9 @@ if (empty($reshook)) { } if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) { + if (GETPOST('refuse_note')) { + $object->refuse_note = GETPOST('refuse_note'); + } $result = $object->refuse($user); if ($result > 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); @@ -973,7 +983,9 @@ if (empty($reshook)) { if ($action == 'commande') { $methodecommande = GETPOST('methodecommande', 'int'); - if ($methodecommande <= 0) { + if ($cancel) { + $action = ''; + } elseif ($methodecommande <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors'); $action = 'makeorder'; } @@ -1049,36 +1061,43 @@ if (empty($reshook)) { // Set status of reception (complete, partial, ...) if ($action == 'livraison' && $usercanreceived) { - $db->begin(); + if ($cancel) { + $action = ''; + } else { + $db->begin(); - if (GETPOST("type") != '') { - $date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); + if (GETPOST("type") != '') { + $date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); - $result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can' - if ($result > 0) { - $langs->load("deliveries"); - setEventMessages($langs->trans("DeliveryStateSaved"), null); - $action = ''; - } elseif ($result == -3) { - $error++; - setEventMessages($object->error, $object->errors, 'errors'); + $result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can' + if ($result > 0) { + $langs->load("deliveries"); + setEventMessages($langs->trans("DeliveryStateSaved"), null); + $action = ''; + } elseif ($result == -3) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } else { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } } else { $error++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); } - } else { - $error++; - setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors'); - } - if (!$error) { - $db->commit(); - } else { - $db->rollback(); + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } } } if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder) { + if (GETPOST('cancel_note')) { + $object->cancel_note = GETPOST('cancel_note'); + } $result = $object->cancel($user); if ($result > 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); @@ -1256,6 +1275,8 @@ if (empty($reshook)) { $tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id); } + $object->special_code = $lines[$i]->special_code; + $result = $object->addline( $desc, $lines[$i]->subprice, @@ -1570,10 +1591,16 @@ if ($action == 'create') { print '
    '; print ''; print ''; - print ''."\n"; print ''; print ''; print ''; + if ($backtopage) { + print ''; + } + if ($backtopageforcancel) { + print ''; + } + if (!empty($currency_tx)) { print ''; } @@ -1589,9 +1616,9 @@ if ($action == 'create') { print '
    '; print ''; print ''; - print ''; + print ''; print "
    '.$langs->trans('Supplier').''; - if ($socid > 0) { + if ($societe->id > 0) { print $societe->getNomUrl(1); - print ''; + print ''; } else { print img_picto('', 'company').$form->select_company((empty($socid) ? '' : $socid), 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // reload page to retrieve customer informations @@ -1871,14 +1898,32 @@ if ($action == 'create') { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ApproveThisOrder"), $text, "confirm_".$action, $formquestion, 1, 1, 240); } - // Confirmation de la desapprobation + // Confirmation of disapproval if ($action == 'refuse') { - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", '', 0, 1); + $formquestion = array( + array( + 'type' => 'text', + 'name' => 'refuse_note', + 'label' => $langs->trans("Reason"), + 'value' => '', + 'morecss' => 'minwidth300' + ) + ); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1); } - // Confirmation de l'annulation + // Confirmation of cancellation if ($action == 'cancel') { - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("Cancel"), $langs->trans("ConfirmCancelThisOrder", $object->ref), "confirm_cancel", '', 0, 1); + $formquestion = array( + array( + 'type' => 'text', + 'name' => 'cancel_note', + 'label' => $langs->trans("Reason"), + 'value' => '', + 'morecss' => 'minwidth300' + ) + ); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("Cancel"), $langs->trans("ConfirmCancelThisOrder", $object->ref), "confirm_cancel", $formquestion, 0, 1); } // Confirmation de l'envoi de la commande @@ -2276,10 +2321,11 @@ if ($action == 'create') { //$result = $object->getLinesArray(); - print ' + print ' + '; @@ -2612,7 +2658,11 @@ if ($action == 'create') { print '
    '.$langs->trans("Comment").'
    '; + print ''; + print '     '; + print ''; + print '
    \n"; print "\n"; print "
    "; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4b8812cf22e..2c847b9a421 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -443,7 +443,7 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $product = $supplierorderdispatch->fk_product; $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; - $eatby = $supplierorderdispatch->fk_product; + $eatby = $supplierorderdispatch->eatby; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 5bb8baf4879..c38751fc138 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -178,7 +178,7 @@ if ($object->id > 0) { $modulepart = 'commande_fournisseur'; - $permission = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); + $permissiontoadd = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $permtoedit = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index eef851c6d73..1ea5db20b59 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -183,7 +183,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $sql .= " AND c.entity IN (".getEntity("supplier_order").")"; // Thirdparty sharing is mandatory with supplier order sharing $sql .= " AND c.fk_statut = 0"; if (!empty($socid)) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -290,7 +290,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; //$sql.= " AND c.fk_statut > 2"; if (!empty($socid)) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -359,7 +359,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX $sql.= " WHERE c.fk_soc = s.rowid"; $sql.= " AND c.entity = ".$conf->entity; $sql.= " AND c.fk_statut = 1"; -if ($socid) $sql.= " AND c.fk_soc = ".$socid; +if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " ORDER BY c.rowid DESC"; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index fb1891051e6..d1946cc9b4c 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2018-2020 Charlene Benke * Copyright (C) 2019 Nicolas ZABOURI * @@ -610,7 +610,7 @@ $sql .= ' cf.fk_multicurrency, cf.multicurrency_code, cf.multicurrency_tx, cf.mu $sql .= ' cf.date_creation as date_creation, cf.tms as date_update,'; $sql .= ' cf.note_public, cf.note_private,'; $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_title,"; -$sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email"; +$sql .= " u.firstname, u.lastname, u.photo, u.login, u.email as user_email, u.statut as user_status"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -651,7 +651,7 @@ $sql .= $hookmanager->resPrint; $sql .= ' WHERE cf.fk_soc = s.rowid'; $sql .= ' AND cf.entity IN ('.getEntity('supplier_order').')'; if ($socid > 0) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -672,10 +672,10 @@ if ($search_request_author) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author); } if ($search_billed != '' && $search_billed >= 0) { - $sql .= " AND cf.billed = ".$db->escape($search_billed); + $sql .= " AND cf.billed = ".((int) $search_billed); } if ($search_product_category > 0) { - $sql .= " AND cp.fk_categorie = ".$search_product_category; + $sql .= " AND cp.fk_categorie = ".((int) $search_product_category); } //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') { @@ -705,7 +705,7 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } if ($search_sale > 0) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale); + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='supplier_order' AND tc.source='internal' AND ec.element_id = cf.rowid AND ec.fk_socpeople = ".$db->escape($search_user); @@ -881,10 +881,10 @@ if ($resql) { 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { - $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); + $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } if ($user->rights->fournisseur->commande->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { $arrayofmassactions = array(); @@ -892,10 +892,11 @@ if ($resql) { $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $url = DOL_URL_ROOT.'/fourn/commande/card.php?action=create'; - if (!empty($socid)) { - $url .= '&socid='.$socid; + if ($socid > 0) { + $url .= '&socid='.((int) $socid); + $url .= '&backtopage='.urlencode(DOL_URL_ROOT.'/fourn/commande/list.php?socid='.((int) $socid)); } - $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); + $newcardbutton = dolGetButtonTitle($langs->trans('NewSupplierOrderShort'), '', 'fa fa-plus-circle', $url, '', ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)); // Lines of title fields print '
    '; @@ -1272,6 +1273,10 @@ if ($resql) { $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; + $totalarray['val'] = array(); + $totalarray['val']['cf.total_ht'] = 0; + $totalarray['val']['cf.total_ttc'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); @@ -1283,6 +1288,7 @@ if ($resql) { $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; + $objectstatic->socid = $obj->socid; $objectstatic->ref_supplier = $obj->ref_supplier; $objectstatic->socid = $obj->socid; $objectstatic->total_ht = $obj->total_ht; @@ -1340,6 +1346,7 @@ if ($resql) { $userstatic->login = $obj->login; $userstatic->photo = $obj->photo; $userstatic->email = $obj->user_email; + $userstatic->statut = $obj->user_status; if (!empty($arrayfields['u.login']['checked'])) { print '
    '; if ($userstatic->id) { @@ -1400,7 +1407,7 @@ if ($resql) { // Type ent if (!empty($arrayfields['typent.code']['checked'])) { print ''; - if (count($typenArray) == 0) { + if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } print $typenArray[$obj->typent_code]; diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index d9b0904c7ef..b3e7d33e5d9 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -43,13 +43,13 @@ $action = GETPOST('action', 'aZ09'); if ($user->socid) { $socid = $user->socid; } + +$hookmanager->initHooks(array('ordersuppliercardnote')); $result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande'); $object = new CommandeFournisseur($db); $object->fetch($id, $ref); -$hookmanager->initHooks(array('ordersuppliercardnote')); - $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); // Used by the include of actions_setnotes.inc.php @@ -57,7 +57,13 @@ $permissionnote = ($user->rights->fournisseur->commande->creer || $user->rights- * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index 82c8df6ac66..3196ffed7ac 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -94,7 +94,7 @@ if ($contactname) { } if ($socid) { - $sql .= " AND s.rowid = ".$socid; + $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY $sortfield $sortorder "; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 30c37bb4d88..6b67d0a2dcf 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -75,6 +75,7 @@ $lineid = GETPOST('lineid', 'int'); $projectid = GETPOST('projectid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = GETPOST('originid', 'int'); +$fac_rec = GETPOST('fac_rec', 'int'); // PDF $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); @@ -1790,8 +1791,8 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('SupplierInvoice')." - ".$langs->trans('Card'); -$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen'; +llxHeader('', $title, $help_url); // Mode creation if ($action == 'create') { @@ -1874,10 +1875,10 @@ if ($action == 'create') { $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; } else { - $cond_reglement_id = $societe->cond_reglement_supplier_id; - $mode_reglement_id = $societe->mode_reglement_supplier_id; + $cond_reglement_id = $societe->cond_reglement_supplier_id; + $mode_reglement_id = $societe->mode_reglement_supplier_id; $transport_mode_id = $societe->transport_mode_supplier_id; - $fk_account = $societe->fk_account; + $fk_account = $societe->fk_account; $datetmp = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dateinvoice = ($datetmp == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datetmp); $datetmp = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); @@ -1929,7 +1930,7 @@ if ($action == 'create') { print $societe->getNomUrl(1); print ''; } else { - print img_picto('', 'company').$form->select_company($societe->id, 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print img_picto('', 'company').$form->select_company($societe->id, 'socid', 's.fournisseur=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 widthcentpercentminusxx'); // reload page to retrieve supplier informations if (!empty($conf->global->RELOAD_PAGE_ON_SUPPLIER_CHANGE)) { print ''."\n"; + print ''."\n"; // JS forced by modules (relative url starting with /) if (!empty($conf->modules_parts['js'])) { // $conf->modules_parts['js'] is array('module'=>array('file1','file2')) @@ -1670,7 +1702,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr $filesjs = (array) $filesjs; // To be sure filejs is an array foreach ($filesjs as $jsfile) { // jsfile is a relative path - print ''."\n".''."\n"; + print ''."\n".''."\n"; } } } @@ -1679,9 +1711,9 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; foreach ($arrayofjs as $jsfile) { if (preg_match('/^(http|\/\/)/i', $jsfile)) { - print ''."\n"; + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } } } @@ -1826,7 +1858,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $conf->browser->layout != 'phone') { $qs = dol_escape_htmltag($_SERVER["QUERY_STRING"]); - if (is_array($_POST)) { + if (isset($_POST) && is_array($_POST)) { foreach ($_POST as $key => $value) { if ($key !== 'action' && $key !== 'password' && !is_array($value)) { $qs .= '&'.$key.'='.urlencode($value); @@ -1882,9 +1914,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } $text .= '">'; $text .= ''; - if ($helppresent) { - $text .= ''; - } + $text .= ''; $text .= ''; $toprightmenu .= $form->textwithtooltip('', $title, 2, 1, $text, 'login_block_elem', 2); } @@ -1985,27 +2015,25 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= ' '.$langs->trans("ShowCompanyInfos").''; $dropdownBody .= '
    '; - if (!empty($conf->global->MAIN_INFO_SIREN)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId1Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; + if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId1", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).''; } - if (!empty($conf->global->MAIN_INFO_SIRET)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId2Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; + if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId2", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).''; } - if (!empty($conf->global->MAIN_INFO_APE)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId3Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; + if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId3", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).''; } - if (!empty($conf->global->MAIN_INFO_RCS)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId4Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; + if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId4", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).''; } - if (!empty($conf->global->MAIN_INFO_PROFID5)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId5Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; + if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId5", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).''; } - if (!empty($conf->global->MAIN_INFO_PROFID6)) { - $dropdownBody .= '
    '.$langs->transcountry("ProfId6Short", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; - } - if (!empty($conf->global->MAIN_INFO_TVAINTRA)) { - $dropdownBody .= '
    '.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; + if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { + $dropdownBody .= '
    '.$langs->transcountry("ProfId6", $mysoc->country_code).': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).''; } + $dropdownBody .= '
    '.$langs->trans("VATIntraShort").': '.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).''; $dropdownBody .= '
    '; @@ -2037,7 +2065,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '') $dropdownBody .= '
    '.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); $dropdownBody .= '
    '.$langs->trans("PreviousConnexion").': '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser'); $dropdownBody .= '
    '.$langs->trans("CurrentTheme").': '.$conf->theme; - $dropdownBody .= '
    '.$langs->trans("CurrentMenuManager").': '.$menumanager->name; + $dropdownBody .= '
    '.$langs->trans("CurrentMenuManager").': '.(isset($menumanager) ? $menumanager->name : 'unknown'); $langFlag = picto_from_langcode($langs->getDefaultLang()); $dropdownBody .= '
    '.$langs->trans("CurrentUserLanguage").': '.($langFlag ? $langFlag.' ' : '').$langs->getDefaultLang(); @@ -2292,7 +2320,7 @@ function top_menu_quickadd() $dropDownQuickAddHtml .= ' '; @@ -2542,7 +2570,7 @@ function top_menu_search() - '; @@ -2564,6 +2592,26 @@ function top_menu_search() } }); + // arrow key nav + $(document).keydown(function(e) { + // Get the focused element: + var $focused = $(":focus"); + if($focused.length && $focused.hasClass("global-search-item")){ + + // UP - move to the previous line + if (e.keyCode == 38) { + e.preventDefault(); + $focused.prev().focus(); + } + + // DOWN - move to the next line + if (e.keyCode == 40) { + e.preventDefault(); + $focused.next().focus(); + } + } + }); + // submit form action $(".dropdown-global-search-button-list .global-search-item").on("click", function(event) { @@ -2596,7 +2644,6 @@ function top_menu_search() var openGlobalSearchDropDown = function() { - event.preventDefault(); $("#topmenu-global-search-dropdown").toggleClass("open"); $("#top-global-search-input").focus(); } @@ -3101,7 +3148,7 @@ if (!function_exists("llxFooter")) { } // Wrapper to add log when clicking on download or preview - if (!empty($conf->blockedlog->enabled) && is_object($object) && $object->id > 0 && $object->statut > 0) { + if (!empty($conf->blockedlog->enabled) && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) { if (in_array($object->element, array('facture'))) { // Restrict for the moment to element 'facture' print "\n\n"; ?> @@ -3184,16 +3231,17 @@ if (!function_exists("llxFooter")) { country_code: 'country_code ? dol_escape_js($mysoc->country_code) : 'unknown'; ?>', php_version: '', os_version: '', - distrib: '' + distrib: '', + token: 'notrequired' }, success: function (data, status, xhr) { // success callback function (data contains body of response) - console.log("Ping ok"); + console.log("Ping ok"); $.ajax({ method: 'GET', url: '', timeout: 500, // timeout milliseconds cache: false, - data: { hash_algo: 'md5', hash_unique_id: '', action: 'firstpingok' }, // for update + data: { hash_algo: 'md5', hash_unique_id: '', action: 'firstpingok', token: 'notrequired' }, // for update }); }, error: function (data,status,xhr) { // error callback function @@ -3203,7 +3251,7 @@ if (!function_exists("llxFooter")) { url: '', timeout: 500, // timeout milliseconds cache: false, - data: { hash_algo: 'md5', hash_unique_id: '', action: 'firstpingko' }, + data: { hash_algo: 'md5', hash_unique_id: '', action: 'firstpingko', token: 'notrequired' }, }); } }); diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 1ac670c4a7f..5f8c7320cd1 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -171,9 +171,9 @@ $sql .= ' AND s.entity IN ('.getEntity('societe').')'; $sql .= " AND d.fk_facture = f.rowid"; if ($agentid > 0) { if (!empty($conf->global->AGENT_CONTACT_TYPE)) { - $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".$agentid.") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".$agentid."))"; + $sql .= " AND ((e.fk_socpeople IS NULL AND sc.fk_user = ".((int) $agentid).") OR (e.fk_socpeople IS NOT NULL AND e.fk_socpeople = ".((int) $agentid)."))"; } else { - $sql .= " AND sc.fk_user = ".$agentid; + $sql .= " AND sc.fk_user = ".((int) $agentid); } } if (!empty($startdate)) { diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 4c34e04c54c..d2c9a1bca76 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -39,10 +39,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); -if (empty($user->rights->margins->liretous)) { - accessforbidden(); -} $object = new Product($db); @@ -63,6 +59,12 @@ if (!$sortfield) { $sortfield = "f.datef"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if (empty($user->rights->margins->liretous)) { + accessforbidden(); +} + /* * View @@ -89,9 +91,7 @@ if ($id > 0 || !empty($ref)) { llxHeader('', $title, $help_url); - /* - * En mode visu - */ + // View mode if ($result > 0) { $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); @@ -106,23 +106,23 @@ if ($id > 0 || !empty($ref)) { print '
    '; print '
    '; - print ''; + print '
    '; // Total Margin - print ''; // Margin Rate if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { - print ''; } // Mark Rate if (!empty($conf->global->DISPLAY_MARK_RATES)) { - print ''; } @@ -156,7 +156,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " AND f.fk_statut > 0"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND d.fk_facture = f.rowid"; - $sql .= " AND d.fk_product =".$object->id; + $sql .= " AND d.fk_product = ".((int) $object->id); if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } @@ -225,12 +225,12 @@ if ($id > 0 || !empty($ref)) { print "\n"; print ''; print "\n"; - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { print "\n"; } @@ -258,10 +258,10 @@ if ($id > 0 || !empty($ref)) { } print ''; print '"; - print '\n"; - print '\n"; + print '\n"; + print '\n"; print '\n"; - print '\n"; + print '\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { print '\n"; } diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index b1c569c0912..1b3cc468e5c 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -33,8 +33,6 @@ $socid = GETPOST('socid', 'int'); if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'societe', '', ''); - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -61,6 +59,12 @@ if ($socid > 0) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('thirdpartymargins', 'globalcard')); +$result = restrictedArea($user, 'societe', $object->id, ''); + +if (empty($user->rights->margins->liretous)) { + accessforbidden(); +} + /* * Actions @@ -109,6 +113,11 @@ if ($socid > 0) { print '
    '; print '
    '.$langs->trans("TotalMargin").''; - print ''; // set by jquery (see below) + print '
    '.$langs->trans("TotalMargin").''; + print ''; // set by jquery (see below) print '
    '.$langs->trans("MarginRate").''; + print '
    '.$langs->trans("MarginRate").''; print ''; // set by jquery (see below) print '
    '.$langs->trans("MarkRate").''; + print '
    '.$langs->trans("MarkRate").''; print ''; // set by jquery (see below) print '
    '.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($objp->name, 44).'".$objp->code_client.""; + print ''; print dol_print_date($db->jdate($objp->datef), 'day')."".price(price2num($objp->selling_price, 'MT'))."".price(price2num($objp->buying_price, 'MT'))."".price(price2num($objp->qty, 'MT'))."".price(price2num($objp->marge, 'MT'))."'.price(price2num($objp->selling_price, 'MT'))."'.price(price2num($objp->buying_price, 'MT'))."'.price(price2num($objp->qty, 'MT'))."'.price(price2num($objp->marge, 'MT'))."".(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."
    '.$langs->trans('TotalMargin')."'.price(price2num($cumul_vente, 'MT'))."'.price(price2num($cumul_achat, 'MT'))."'.price(price2num($cumul_vente, 'MT'))."'.price(price2num($cumul_achat, 'MT'))."'.price(price2num($cumul_qty, 'MT'))."'.price(price2num($totalMargin, 'MT'))."'.price(price2num($totalMargin, 'MT'))."'.(($marginRate === '') ? 'n/a' : price(price2num($marginRate, 'MT'))."%")."
    '; + // Type Prospect/Customer/Supplier + print ''; + if ($object->client) { print ''; // Margin Rate @@ -233,9 +242,9 @@ if ($socid > 0) { print "\n"; print ""; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { print "\n"; } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index e38ddf9b93c..e04adb4ee86 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -133,6 +133,7 @@ if (!defined('NOREQUIRETRAN')) { /* * Object $db */ +$db = null; if (!defined('NOREQUIREDB')) { $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, $conf->db->port); @@ -195,23 +196,10 @@ if (!is_numeric($conf->entity)) { $conf->entity = 1; } -if (!defined('NOREQUIREDB')) { - //print "Will work with data into entity instance number '".$conf->entity."'"; +//print "We work with data into entity instance number '".$conf->entity."'"; - // Here we read database (llx_const table) and define $conf->global->XXX var. - $conf->setValues($db); -} - -// Overwrite database value -if (!empty($conf->file->mailing_limit_sendbyweb)) { - $conf->global->MAILING_LIMIT_SENDBYWEB = $conf->file->mailing_limit_sendbyweb; -} -if (empty($conf->global->MAILING_LIMIT_SENDBYWEB)) { - $conf->global->MAILING_LIMIT_SENDBYWEB = 25; -} -if (!empty($conf->file->mailing_limit_sendbycli)) { - $conf->global->MAILING_LIMIT_SENDBYCLI = $conf->file->mailing_limit_sendbycli; -} +// Here we read database (llx_const table) and define $conf->global->XXX var. +$conf->setValues($db); // Create object $mysoc (A thirdparty object that contains properties of companies managed by Dolibarr. if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { @@ -230,7 +218,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { // Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later) if (!defined('NOREQUIRETRAN')) { $langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT)); - if (defined('MAIN_LANG_DEFAULT')) { + if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL $langcode = constant('MAIN_LANG_DEFAULT'); } $langs->setDefaultLang($langcode); diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index bc52cf7378f..faeb22a095b 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -145,14 +145,14 @@ class MyModuleApi extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($restrictonsocid && $socid) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($restrictonsocid && $search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale } // Insert sale filter if ($restrictonsocid && $search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e69c5bc333d..65af15cffa8 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -84,7 +84,7 @@ class MyObject extends CommonObject * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. @@ -101,9 +101,9 @@ class MyObject extends CommonObject */ public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>20), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>1), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2), 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount'), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty'), @@ -941,6 +941,10 @@ class MyObject extends CommonObject */ public function initAsSpecimen() { + // Set here init that are not commonf fields + // $this->property1 = ... + // $this->property2 = ... + $this->initAsSpecimenCommon(); } diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index d212e10998e..9db4bcb9854 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -290,7 +290,7 @@ class modMyModule extends DolibarrModules 'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', // This is a Top menu entry 'titre'=>'ModuleMyModuleName', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'mainmenu'=>'mymodule', 'leftmenu'=>'', 'url'=>'/mymodule/mymoduleindex.php', @@ -307,7 +307,7 @@ class modMyModule extends DolibarrModules 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', // This is a Top menu entry 'titre'=>'MyObject', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'), 'mainmenu'=>'mymodule', 'leftmenu'=>'myobject', 'url'=>'/mymodule/mymoduleindex.php', diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 3e389c1757f..f3228915592 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,18 +85,18 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -135,7 +135,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $tmpdir = trim($tmpdir); $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); if (!$tmpdir) { - unset($listofdir[$key]); continue; + unset($listofdir[$key]); + continue; } if (!is_dir($tmpdir)) { $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); @@ -157,7 +158,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $texte .= $conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories @@ -173,7 +174,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject if ($nbofiles) { $texte .= ''; } @@ -195,7 +196,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject /** * Function to build a document on disk using the generic odt module. * - * @param Commande $object Object source to build document + * @param MyObject $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details @@ -229,11 +230,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - if ($conf->commande->dir_output) { + if ($conf->mymodule->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; - $object = new Commande($this->db); + $object = new MyObject($this->db); $result = $object->fetch($id); if ($result < 0) { dol_print_error($this->db, $object->error); @@ -241,7 +242,9 @@ class doc_generic_myobject_odt extends ModelePDFMyObject } } - $dir = $conf->commande->multidir_output[isset($object->entity) ? $object->entity : 1]; + $object->fetch_thirdparty(); + + $dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -281,7 +284,11 @@ class doc_generic_myobject_odt extends ModelePDFMyObject //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->mymodule->dir_temp); - + if (!is_writable($conf->mymodule->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->mymodule->dir_temp; + dol_syslog('Error in write_file: '.$this->error, LOG_ERR); + return -1; + } // If CUSTOMER contact defined on order, we use it $usecontact = false; @@ -331,7 +338,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->commande->dir_temp, + 'PATH_TO_TMP' => $conf->mymodule->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index ca3c925dd51..43457d6620d 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -240,14 +240,12 @@ class pdf_standard_myobject extends ModelePDFMyObject { if (empty($object->lines[$i]->fk_product)) continue; - $objphoto->fetch($object->lines[$i]->fk_product); //var_dump($objphoto->ref);exit; - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - { + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php index 9c685e65d9a..72b46b96416 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/mod_myobject_advanced.php @@ -79,7 +79,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject // Parametrage du prefix $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php index 2d262aeeb36..990a6d91bfa 100644 --- a/htdocs/modulebuilder/template/mymoduleindex.php +++ b/htdocs/modulebuilder/template/mymoduleindex.php @@ -113,7 +113,7 @@ if (! empty($conf->mymodule->enabled) && $user->rights->mymodule->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 1f9da9c80ae..b074412b6b3 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -127,7 +127,7 @@ $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the incl $permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); $permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php -$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1]; +$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1].'/myobject'; // Security check (enable the most restrictive one) //if ($user->socid > 0) accessforbidden(); @@ -212,19 +212,19 @@ $help_url = ''; llxHeader('', $title, $help_url); // Example : Adding jquery code -print ''; +// print ''; // Part to create @@ -434,10 +434,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' + '; @@ -489,7 +490,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init&token='.newToken().'#formmailbeforetitle'); } // Back to draft @@ -502,11 +503,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Validate if ($object->status == $object::STATUS_DRAFT) { if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) { - print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes&token='.newToken(), '', $permissiontoadd); } else { $langs->load("errors"); - //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0); - print ''.$langs->trans("Validate").''; + print dolGetButtonAction($langs->trans("ErrorAddAtLeastOneLineFirst"), $langs->trans("Validate"), 'default', '#', '', 0); } } diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 8598cc3dd18..2db325b8b41 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { $upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object); } -$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php +$permissiontoadd = $user->rights->mymodule->myobject->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(); @@ -233,8 +233,8 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'mymodule'; - //$permission = $user->rights->mymodule->myobject->write; - $permission = 1; + //$permissiontoadd = $user->rights->mymodule->myobject->write; + $permissiontoadd = 1; //$permtoedit = $user->rights->mymodule->myobject->write; $permtoedit = 1; $param = '&id='.$object->id; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 05cce2ba934..1e319e18ec2 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -105,8 +105,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -148,7 +149,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -164,7 +165,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } @@ -225,7 +226,7 @@ if (empty($reshook)) { $search[$key.'_dtend'] = ''; } } - $toselect = ''; + $toselect = array(); $search_array_options = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -273,7 +274,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } // Add table from hooks @@ -326,19 +327,21 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY "; +$sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql.='t.'.$key.', '; + $sql .= 't.'.$key.', '; } // Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); +if (!empty($extrafields->attributes[$object->table_element]['label'])) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } } // Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters, $object); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql=preg_replace('/,\s*$/','', $sql); +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; +$sql = preg_replace('/,\s*$/', '', $sql); */ $sql .= $db->order($sortfield, $sortorder); @@ -382,22 +385,22 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); // Example : Adding jquery code -print ''; +// print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -451,6 +454,7 @@ print ''; print ''; print ''; +print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -515,11 +519,11 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -590,6 +594,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -624,6 +629,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -635,6 +642,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index f5fc29a2591..7f324fbd456 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -117,7 +117,13 @@ $permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the incl * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php b/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php index c37086f2219..5de2ca29b83 100644 --- a/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php +++ b/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php @@ -40,7 +40,10 @@ $langs->load("main"); /** * Class MyObjectTest - * @package Testmymodule + * + * @backupGlobals disabled + * @backupStaticAttributes enabled + * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. */ class MyObjectTest extends \PHPUnit_Framework_TestCase { @@ -53,7 +56,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase * Constructor * We save global variables into local variables * - * @return MyObject + * @return MyObjectTest */ public function __construct() { @@ -73,6 +76,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase /** * Global test setup + * * @return void */ public static function setUpBeforeClass() @@ -85,6 +89,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase /** * Unit test setup + * * @return void */ protected function setUp() @@ -100,6 +105,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase /** * Unit test teardown + * * @return void */ protected function tearDown() @@ -109,6 +115,7 @@ class MyObjectTest extends \PHPUnit_Framework_TestCase /** * Global test teardown + * * @return void */ public static function tearDownAfterClass() diff --git a/htdocs/mrp/class/api_mos.class.php b/htdocs/mrp/class/api_mos.class.php index a2558fe6252..ed17db03db6 100644 --- a/htdocs/mrp/class/api_mos.class.php +++ b/htdocs/mrp/class/api_mos.class.php @@ -137,14 +137,14 @@ class Mos extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($restrictonsocid && $socid) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($restrictonsocid && $search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale } // Insert sale filter if ($restrictonsocid && $search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } if ($sqlfilters) { if (!DolibarrApi::_checkFilters($sqlfilters)) { @@ -278,6 +278,364 @@ class Mos extends DolibarrApi } + /** + * Produce and consume + * + * Example: + * { + * "inventorylabel": "Produce and consume using API", + * "inventorycode": "PRODUCEAPI-YY-MM-DD", + * "autoclose": 1, + * "arraytoconsume": [], + * "arraytoproduce": [] + * } + * + * @param int $id ID of state + * @param array $request_data Request datas + * + * @url POST {id}/produceandconsume + * + * @return int ID of MO + */ + public function produceAndConsume($id, $request_data = null) + { + global $langs; + + $error = 0; + + if (!DolibarrApiAccess::$user->rights->mrp->write) { + throw new RestException(401, 'Not enough permission'); + } + $result = $this->mo->fetch($id); + if (!$result) { + throw new RestException(404, 'MO not found'); + } + + if ($this->mo->status != Mo::STATUS_VALIDATED && $this->mo->status != Mo::STATUS_INPROGRESS) { + throw new RestException(401, 'Error bad status of MO'); + } + + $labelmovement = ''; + $codemovement = ''; + $autoclose = 1; + $arraytoconsume = array(); + $arraytoproduce = array(); + + foreach ($request_data as $field => $value) { + if ($field == 'inventorylabel') { + $labelmovement = $value; + } + if ($field == 'inventorycode') { + $codemovement = $value; + } + if ($field == 'autoclose') { + $autoclose = $value; + } + if ($field == 'arraytoconsume') { + $arraytoconsume = $value; + } + if ($field == 'arraytoproduce') { + $arraytoproduce = $value; + } + } + + if (empty($labelmovement)) { + throw new RestException(500, "Field inventorylabel not prodivded"); + } + if (empty($codemovement)) { + throw new RestException(500, "Field inventorycode not prodivded"); + } + + // Code for consume and produce... + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + dol_include_once('/mrp/lib/mrp_mo.lib.php'); + + $stockmove = new MouvementStock($this->db); + + if (!empty($arraytoconsume) && !empty($arraytoproduce)) { + $pos = 0; + $arrayofarrayname = array("arraytoconsume","arraytoproduce"); + foreach ($arrayofarrayname as $arrayname) { + foreach ($$arrayname as $value) { + $tmpproduct = new Product($this->db); + if (empty($value["objectid"])) { + throw new RestException(500, "Field objectid required in ".$arrayname); + } + $tmpproduct->fetch($value["qty"]); + if (empty($value["qty"])) { + throw new RestException(500, "Field qty required in ".$arrayname); + } + if ($value["qty"]!=0) { + $qtytoprocess = $value["qty"]; + if (isset($value["fk_warehouse"])) { // If there is a warehouse to set + if (!($value["fk_warehouse"] > 0)) { // If there is no warehouse set. + throw new RestException(500, "Field fk_warehouse must be > 0 in ".$arrayname); + $error++; + } + if ($tmpproduct->status_batch) { + throw new RestException(500, "Product ".$tmpproduct->ref."must be in batch"); + $error++; + } + } + $idstockmove = 0; + if (!$error && $value["fk_warehouse"] > 0) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin = $this->mo; + if ($qtytoprocess >= 0) { + $moline = new MoLine($this->db); + $moline->fk_mo = $this->mo->id; + $moline->position = $pos; + $moline->fk_product = $value["objectid"]; + $moline->fk_warehouse = $value["fk_warehouse"]; + $moline->qty = $qtytoprocess; + $moline->batch = $tmpproduct->status_batch; + $moline->role = 'toproduce'; + $moline->fk_mrp_production = ""; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = DolibarrApiAccess::$user->id; + + $resultmoline = $moline->create(DolibarrApiAccess::$user); + if ($resultmoline <= 0) { + $error++; + throw new RestException(500, $moline->error); + } + $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $value["objectid"], $value["fk_warehouse"], $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } else { + $moline = new MoLine($this->db); + $moline->fk_mo = $this->mo->id; + $moline->position = $pos; + $moline->fk_product = $value["objectid"]; + $moline->fk_warehouse = $value["fk_warehouse"]; + $moline->qty = $qtytoprocess; + $moline->batch = $tmpproduct->status_batch; + $moline->role = 'toconsume'; + $moline->fk_mrp_production = ""; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = DolibarrApiAccess::$user->id; + + $resultmoline = $moline->create(DolibarrApiAccess::$user); + if ($resultmoline <= 0) { + $error++; + throw new RestException(500, $moline->error); + } + $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $value["objectid"], $value["fk_warehouse"], $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } + if ($idstockmove < 0) { + $error++; + throw new RestException(500, $stockmove->error); + } + } + if (!$error) { + // Record consumption + $moline = new MoLine($this->db); + $moline->fk_mo = $this->mo->id; + $moline->position = $pos; + $moline->fk_product = $value["objectid"]; + $moline->fk_warehouse = $value["fk_warehouse"]; + $moline->qty = $qtytoprocess; + $moline->batch = $tmpproduct->status_batch; + if ($arrayname == "arraytoconsume") { + $moline->role = 'consumed'; + } else { + $moline->role = 'produced'; + } + $moline->fk_mrp_production = ""; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = DolibarrApiAccess::$user->id; + + $resultmoline = $moline->create(DolibarrApiAccess::$user); + if ($resultmoline <= 0) { + $error++; + throw new RestException(500, $moline->error); + } + + $pos++; + } + } + } + } + if (!$error) { + $consumptioncomplete = true; + $productioncomplete = true; + + if ($autoclose <= 0) { + $consumptioncomplete = false; + $productioncomplete = false; + } + } + } else { + $pos = 0; + foreach ($this->mo->lines as $line) { + if ($line->role == 'toconsume') { + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($line->fk_product); + if ($line->qty != 0) { + $qtytoprocess = $line->qty; + if (isset($line->fk_warehouse)) { // If there is a warehouse to set + if (!($line->fk_warehouse > 0)) { // If there is no warehouse set. + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); + $error++; + } + if ($tmpproduct->status_batch) { + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); + $error++; + } + } + $idstockmove = 0; + if (!$error && $line->fk_warehouse > 0) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin = $this->mo; + if ($qtytoprocess >= 0) { + $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } else { + $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } + if ($idstockmove < 0) { + $error++; + throw new RestException(500, $stockmove->error); + } + } + if (!$error) { + // Record consumption + $moline = new MoLine($this->db); + $moline->fk_mo = $this->mo->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = $line->fk_warehouse; + $moline->qty = $qtytoprocess; + $moline->batch = $tmpproduct->status_batch; + $moline->role = 'consumed'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = DolibarrApiAccess::$user->id; + + $resultmoline = $moline->create(DolibarrApiAccess::$user); + if ($resultmoline <= 0) { + $error++; + throw new RestException(500, $moline->error); + } + + $pos++; + } + } + } + } + $pos = 0; + foreach ($this->mo->lines as $line) { + if ($line->role == 'toproduce') { + $tmpproduct = new Product($this->db); + $tmpproduct->fetch($line->fk_product); + if ($line->qty != 0) { + $qtytoprocess = $line->qty; + if (isset($line->fk_warehouse)) { // If there is a warehouse to set + if (!($line->fk_warehouse > 0)) { // If there is no warehouse set. + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Warehouse"), $tmpproduct->ref)); + $error++; + } + if ($tmpproduct->status_batch) { + $langs->load("errors"); + throw new RestException(500, $langs->trans("ErrorFieldRequiredForProduct", $langs->transnoentitiesnoconv("Batch"), $tmpproduct->ref)); + $error++; + } + } + $idstockmove = 0; + if (!$error && $line->fk_warehouse > 0) { + // Record stock movement + $id_product_batch = 0; + $stockmove->origin = $this->mo; + if ($qtytoprocess >= 0) { + $idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } else { + $idstockmove = $stockmove->reception(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement); + } + if ($idstockmove < 0) { + $error++; + throw new RestException(500, $stockmove->error); + } + } + if (!$error) { + // Record consumption + $moline = new MoLine($this->db); + $moline->fk_mo = $this->mo->id; + $moline->position = $pos; + $moline->fk_product = $line->fk_product; + $moline->fk_warehouse = $line->fk_warehouse; + $moline->qty = $qtytoprocess; + $moline->batch = $tmpproduct->status_batch; + $moline->role = 'produced'; + $moline->fk_mrp_production = $line->id; + $moline->fk_stock_movement = $idstockmove; + $moline->fk_user_creat = DolibarrApiAccess::$user->id; + + $resultmoline = $moline->create(DolibarrApiAccess::$user); + if ($resultmoline <= 0) { + $error++; + throw new RestException(500, $moline->error); + } + + $pos++; + } + } + } + } + + if (!$error) { + $consumptioncomplete = true; + $productioncomplete = true; + + if ($autoclose > 0) { + foreach ($this->mo->lines as $line) { + if ($line->role == 'toconsume') { + $arrayoflines = $this->mo->fetchLinesLinked('consumed', $line->id); + $alreadyconsumed = 0; + foreach ($arrayoflines as $line2) { + $alreadyconsumed += $line2['qty']; + } + + if ($alreadyconsumed < $line->qty) { + $consumptioncomplete = false; + } + } + if ($line->role == 'toproduce') { + $arrayoflines = $this->mo->fetchLinesLinked('produced', $line->id); + $alreadyproduced = 0; + foreach ($arrayoflines as $line2) { + $alreadyproduced += $line2['qty']; + } + + if ($alreadyproduced < $line->qty) { + $productioncomplete = false; + } + } + } + } else { + $consumptioncomplete = false; + $productioncomplete = false; + } + } + } + // Update status of MO + dol_syslog("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + //var_dump("consumptioncomplete = ".$consumptioncomplete." productioncomplete = ".$productioncomplete); + if ($consumptioncomplete && $productioncomplete) { + $result = $this->mo->setStatut(self::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); + } else { + $result = $this->mo->setStatut(self::STATUS_INPROGRESS, 0, '', 'MRP_MO_PRODUCED'); + } + if ($result <= 0) { + throw new RestException(500, $this->mo->error); + } + + return $this->mo->id; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index d48d4959fd1..df5dcba60ad 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -101,24 +101,24 @@ class Mo extends CommonObject 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>'1', 'noteditable'=>1), 'fk_bom' => array('type'=>'integer:Bom:bom/class/bom.class.php:0:t.status=1', 'filter'=>'active=1', 'label'=>'BOM', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>-1, 'index'=>1, 'comment'=>"Original BOM", 'css'=>'minwidth100 maxwidth300', 'csslist'=>'nowraponall'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'picto'=>'product'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'), 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'1',), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400'), - 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400'), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>1, 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax200'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,), 'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,), - 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',), - 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,), + 'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'), + 'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'), 'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'), 'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010), - 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')), ); public $rowid; public $ref; @@ -672,7 +672,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; @@ -1007,6 +1007,9 @@ class Mo extends CommonObject } $label .= '
    '; $label .= ''.$langs->trans('Ref').': '.$this->ref; + if (isset($this->label)) { + $label .= '
    '.$langs->trans('Label').': '.$this->label; + } $url = dol_buildpath('/mrp/mo_card.php', 1).'?id='.$this->id; if ($option == 'production') { diff --git a/htdocs/mrp/lib/mrp_mo.lib.php b/htdocs/mrp/lib/mrp_mo.lib.php index 62f74ce016e..8fe07df89c1 100644 --- a/htdocs/mrp/lib/mrp_mo.lib.php +++ b/htdocs/mrp/lib/mrp_mo.lib.php @@ -78,7 +78,7 @@ function moPrepareHead($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->mrp->dir_output."/mo/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->mrp->dir_output."/".dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $object->element, $object->id); $head[$h][0] = dol_buildpath("/mrp/mo_document.php", 1).'?id='.$object->id; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 4619b04f7a1..bbd2724fb1c 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -131,7 +131,7 @@ $formproject = new FormProjets($db); if ($object->id > 0) { $title = $langs->trans("Agenda"); //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; - $help_url = 'EN:Module_Agenda_En'; + $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda'; llxHeader('', $title, $help_url); if (!empty($conf->notification->enabled)) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 093604df9a1..732cde2ef2f 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -138,6 +138,16 @@ if (empty($reshook)) { // Actions when printing a doc from card include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + // Action to build doc + include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; + + if ($action == 'set_thirdparty' && $permissiontoadd) { + $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); + } + if ($action == 'classin' && $permissiontoadd) { + $object->setProject(GETPOST('projectid', 'int')); + } + // Actions to send emails $triggersendname = 'MO_SENTBYMAIL'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO'; @@ -147,13 +157,6 @@ if (empty($reshook)) { // Action to move up and down lines of object //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once - if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'MO_MODIFY'); - } - if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); - } - // Action close produced if ($action == 'confirm_produced' && $confirm == 'yes' && $permissiontoadd) { $result = $object->setStatut($object::STATUS_PRODUCED, 0, '', 'MRP_MO_PRODUCED'); @@ -198,20 +201,6 @@ $title = $langs->trans('Mo')." - ".$langs->trans("Card"); llxHeader('', $title, ''); -// Example : Adding jquery code -print ''; // Part to create @@ -517,10 +506,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea //$result = $object->getLinesArray(); $object->fetchLines(); - print ' + print ' + '; diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index 96041171da6..211fa897c09 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -74,7 +74,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 if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/mo/".get_exdir(0, 0, 0, 1, $object); + $upload_dir = $conf->mrp->multidir_output[$object->entity ? $object->entity : $conf->entity]."/".get_exdir(0, 0, 0, 1, $object); } // Security check - Protection if external user @@ -179,12 +179,12 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'mrp'; - $permission = $user->rights->mrp->write; + $permissiontoadd = $user->rights->mrp->write; $permtoedit = $user->rights->mrp->write; $param = '&id='.$object->id; //$relativepathwithnofile='mo/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile = 'mo/'.dol_sanitizeFileName($object->ref).'/'; + $relativepathwithnofile = dol_sanitizeFileName($object->ref).'/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 4597f265f80..bac3528e642 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -12,7 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ /** @@ -54,9 +54,10 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -89,37 +90,38 @@ foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } } // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } -// Definition of fields for list +// Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} +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'); @@ -140,7 +142,8 @@ $result = restrictedArea($user, 'mrp'); */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -160,8 +163,12 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } } - $toselect = ''; + $toselect = array(); $search_array_options = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -189,18 +196,18 @@ $now = dol_now(); //$help_url="EN:Module_Mo|FR:Module_Mo_FR|ES:Módulo_Mo"; $help_url = ''; $title = $langs->trans('ListOfManufacturingOrders'); +$morejs = array(); +$morecss = array(); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } } // Add fields from hooks @@ -209,27 +216,45 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } if ($search_all) { @@ -244,18 +269,20 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY " +$sql.= " GROUP BY "; foreach($object->fields as $key => $val) { $sql.='t.'.$key.', '; } // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -301,22 +328,8 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); -// Example : Adding jquery code -print ''; $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -341,6 +354,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -357,7 +374,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -366,11 +383,12 @@ print ''; print ''; print ''; +print ''; print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/mrp/mo_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'mrp', 0, $newcardbutton, '', $limit, 0, 0, 1); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "SendMoRef"; @@ -417,24 +435,31 @@ print '
    '.$langs->trans('NatureOfThirdParty').''; + print $object->getTypeUrl(1); + print '
    '; print $langs->trans('CustomerCode').''; @@ -133,7 +142,7 @@ if ($socid > 0) { // Total Margin print '
    '.$langs->trans("TotalMargin").''; - print ''; // set by jquery (see below) + print ''; // set by jquery (see below) print '
    "; print dol_print_date($db->jdate($objp->datef), 'day')."".price(price2num($objp->selling_price, 'MT'))."".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))."".$sign.price(price2num($objp->marge, 'MT'))."".price(price2num($objp->selling_price, 'MT'))."".price(price2num(($objp->type == 2 ? -1 : 1) * $objp->buying_price, 'MT'))."".$sign.price(price2num($objp->marge, 'MT'))."".(($marginRate === '') ? 'n/a' : $sign.price(price2num($marginRate, 'MT'))."%")."
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'  '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - print ''; + print ''; } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
    '; print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); @@ -577,7 +581,7 @@ print '
    '; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } @@ -465,7 +490,7 @@ foreach ($object->fields as $key => $val) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -485,7 +510,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -498,6 +523,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -523,17 +549,16 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } - if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) { - $cssforfield = 'tdoverflowmax100'; - } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -545,6 +570,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 6bbfc503453..fd1e2d8cbfa 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -68,7 +68,14 @@ $permissionnote = $user->rights->mrp->write; // Used by the include of actions_s * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 65d4da3c908..ca9480eb1ae 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -145,11 +145,11 @@ if (empty($reshook)) { $object->setProject(GETPOST('projectid', 'int')); } - if ($action == 'confirm_reopen') { + if ($action == 'confirm_reopen' && $permissiontoadd) { $result = $object->setStatut($object::STATUS_INPROGRESS, 0, '', 'MRP_REOPEN'); } - if ($action == 'confirm_addconsumeline' && GETPOST('addconsumelinebutton')) { + if ($action == 'confirm_addconsumeline' && GETPOST('addconsumelinebutton') && $permissiontoadd) { $moline = new MoLine($db); // Line to produce @@ -169,7 +169,7 @@ if (empty($reshook)) { $action = ''; } - if (in_array($action, array('confirm_consumeorproduce', 'confirm_consumeandproduceall'))) { + if (in_array($action, array('confirm_consumeorproduce', 'confirm_consumeandproduceall')) && $permissiontoproduce) { $stockmove = new MouvementStock($db); $labelmovement = GETPOST('inventorylabel', 'alphanohtml'); diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index fb1c1c0c1ee..478c6504979 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -26,7 +26,7 @@ if (!is_object($form)) { $form = new Form($db); } -$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency']; +$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 ); /*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; }*/ diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index e11fb65184a..e35abff84bb 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -321,9 +321,9 @@ class Opensurveysondage extends CommonObject $sql .= " date_fin=".(dol_strlen($this->date_fin) != 0 ? "'".$this->db->idate($this->date_fin)."'" : 'null').","; $sql .= " status=".(isset($this->status) ? "'".$this->db->escape($this->status)."'" : "null").","; $sql .= " format=".(isset($this->format) ? "'".$this->db->escape($this->format)."'" : "null").","; - $sql .= " mailsonde=".(isset($this->mailsonde) ? $this->db->escape($this->mailsonde) : "null").","; - $sql .= " allow_comments=".$this->db->escape($this->allow_comments).","; - $sql .= " allow_spy=".$this->db->escape($this->allow_spy); + $sql .= " mailsonde=".(isset($this->mailsonde) ? ((int) $this->mailsonde) : "null").","; + $sql .= " allow_comments=".((int) $this->allow_comments).","; + $sql .= " allow_spy=".((int) $this->allow_spy); $sql .= " WHERE id_sondage='".$this->db->escape($this->id_sondage)."'"; $this->db->begin(); diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index cda1bd81f79..3d8d76c5c1e 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -116,6 +116,12 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $ print ''; } + if (!empty($conf->global->OPENSURVEY_IMAGE_PUBLIC_INTERFACE)) { + print '
    '; + print ''; + print '
    '; + } + print '

    '; } diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php index 6d12259a39f..ff5198c006a 100644 --- a/htdocs/opensurvey/results.php +++ b/htdocs/opensurvey/results.php @@ -251,7 +251,40 @@ if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") { header('Location: results.php?id='.$object->id_sondage); } } - + if ($cleinsertion >= 0) { + $sql = 'SELECT s.reponses'; + $sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_user_studs as s"; + $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + } else { + $num = $db->num_rows($resql); + $compteur = 0; + while ($compteur < $num) { + $obj = $db->fetch_object($resql); + $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs"; + if ($cleinsertion == 0) { + $sql .= " SET reponses = '0".$db->escape($obj->reponses)."'"; + } else { + $reponsesadd = str_split($obj->reponses); + $lengthresponses = count($reponsesadd); + for ($cpt = $lengthresponses; $cpt > $cleinsertion; $cpt--) { + $reponsesadd[$cpt] = $reponsesadd[$cpt-1]; + } + $reponsesadd[$cleinsertion] = '0'; + $reponsesadd = implode($reponsesadd); + $sql .= " SET reponses = '".$db->escape($reponsesadd)."'"; + } + $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'"; + $resql = $db->query($sql); + if (!$resql) { + dol_print_error($db); + } + $compteur++; + } + } + } $adresseadmin = $object->mail_admin; } else { $erreur_ajout_date = "yes"; @@ -974,7 +1007,7 @@ if (empty($testligneamodifier)) { print '
    '."\n"; print ''."\n"; print ''."\n"; for ($i = 0; $i < $nbcolonnes; $i++) { diff --git a/htdocs/opensurvey/wizard/choix_date.php b/htdocs/opensurvey/wizard/choix_date.php index ce5f79b1174..817f3d88139 100644 --- a/htdocs/opensurvey/wizard/choix_date.php +++ b/htdocs/opensurvey/wizard/choix_date.php @@ -55,7 +55,7 @@ if (GETPOST('confirmation')) { $tmphorairesi = GETPOST('horaires'.$i, 'array'); - if (!is_array($tmphorairesi) || empty($tmphorairesi[$j])) { + if (!is_array($tmphorairesi)) { $errheure[$i][$j] = true; $erreur = true; continue; @@ -155,7 +155,7 @@ if (GETPOST('confirmation')) { } } - if (isset($errheure)) { + if (!empty($errheure)) { setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors'); } } diff --git a/htdocs/partnership/admin/about.php b/htdocs/partnership/admin/about.php index 0d3fb11c4e3..47423bf4709 100644 --- a/htdocs/partnership/admin/about.php +++ b/htdocs/partnership/admin/about.php @@ -23,34 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - -// Libraries +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once '../lib/partnership.lib.php'; diff --git a/htdocs/partnership/admin/partnership_extrafields.php b/htdocs/partnership/admin/partnership_extrafields.php index 7d819b3bbcb..573f3f1cbba 100644 --- a/htdocs/partnership/admin/partnership_extrafields.php +++ b/htdocs/partnership/admin/partnership_extrafields.php @@ -27,33 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/partnership.lib.php'; @@ -98,7 +72,7 @@ llxHeader('', $title, $help_url); $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'object_partnership'); +print load_fiche_titre($langs->trans("PartnershipSetup"), $linkback, 'title_setup'); $head = partnershipAdminPrepareHead(); diff --git a/htdocs/partnership/admin/setup.php b/htdocs/partnership/admin/setup.php index d681274106c..25567b137db 100644 --- a/htdocs/partnership/admin/setup.php +++ b/htdocs/partnership/admin/setup.php @@ -23,36 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} - -global $langs, $user; - -// Libraries +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; require_once '../lib/partnership.lib.php'; //require_once "../class/myclass.class.php"; @@ -139,50 +110,70 @@ print ''; print ''; print ''; +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; } print '
    '."\n"; - print ''."\n"; + print ''."\n"; print '
    '; - print ''; -print ''; -print ''; -print ''; +print ''; +print ''; +print ''; print ''; - print ''; print ''; print ''; print ''; -if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { +if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { print ''; print ''; print ''; print ''; } +print '
    '.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").''.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
    '.$langs->trans("PARTNERSHIP_IS_MANAGED_FOR").''; print ''; +print ajax_combobox('select_PARTNERSHIP_IS_MANAGED_FOR'); print ''.$langs->trans("partnershipforthirdpartyormember").'
    '.$langs->trans("PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL").''; - $dnbdays = '7'; - $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; + $dnbdays = '15'; + $backlinks = (!empty($conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL)) ? $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL : $dnbdays; print ''; print ''.$dnbdays.'
    '; +print '
    '; + +print '
    '; + + +print load_fiche_titre($langs->trans("ReferingWebsiteCheck"), '', ''); + +print ''.$langs->trans("ReferingWebsiteCheckDesc").'
    '; +print '
    '; + +print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print ''; + +print ''; +print ''; +print ''; +print ''; +print ''; print ''; print ''; -print ''; +print ''; print ''; - print '
    '.$langs->trans("Setting").''.$langs->trans("Value").''.$langs->trans("Examples").'
    '.$langs->trans("PARTNERSHIP_BACKLINKS_TO_CHECK").''; -$dbacklinks = 'dolibarr.org|dolibarr.fr|dolibarr.es'; -$backlinks = (!empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK)) ? $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK : $dbacklinks; +$backlinks = (empty($conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK) ? '' : $conf->global->PARTNERSHIP_BACKLINKS_TO_CHECK); print ''; print ''.$dbacklinks.'dolibarr.org|dolibarr.fr|dolibarr.es
    '; +print '
    '; + + print '
    '; print ''; print '
    '; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 77ae16d9d2d..feef3c7e81f 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -65,8 +65,9 @@ class Partnership extends CommonObject const STATUS_DRAFT = 0; - const STATUS_ACCEPTED = 1; - const STATUS_REFUSED = 2; + const STATUS_VALIDATED = 1; // Validate (no more draft) + const STATUS_ACCEPTED = 2; // Approved + const STATUS_REFUSED = 3; // Refused const STATUS_CANCELED = 9; @@ -100,12 +101,32 @@ class Partnership extends CommonObject /** * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ - public $fields=array(); + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), + //'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnershiptype.class.php', 'label' => 'Type', 'default' => 1, 'enabled' => 1, 'visible' => 1, 'position' => 20), + 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), + 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), + 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), + 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), + 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), + 'date_partnership_start' => array('type'=>'date', 'label'=>'DatePartnershipStart', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>1,), + 'date_partnership_end' => array('type'=>'date', 'label'=>'DatePartnershipEnd', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>1,), + 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>2, 'index'=>1, 'arrayofkeyval'=>array('-1'=>'','0'=>'Draft', '1'=>'Accepted', '2'=>'Refused', '9'=>'Canceled'),), + 'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>63, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',), + 'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-2,), + 'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,), + ); /** * @var int rowid * @deprecated - * @see id + * @see $id */ public $rowid; @@ -164,7 +185,6 @@ class Partnership extends CommonObject // public $lines = array(); - /** * Constructor * @@ -176,31 +196,10 @@ class Partnership extends CommonObject $this->db = $db; - $this->fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), - 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), - 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), - 'date_partnership_start' => array('type'=>'date', 'label'=>'DatePartnershipStart', 'enabled'=>'1', 'position'=>52, 'notnull'=>1, 'visible'=>1,), - 'date_partnership_end' => array('type'=>'date', 'label'=>'DatePartnershipEnd', 'enabled'=>'1', 'position'=>53, 'notnull'=>1, 'visible'=>1,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>2, 'index'=>1, 'arrayofkeyval'=>array('-1'=>'','0'=>$langs->trans('Draft'), '1'=>$langs->trans('Accepted'), '2'=>$langs->trans('Refused'), '9'=>$langs->trans('Canceled')),), - 'count_last_url_check_error' => array('type'=>'integer', 'label'=>'CountLastUrlCheckError', 'enabled'=>'1', 'position'=>63, 'notnull'=>0, 'visible'=>-2, 'default'=>'0',), - 'last_check_backlink' => array('type'=>'datetime', 'label'=>'LastCheckBacklink', 'enabled'=>'1', 'position'=>65, 'notnull'=>0, 'visible'=>-2,), - 'reason_decline_or_cancel' => array('type'=>'text', 'label'=>'ReasonDeclineOrCancel', 'enabled'=>'1', 'position'=>64, 'notnull'=>0, 'visible'=>-2,), - ); - - if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { - $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1,); + if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') { + $this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member'); } else { - $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1,); + $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company'); } if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { @@ -353,15 +352,16 @@ class Partnership extends CommonObject * * @param int $id Id of object to load * @param string $ref Ref of object - * @param int $fk_soc_or_member fk_soc or fk_member + * @param int $fk_member fk_member + * @param int $fk_soc fk_soc * @return int >0 if OK, <0 if KO, 0 if not found */ - public function fetch($id, $ref = null, $fk_soc_or_member = null) + public function fetch($id, $ref = null, $fk_member = null, $fk_soc = null) { global $conf; // Check parameters - if (empty($id) && empty($ref) && empty($fk_soc_or_member)) { + if (empty($id) && empty($ref) && empty($fk_member) && empty($fk_soc)) { return -1; } @@ -375,7 +375,7 @@ class Partnership extends CommonObject $sql .= ' FROM '.MAIN_DB_PREFIX.'partnership as p'; if ($id) { - $sql .= " WHERE p.rowid=".$id; + $sql .= " WHERE p.rowid=".((int) $id); } else { $sql .= " WHERE p.entity IN (0,".getEntity('partnership').")"; // Dont't use entity if you use rowid } @@ -384,14 +384,13 @@ class Partnership extends CommonObject $sql .= " AND p.ref='".$this->db->escape($ref)."'"; } - if ($fk_soc_or_member) { - $sql .= ' AND'; - if ($conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') - $sql .= ' p.fk_member = '; - else $sql .= ' p.fk_soc = '; - $sql .= $fk_soc_or_member; - $sql .= ' ORDER BY p.date_partnership_end DESC'; + if ($fk_member > 0) { + $sql .= ' AND p.fk_member = '.((int) $fk_member); } + if ($fk_soc > 0) { + $sql .= ' AND p.fk_soc = '.((int) $fk_soc); + } + $sql .= ' ORDER BY p.date_partnership_end DESC'; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $result = $this->db->query($sql); @@ -420,8 +419,6 @@ class Partnership extends CommonObject $this->import_key = $obj->import_key; $this->model_pdf = $obj->model_pdf; - $this->lines = array(); - // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -594,7 +591,7 @@ class Partnership extends CommonObject $error = 0; // Protection - if ($this->status == self::STATUS_ACCEPTED) { + if ($this->status == self::STATUS_VALIDATED) { dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); return 0; } @@ -623,7 +620,7 @@ class Partnership extends CommonObject // Validate $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql .= " SET ref = '".$this->db->escape($num)."',"; - $sql .= " status = ".self::STATUS_ACCEPTED; + $sql .= " status = ".self::STATUS_VALIDATED; if (!empty($this->fields['date_validation'])) { $sql .= ", date_validation = '".$this->db->idate($now)."'"; } @@ -690,7 +687,7 @@ class Partnership extends CommonObject // Set new ref and current status if (!$error) { $this->ref = $num; - $this->status = self::STATUS_ACCEPTED; + $this->status = self::STATUS_VALIDATED; } if (!$error) { @@ -1068,17 +1065,24 @@ class Partnership extends CommonObject global $langs; //$langs->load("partnership"); $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatus[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); $this->labelStatus[self::STATUS_REFUSED] = $langs->trans('Refused'); $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled'); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated'); $this->labelStatusShort[self::STATUS_ACCEPTED] = $langs->trans('Accepted'); $this->labelStatusShort[self::STATUS_REFUSED] = $langs->trans('Refused'); $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled'); } $statusType = 'status'.$status; - //if ($status == self::STATUS_ACCEPTED) $statusType = 'status1'; + if ($status == self::STATUS_ACCEPTED) { + $statusType = 'status4'; + } + if ($status == self::STATUS_REFUSED) { + $statusType = 'status9'; + } if ($status == self::STATUS_CANCELED) { $statusType = 'status6'; } diff --git a/htdocs/partnership/class/partnershiputils.class.php b/htdocs/partnership/class/partnershiputils.class.php index 992fca2703e..0588b9e5df2 100644 --- a/htdocs/partnership/class/partnershiputils.class.php +++ b/htdocs/partnership/class/partnershiputils.class.php @@ -27,20 +27,19 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - -dol_include_once('partnership/lib/partnership.lib.php'); -dol_include_once('/partnership/class/partnership.class.php'); - -require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + /** * Class with cron tasks of Partnership module */ class PartnershipUtils { - public $db; //!< To store db handler - public $error; //!< To return error code (or message) - public $errors=array(); //!< To return several error codes (or messages) + public $db; //!< To store db handler + public $error; //!< To return error code (or message) + public $errors = array(); //!< To return several error codes (or messages) /** @@ -72,19 +71,19 @@ class PartnershipUtils } $partnership = new Partnership($this->db); - $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL) ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call + $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL) ? 25 : $conf->global->PARTNERSHIP_MAX_EXPIRATION_CANCEL_PER_CALL); // Limit to 25 per call $langs->loadLangs(array("partnership", "member")); - $error = 0; - $erroremail = ''; - $this->output = ''; - $this->error = ''; + $error = 0; + $erroremail = ''; + $this->output = ''; + $this->error = ''; $partnershipsprocessed = array(); - $gracedelay=$conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; + $gracedelay = $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; if ($gracedelay < 1) { - $this->error='BadValueForDelayBeforeCancelCheckSetup'; + $this->error = 'BadValueForDelayBeforeCancelCheckSetup'; return -1; } @@ -102,7 +101,7 @@ class PartnershipUtils $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_type as dty on (dty.rowid = d.fk_adherent_type)"; $sql .= " WHERE fk_member > 0"; $sql .= " AND (d.datefin < '".$this->db->idate($datetotest)."' AND dty.subscription = 1)"; - $sql .= " AND p.status = ".$partnership::STATUS_ACCEPTED; // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled $sql .= $this->db->order('d.rowid', 'ASC'); // Limit is managed into loop later @@ -117,7 +116,7 @@ class PartnershipUtils $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($partnershipsprocessed[$obj->rowid])) continue; + if (!empty($partnershipsprocessed[$obj->rowid])) continue; if ($somethingdoneonpartnership >= $MAXPERCALL) { dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doCancelStatusOfMemberPartnership to avoid to reach email quota.", LOG_WARNING); @@ -143,7 +142,7 @@ class PartnershipUtils else $this->errors = $object->errors; } } else { - $partnershipsprocessed[$object->id]=$object->ref; + $partnershipsprocessed[$object->id] = $object->ref; // Send an email to inform member $labeltemplate = '(SendingEmailOnPartnershipCanceled)'; @@ -153,21 +152,21 @@ class PartnershipUtils // Send deployment email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $formmail=new FormMail($this->db); + $formmail = new FormMail($this->db); // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); - $outputlangs->loadLangs(array('main','member','partnership')); + $outputlangs->loadLangs(array('main', 'member', 'partnership')); } - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); @@ -180,7 +179,7 @@ class PartnershipUtils $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); - if (! $result || $cmail->error) { + if (!$result || $cmail->error) { $erroremail .= ($erroremail ? ', ' : '').$cmail->error; $this->errors[] = $cmail->error; if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; @@ -194,18 +193,18 @@ class PartnershipUtils $this->error = $this->db->lasterror(); } - if (! $error) { + if (!$error) { $this->db->commit(); $this->output = $numofexpiredmembers.' expired partnership members found'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; } else { $this->db->rollback(); $this->output = "Rollback after error\n"; - $this->output.= $numofexpiredmembers.' expired partnership members found'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail; + $this->output .= $numofexpiredmembers.' expired partnership members found'."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail; } - return ($error ? 1: 0); + return ($error ? 1 : 0); } @@ -223,19 +222,19 @@ class PartnershipUtils $managedfor = $conf->global->PARTNERSHIP_IS_MANAGED_FOR; $partnership = new Partnership($this->db); - $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL) ? 10 : $conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL); // Limit to 10 per call + $MAXPERCALL = (empty($conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL) ? 10 : $conf->global->PARTNERSHIP_MAX_WARNING_BACKLINK_PER_CALL); // Limit to 10 per call $langs->loadLangs(array("partnership", "member")); - $error = 0; - $erroremail = ''; - $this->output = ''; - $this->error = ''; + $error = 0; + $erroremail = ''; + $this->output = ''; + $this->error = ''; $partnershipsprocessed = array(); - $gracedelay=$conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; + $gracedelay = $conf->global->PARTNERSHIP_NBDAYS_AFTER_MEMBER_EXPIRATION_BEFORE_CANCEL; if ($gracedelay < 1) { - $this->error='BadValueForDelayBeforeCancelCheckSetup'; + $this->error = 'BadValueForDelayBeforeCancelCheckSetup'; return -1; } @@ -263,22 +262,23 @@ class PartnershipUtils $sql .= " WHERE 1 = 1"; $sql .= " AND p.".$fk_partner." > 0"; - $sql .= " AND p.status = ".$partnership::STATUS_ACCEPTED; // Only accepted not yet canceled + $sql .= " AND p.status = ".((int) $partnership::STATUS_ACCEPTED); // Only accepted not yet canceled $sql .= " AND (p.last_check_backlink IS NULL OR p.last_check_backlink <= '".$this->db->idate($now - 7 * 24 * 3600)."')"; // Every week, check that website contains a link to dolibarr. $sql .= $this->db->order('p.rowid', 'ASC'); // Limit is managed into loop later $resql = $this->db->query($sql); if ($resql) { - $numofexpiredmembers = $this->db->num_rows($resql); + $numofexpiredmembers = $this->db->num_rows($resql); $somethingdoneonpartnership = 0; - $ifetchpartner = 0; + $ifetchpartner = 0; + $websitenotfound = ''; while ($ifetchpartner < $numofexpiredmembers) { $ifetchpartner++; $obj = $this->db->fetch_object($resql); if ($obj) { - if (! empty($partnershipsprocessed[$obj->rowid])) continue; + if (!empty($partnershipsprocessed[$obj->rowid])) continue; if ($somethingdoneonpartnership >= $MAXPERCALL) { dol_syslog("We reach the limit of ".$MAXPERCALL." partnership processed, so we quit loop for this batch doWarningOfPartnershipIfDolibarrBacklinkNotfound to avoid to reach email quota.", LOG_WARNING); @@ -318,21 +318,21 @@ class PartnershipUtils // Send deployment email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $formmail=new FormMail($this->db); + $formmail = new FormMail($this->db); // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); - if (! empty($newlang)) { + if (!empty($newlang)) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($newlang); - $outputlangs->loadLangs(array('main','member','partnership')); + $outputlangs->loadLangs(array('main', 'member', 'partnership')); } - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); + $arraydefaultmessage = $formmail->getEMailTemplate($this->db, 'partnership_send', $user, $outputlangs, 0, 1, $labeltemplate); - $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); complete_substitutions_array($substitutionarray, $outputlangs, $object); $subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs); @@ -343,7 +343,7 @@ class PartnershipUtils $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); - if (! $result || $cmail->error) { + if (!$result || $cmail->error) { $erroremail .= ($erroremail ? ', ' : '').$cmail->error; $this->errors[] = $cmail->error; if (is_array($cmail->errors) && count($cmail->errors) > 0) $this->errors += $cmail->errors; @@ -360,7 +360,7 @@ class PartnershipUtils $object->reason_decline_or_cancel = ''; } - $partnershipsprocessed[$object->id]=$object->ref; + $partnershipsprocessed[$object->id] = $object->ref; $object->last_check_backlink = $this->db->idate($now); @@ -372,32 +372,31 @@ class PartnershipUtils $this->error = $this->db->lasterror(); } - if (! $error) { + if (!$error) { $this->db->commit(); $this->output = $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output.='. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output.='. Website not found for some partner : '.$websitenotfound."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; + if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; + if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; } else { $this->db->rollback(); $this->output = "Rollback after error\n"; - $this->output.= $numofexpiredmembers.' partnership checked'."\n"; - if ($erroremail) $this->output.='. Got errors when sending some email : '.$erroremail."\n"; - if ($emailnotfound) $this->output.='. Email not found for some partner : '.$emailnotfound."\n"; - if ($websitenotfound) $this->output.='. Website not found for some partner : '.$websitenotfound."\n"; + $this->output .= $numofexpiredmembers.' partnership checked'."\n"; + if ($erroremail) $this->output .= '. Got errors when sending some email : '.$erroremail."\n"; + if ($emailnotfound) $this->output .= '. Email not found for some partner : '.$emailnotfound."\n"; + if ($websitenotfound) $this->output .= '. Website not found for some partner : '.$websitenotfound."\n"; } - return ($error ? 1: 0); + return ($error ? 1 : 0); } /** * Action to check if Dolibarr backlink not found on partner website * - * CAN BE A CRON TASK - * @param $website Partner's website - * @return int 0 if KO, 1 if OK + * @param $website Website Partner's website + * @return int 0 if KO, 1 if OK */ - public function checkDolibarrBacklink($website = null) + private function checkDolibarrBacklink($website = null) { global $conf, $langs, $user; @@ -406,7 +405,7 @@ class PartnershipUtils $webcontent = ''; // $website = 'https://nextgestion.com/'; // For Test - $tmpgeturl = getURLContent($website); + $tmpgeturl = getURLContent($website, 'GET', '', 1, array(), array('http', 'https'), 0); if ($tmpgeturl['curl_error_no']) { $error++; dol_syslog('Error getting '.$website.': '.$tmpgeturl['curl_error_msg']); diff --git a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php index 0b293d19a35..a536bb59600 100644 --- a/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php +++ b/htdocs/partnership/core/modules/partnership/mod_partnership_advanced.php @@ -79,7 +79,7 @@ class mod_partnership_advanced extends ModeleNumRefPartnership // Parametrage du prefix $texte .= '
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'  '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print ''; @@ -719,6 +656,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 29a59f67ef4..cc97eac5515 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -22,69 +22,20 @@ * \brief Tab for notes on Partnership */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/partnership/class/partnership.class.php'); -dol_include_once('/partnership/lib/partnership.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php'; +require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; // Load translation files required by the page $langs->loadLangs(array("partnership", "companies")); // Get parameters $id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); +$cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects @@ -114,8 +65,13 @@ $permissiontoadd = $user->rights->partnership->write; // Used by the include of /* * Actions */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/partnership/partnershipindex.php b/htdocs/partnership/partnershipindex.php index 8076f105dbb..264134c67d9 100644 --- a/htdocs/partnership/partnershipindex.php +++ b/htdocs/partnership/partnershipindex.php @@ -25,35 +25,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; @@ -100,8 +72,7 @@ print '
    '; /* BEGIN MODULEBUILDER DRAFT MYOBJECT // Draft MyObject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) -{ +if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { $langs->load("orders"); $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; @@ -113,11 +84,10 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $total = 0; $num = $db->num_rows($resql); @@ -126,12 +96,9 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) print '
    '.$langs->trans("DraftMyObjects").($num?''.$num.'':'').'
    '; @@ -150,23 +117,16 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $i++; $total += $obj->total_ttc; } - if ($total>0) - { - + if ($total>0) { print '
    '.$langs->trans("Total").''.price($total)."
    '.$langs->trans("NoOrder").'

    "; $db->free($resql); - } - else - { + } else { dol_print_error($db); } } @@ -181,8 +141,7 @@ $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; /* BEGIN MODULEBUILDER LASTMODIFIED MYOBJECT // Last modified myobject -if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) -{ +if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) { $sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."partnership_myobject as s"; //if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -193,8 +152,7 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) $sql .= $db->plimit($max, 0); $resql = $db->query($sql); - if ($resql) - { + if ($resql) { $num = $db->num_rows($resql); $i = 0; @@ -205,10 +163,8 @@ if (! empty($conf->partnership->enabled) && $user->rights->partnership->read) print ''; print ''.$langs->trans("DateModificationShort").''; print ''; - if ($num) - { - while ($i < $num) - { + if ($num) { + while ($i < $num) { $objp = $db->fetch_object($resql); $myobjectstatic->id=$objp->rowid; diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 41ad839cb94..a14729f30ef 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -74,19 +74,19 @@ if ($action == 'setvalue' && $user->admin) { if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'alpha'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index cfa7628297d..a192fdaf629 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -80,19 +80,19 @@ if ($action == 'setvalue' && $user->admin) { if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM", GETPOST('ONLINE_PAYMENT_MESSAGE_FORM', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK", GETPOST('ONLINE_PAYMENT_MESSAGE_OK', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO", GETPOST('ONLINE_PAYMENT_MESSAGE_KO', 'restricthtml'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } - $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL'), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL", GETPOST('ONLINE_PAYMENT_SENDEMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); if (!$result > 0) { $error++; } diff --git a/htdocs/product/admin/dynamic_prices.php b/htdocs/product/admin/dynamic_prices.php index fdd42bd34d7..d90ea7090f7 100644 --- a/htdocs/product/admin/dynamic_prices.php +++ b/htdocs/product/admin/dynamic_prices.php @@ -213,17 +213,17 @@ if ($action == 'create_variable' || $action == 'edit_variable') { //Code print ''; print ''.$langs->trans("Variable").''; - print ''; + print ''; print ''; //Description print ''; print ''.$langs->trans("Description").''; - print ''; + print ''; print ''; //Value print ''; print ''.$langs->trans("Value").''; - print ''; + print ''; print ''; print ''; @@ -310,7 +310,7 @@ if ($action == 'create_updater' || $action == 'edit_updater') { //Description print ''; print ''.$langs->trans("Description").''; - print ''; + print ''; print ''; //Type print ''; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index b23cfbc5c4c..fa75a20277f 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -295,13 +295,14 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); print load_fiche_titre($langs->trans("ProductCodeChecker"), '', ''); +print '
    '; print ''."\n"; print ''."\n"; print ' '; print ' '; print ' '; print ' '; -print ' '; +print ' '; print "\n"; foreach ($dirproduct as $dirroot) { @@ -333,7 +334,7 @@ foreach ($dirproduct as $dirroot) { print ''."\n"; print ''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) { print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.$modCodeProduct->name.''.$modCodeProduct->info($langs).''.$modCodeProduct->getExample($langs).''.$modCodeProduct->getExample($langs).''."\n"; @@ -366,6 +367,7 @@ foreach ($dirproduct as $dirroot) { } } print '
    '; +print '
    '; // Module to build doc $def = array(); @@ -390,13 +392,14 @@ print '
    '; print load_fiche_titre($langs->trans("ProductDocumentTemplates"), '', ''); +print '
    '; print ''; print ''; print ''; print ''; print '\n"; print '\n"; -print ''; +print ''; print ''; print "\n"; @@ -499,6 +502,8 @@ foreach ($dirmodels as $reldir) { } print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
    '; +print '
    '; + print "
    "; /* @@ -507,14 +512,17 @@ print "
    "; print "
    "; -print load_fiche_titre($langs->trans("ProductOtherConf"), '', ''); - print ''; print ''; print ''; print ''; + +print load_fiche_titre($langs->trans("ProductOtherConf"), '', ''); + + +print '
    '; print ''; print ''; print ''."\n"; @@ -592,6 +600,40 @@ print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_ print ''; print ''; +if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; +} + +print '
    '.$langs->trans("Parameters").'
    '.$langs->trans("UseProductFournDesc").''; + print $form->selectyesno("activate_useProdFournDesc", (!empty($conf->global->PRODUIT_FOURN_TEXTS) ? $conf->global->PRODUIT_FOURN_TEXTS : 0), 1); + print '
    '.$langs->trans("UseProductSupplierPackaging").''; + print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1); + print '
    '; +print '
    '; + +print '
    '; +print ''; +print '
    '; + + +print load_fiche_titre($langs->trans("UserInterface"), '', ''); + + +print '
    '; +print ''; +print ''; +print ''."\n"; +print ''."\n"; +print ''."\n"; + // Use Ajax form to select a product print ''; @@ -624,9 +666,10 @@ if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) { print ''; print ''; print ''; @@ -682,22 +725,6 @@ if (!empty($conf->global->MAIN_MULTILANGS)) { print ''; } -if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; -} - if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) { // Add canvas feature @@ -753,6 +780,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) { } print '
    '.$langs->trans("Parameters").''.$langs->trans("Value").'
    '.$langs->trans("OnProductSelectAddProductDesc").''; +print ''; print $form->selectarray( "activate_FillProductDescAuto", - array(1=>'AutoFillFormFieldBeforeSubmit', 0=>'DoNotAutofillButAutoConcat', -1=>'DoNotUseDescriptionOfProdut'), + array(0=>'DoNotAutofillButAutoConcat', 1=>'AutoFillFormFieldBeforeSubmit', 2=>'DoNotUseDescriptionOfProdut'), empty($conf->global->PRODUIT_AUTOFILL_DESC) ? 0 : $conf->global->PRODUIT_AUTOFILL_DESC, 0, 0, @@ -636,7 +679,7 @@ print $form->selectarray( 0, 0, '', - 'maxwidth400', + 'minwidth100imp maxwidth400', 1 ); print '
    '.$langs->trans("UseProductFournDesc").''; - print $form->selectyesno("activate_useProdFournDesc", (!empty($conf->global->PRODUIT_FOURN_TEXTS) ? $conf->global->PRODUIT_FOURN_TEXTS : 0), 1); - print '
    '.$langs->trans("UseProductSupplierPackaging").''; - print $form->selectyesno("activate_useProdSupplierPackaging", (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING) ? $conf->global->PRODUCT_USE_SUPPLIER_PACKAGING : 0), 1); - print '
    '; +print '
    '; print '
    '; print ''; diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index 8cafa97e077..3f4fd636de4 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -101,188 +101,197 @@ $head = product_lot_admin_prepare_head(); print dol_get_fiche_head($head, 'settings', $langs->trans("Batch"), -1, 'lot'); -/* - * Lot Numbering models - */ -print load_fiche_titre($langs->trans("BatchLotNumberingModules"), '', ''); +if ($conf->global->MAIN_FEATURES_LEVEL < 2) { + // The feature to define the numbering module of lot or serial is no enabled bcause it is not used anywhere in Dolibarr code: You can set it + // but the numbering module is not used. + // TODO Use it on lot creation page, when you create a lot and when the lot number is kept empty to define the lot according + // to the selected product. + print $langs->trans("NothingToSetup"); +} else { + /* + * Lot Numbering models + */ -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''."\n"; + print load_fiche_titre($langs->trans("BatchLotNumberingModules"), '', ''); -clearstatcache(); + print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; -foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/product_batch/"); + clearstatcache(); - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 8) == 'mod_lot_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { - $file = substr($file, 0, dol_strlen($file) - 4); + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/product_batch/"); - require_once $dir.$file.'.php'; + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (substr($file, 0, 8) == 'mod_lot_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { + $file = substr($file, 0, dol_strlen($file) - 4); - $module = new $file($db); + require_once $dir.$file.'.php'; - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + $module = new $file($db); - if ($module->isEnabled()) { - print ''; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - // Show example of numbering model - print ''."\n"; + if ($module->isEnabled()) { + print ''; - print ''; + // Show example of numbering model + print ''."\n"; - $batch = new Productlot($db); - $batch->initAsSpecimen(); - - // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; - $nextval = $module->getNextValue($mysoc, $batch); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') - $nextval = $langs->trans($nextval); - $htmltooltip .= $nextval.'
    '; + print ''; + + $batch = new Productlot($db); + $batch->initAsSpecimen(); + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; + $nextval = $module->getNextValue($mysoc, $batch); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip .= $nextval.'
    '; + } else { + $htmltooltip .= $langs->trans($module->error).'
    '; + } + } + + print ''; + + print "\n"; } - - print ''; - - print "\n"; } } + closedir($handle); } - closedir($handle); } } -} -print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.$module->name."\n"; - print $module->info(); - print ''; - $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) print '
    '.$langs->trans($tmp).'
    '; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $tmp; - print '
    '.$module->name."\n"; + print $module->info(); + print ''; - if ($conf->global->PRODUCTBATCH_LOT_ADDON == $file) { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; + $tmp = $module->getExample(); + if (preg_match('/^Error/', $tmp)) print '
    '.$langs->trans($tmp).'
    '; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
    '; + if ($conf->global->PRODUCTBATCH_LOT_ADDON == $file) { + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - $htmltooltip .= $langs->trans($module->error).'
    '; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; } + print '
    '; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '
    '; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '

    \n"; + print "
    \n"; -/* - * Serials Numbering models - */ + /* + * Serials Numbering models + */ -print load_fiche_titre($langs->trans("BatchSerialNumberingModules"), '', ''); + print load_fiche_titre($langs->trans("BatchSerialNumberingModules"), '', ''); -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''."\n"; + print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''."\n"; -clearstatcache(); + clearstatcache(); -foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/product_batch/"); + foreach ($dirmodels as $reldir) { + $dir = dol_buildpath($reldir."core/modules/product_batch/"); - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 7) == 'mod_sn_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { - $file = substr($file, 0, dol_strlen($file) - 4); + if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (substr($file, 0, 7) == 'mod_sn_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { + $file = substr($file, 0, dol_strlen($file) - 4); - require_once $dir.$file.'.php'; + require_once $dir.$file.'.php'; - $module = new $file($db); + $module = new $file($db); - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; + // Show modules according to features level + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - if ($module->isEnabled()) { - print ''; + if ($module->isEnabled()) { + print ''; - // Show example of numbering model - print ''."\n"; + // Show example of numbering model + print ''."\n"; - print ''; - - $batch = new Productlot($db); - $batch->initAsSpecimen(); - - // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; - $nextval = $module->getNextValue($mysoc, $batch); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') - $nextval = $langs->trans($nextval); - $htmltooltip .= $nextval.'
    '; + print ''; + + $batch = new Productlot($db); + $batch->initAsSpecimen(); + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; + $nextval = $module->getNextValue($mysoc, $batch); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= ''.$langs->trans("NextValue").': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip .= $nextval.'
    '; + } else { + $htmltooltip .= $langs->trans($module->error).'
    '; + } + } + + print ''; + + print "\n"; } - - print ''; - - print "\n"; } } + closedir($handle); } - closedir($handle); } } -} -print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.$module->name."\n"; - print $module->info(); - print '
    '.$module->name."\n"; + print $module->info(); + print ''; - $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) print '
    '.$langs->trans($tmp).'
    '; - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); - else print $tmp; - print '
    '; + $tmp = $module->getExample(); + if (preg_match('/^Error/', $tmp)) print '
    '.$langs->trans($tmp).'
    '; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
    '; - if ($conf->global->PRODUCTBATCH_SN_ADDON == $file) { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; + if ($conf->global->PRODUCTBATCH_SN_ADDON == $file) { + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - $htmltooltip .= $langs->trans($module->error).'
    '; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; } + print '
    '; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print '
    '; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '

    \n"; + print "
    \n"; +} // End of page llxFooter(); diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index ea32e47c8a5..815014e259f 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -73,7 +73,21 @@ if (!$sortorder) { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('agendathirdparty')); -$result = restrictedArea($user, 'produit|service', $id, 'product&product'); +$object = new Product($db); +if ($id > 0 || !empty($ref)) { + $object->fetch($id, $ref); +} + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', 0, 'product&product', '', ''); +} /* diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 901e2b387e3..77acafbbd55 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -122,8 +122,8 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { // Price by qty if (!empty($price_by_qty_rowid) && $price_by_qty_rowid >= 1 && (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES))) { // If we need a particular price related to qty $sql = "SELECT price, unitprice, quantity, remise_percent"; - $sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty "; - $sql .= " WHERE rowid=".$price_by_qty_rowid.""; + $sql .= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; + $sql .= " WHERE rowid = ".((int) $price_by_qty_rowid); $result = $db->query($sql); if ($result) { @@ -235,7 +235,7 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) { // When used from jQuery, the search term is added as GET param "term". $searchkey = (($idprod && GETPOST($idprod, 'alpha')) ? GETPOST($idprod, 'alpha') : (GETPOST($htmlname, 'alpha') ? GETPOST($htmlname, 'alpha') : '')); - if (!is_object($form)) { + if (!isset($form) || !is_object($form)) { $form = new Form($db); } diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 3bda877af62..d155abdc2c2 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -349,11 +349,11 @@ class ActionsCardProduct } } - if (isset($_GET["tosell"]) && dol_strlen($_GET["tosell"]) > 0) { - $sql .= " AND p.tosell = ".$this->db->escape($_GET["tosell"]); + if (GETPOSTISSET("tosell")) { + $sql .= " AND p.tosell = ".((int) GETPOST("tosell", "int")); } - if (isset($_GET["canvas"]) && dol_strlen($_GET["canvas"]) > 0) { - $sql .= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; + if (GETPOSTISSET("canvas")) { + $sql .= " AND p.canvas = '".$this->db->escape(GETPOST("canvas"))."'"; } $sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->plimit($limit + 1, $offset); diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index b862eddefc5..5d39b55ff76 100644 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -39,7 +39,7 @@ print dol_get_fiche_head(''); " method="post"> - + diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index 21f2edefc2d..2e04f660084 100644 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -38,7 +38,7 @@ dol_htmloutput_errors($object->error, $object->errors); ?> " method="post"> - + diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 53e0df73212..c4296dc63a8 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -298,29 +298,29 @@ class ActionsCardService $sql .= " AND (p.ref LIKE '%".$this->db->escape($sall)."%' OR p.label LIKE '%".$this->db->escape($sall)."%' OR p.description LIKE '%".$this->db->escape($sall)."%' OR p.note LIKE '%".$this->db->escape($sall)."%')"; } if ($sref) { - $sql .= " AND p.ref LIKE '%".$sref."%'"; + $sql .= " AND p.ref LIKE '%".$this->db->escape($sref)."%'"; } if ($search_barcode) { - $sql .= " AND p.barcode LIKE '%".$search_barcode."%'"; + $sql .= " AND p.barcode LIKE '%".$this->db->escape($search_barcode)."%'"; } if ($snom) { $sql .= " AND p.label LIKE '%".$this->db->escape($snom)."%'"; } - if (isset($_GET["tosell"]) && dol_strlen($_GET["tosell"]) > 0) { - $sql .= " AND p.tosell = ".$this->db->escape($_GET["tosell"]); + if (GETPOSTISSET("tosell")) { + $sql .= " AND p.tosell = ".((int) GETPOST("tosell", 'int')); } - if (isset($_GET["canvas"]) && dol_strlen($_GET["canvas"]) > 0) { - $sql .= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; + if (GETPOSTISSET("canvas")) { + $sql .= " AND p.canvas = '".$this->db->escape(GETPOST("canvas"))."'"; } if ($catid) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".((int) $catid); } if ($fourn_id > 0) { - $sql .= " AND p.rowid = pfp.fk_product AND pfp.fk_soc = ".$fourn_id; + $sql .= " AND p.rowid = pfp.fk_product AND pfp.fk_soc = ".((int) $fourn_id); } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } $sql .= $this->db->order($sortfield, $sortorder); $sql .= $this->db->plimit($limit + 1, $offset); diff --git a/htdocs/product/canvas/service/tpl/card_create.tpl.php b/htdocs/product/canvas/service/tpl/card_create.tpl.php index ce3c4f5cc58..73f79b6efdb 100644 --- a/htdocs/product/canvas/service/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_create.tpl.php @@ -39,7 +39,7 @@ print dol_get_fiche_head(''); " method="post"> - + diff --git a/htdocs/product/canvas/service/tpl/card_edit.tpl.php b/htdocs/product/canvas/service/tpl/card_edit.tpl.php index 4906b0dcf2c..a656d749a4b 100644 --- a/htdocs/product/canvas/service/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/service/tpl/card_edit.tpl.php @@ -38,7 +38,7 @@ dol_htmloutput_errors($object->error, $object->errors); ?> " method="post"> - + diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 98fb4132bb8..04396770aa2 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -64,13 +64,12 @@ if (!empty($conf->commande->enabled)) { } if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; -} -if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; -} -if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } +if (!empty($conf->bom->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php'; +} // Load translation files required by the page $langs->loadLangs(array('products', 'other')); @@ -152,7 +151,17 @@ if (!empty($canvas)) { // Security check $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($id) ? 'rowid' : 'ref'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productcard', 'globalcard')); @@ -305,11 +314,11 @@ if (empty($reshook)) { $object->type = $type; $object->status = GETPOST('statut'); - $object->status_buy = GETPOST('statut_buy'); + $object->status_buy = GETPOST('statut_buy'); $object->status_batch = GETPOST('status_batch'); $object->batch_mask = GETPOST('batch_mask'); - $object->barcode_type = GETPOST('fk_barcode_type'); + $object->barcode_type = GETPOST('fk_barcode_type'); $object->barcode = GETPOST('barcode'); // Set barcode_type_xxx from barcode_type id $stdobject = new GenericObject($db); @@ -373,32 +382,32 @@ if (empty($reshook)) { $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); - if ($accountancy_code_sell <= 0) { + if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { $object->accountancy_code_sell = ''; } else { $object->accountancy_code_sell = $accountancy_code_sell; } - if ($accountancy_code_sell_intra <= 0) { + if (empty($accountancy_code_sell_intra) || $accountancy_code_sell_intra == '-1') { $object->accountancy_code_sell_intra = ''; } else { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; } - if ($accountancy_code_sell_export <= 0) { + if (empty($accountancy_code_sell_export) || $accountancy_code_sell_export == '-1') { $object->accountancy_code_sell_export = ''; } else { $object->accountancy_code_sell_export = $accountancy_code_sell_export; } - if ($accountancy_code_buy <= 0) { + if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { $object->accountancy_code_buy = ''; } else { $object->accountancy_code_buy = $accountancy_code_buy; } - if ($accountancy_code_buy_intra <= 0) { + if (empty($accountancy_code_buy_intra) || $accountancy_code_buy_intra == '-1') { $object->accountancy_code_buy_intra = ''; } else { $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; } - if ($accountancy_code_buy_export <= 0) { + if (empty($accountancy_code_buy_export) || $accountancy_code_buy_export == '-1') { $object->accountancy_code_buy_export = ''; } else { $object->accountancy_code_buy_export = $accountancy_code_buy_export; @@ -512,6 +521,13 @@ if (empty($reshook)) { $object->finished = null; } + $fk_default_bom = GETPOST('fk_default_bom', 'int'); + if ($fk_default_bom >= 0) { + $object->fk_default_bom = $fk_default_bom; + } else { + $object->fk_default_bom = null; + } + $units = GETPOST('units', 'int'); if ($units > 0) { $object->fk_unit = $units; @@ -542,32 +558,32 @@ if (empty($reshook)) { $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha'); $accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha'); - if ($accountancy_code_sell <= 0) { + if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { $object->accountancy_code_sell = ''; } else { $object->accountancy_code_sell = $accountancy_code_sell; } - if ($accountancy_code_sell_intra <= 0) { + if (empty($accountancy_code_sell_intra) || $accountancy_code_sell_intra == '-1') { $object->accountancy_code_sell_intra = ''; } else { $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; } - if ($accountancy_code_sell_export <= 0) { + if (empty($accountancy_code_sell_export) || $accountancy_code_sell_export == '-1') { $object->accountancy_code_sell_export = ''; } else { $object->accountancy_code_sell_export = $accountancy_code_sell_export; } - if ($accountancy_code_buy <= 0) { + if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { $object->accountancy_code_buy = ''; } else { $object->accountancy_code_buy = $accountancy_code_buy; } - if ($accountancy_code_buy_intra <= 0) { + if (empty($accountancy_code_buy_intra) || $accountancy_code_buy_intra == '-1') { $object->accountancy_code_buy_intra = ''; } else { $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; } - if ($accountancy_code_buy_export <= 0) { + if (empty($accountancy_code_buy_export) || $accountancy_code_buy_export == '-1') { $object->accountancy_code_buy_export = ''; } else { $object->accountancy_code_buy_export = $accountancy_code_buy_export; @@ -1006,14 +1022,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - print ''."\n"; + print ''."\n"; + } // Load object modCodeProduct $module = (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) ? $conf->global->PRODUCT_CODEPRODUCT_ADDON : 'mod_codeproduct_leopard'); @@ -1066,23 +1084,23 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($modCodeProduct->code_auto)) { $tmpcode = $modCodeProduct->getNextValue($object, $type); } - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; if ($refalreadyexists) { print $langs->trans("RefAlreadyExists"); } print ''; // Label - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; // On sell - print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; + print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; $statutarray = array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSell")); print $form->selectarray('statut', $statutarray, GETPOST('statut')); print ''; // To buy - print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; + print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; $statutarray = array('1' => $langs->trans("ProductStatusOnBuy"), '0' => $langs->trans("ProductStatusNotOnBuy")); print $form->selectarray('statut_buy', $statutarray, GETPOST('statut_buy')); print ''; @@ -1092,47 +1110,55 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ManageLotSerial").''; $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, GETPOST('status_batch')); - print ''; + print ''; // Product specific batch number management $status_batch = GETPOST('status_batch'); if ($status_batch !== '0') { + $langs->load("admin"); $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes2"); - $tooltip .= $langs->trans("GenericMaskCodes3"); - $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes5"); - print ''.$langs->trans("ManageLotMask").''; - if (($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') || ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) { + $tooltip .= '
    '.$langs->trans("GenericMaskCodes2"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes3"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes5"); + if (($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') + || ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) { + print ''.$langs->trans("ManageLotMask").''; $inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK; $inherited_mask_sn = $conf->global->SN_ADVANCED_MASK; print ''; - print $form->textwithpicto('', $tooltip, 1, 1); - print ''; + print $form->textwithpicto('', $tooltip, 1, 1); print ''; - } else { - print ''; + print ''; } - } else { - print ''; } - print ''; } $showbarcode = empty($conf->barcode->enabled) ? 0 : 1; @@ -1153,9 +1179,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $formbarcode = new FormBarCode($db); print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1); print ''; - if ($conf->browser->layout == 'phone') { - print ''; - } + print ''; print ''.$langs->trans("BarcodeValue").''; $tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode; if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) { @@ -1166,69 +1190,80 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Description (used in invoice, propal...) - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%'); $doleditor->Create(); print ""; - // Public URL - print ''.$langs->trans("PublicUrl").''; - print ''; - print ''; + if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { + // Public URL + print ''.$langs->trans("PublicUrl").''; + print img_picto('', 'globe', 'class="pictofixedwidth"'); + print ''; + print ''; + } if ($type != 1 && !empty($conf->stock->enabled)) { // Default warehouse print ''.$langs->trans("DefaultWarehouse").''; - print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'pictofixedwidth'); - print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse'), 'fk_default_warehouse', 'warehouseopen', 1); + print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); + print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse', 'int'), 'fk_default_warehouse', 'warehouseopen', 1, 0, 0, '', 0, 0, array(), 'minwidth300 widthcentpercentminusxx maxwidth500'); print ' '; print ''; print ''; print ''; print ''; - // Stock min level - print ''.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).''; - print ''; - print ''; - if ($conf->browser->layout == 'phone') { + if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) { + // Stock min level + print ''.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).''; + print ''; + print ''; + print ''; + + // Stock desired level + print ''.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).''; + print ''; + print ''; } - // Stock desired level - print ''.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).''; - print ''; - print ''; } else { - print ''; - print ''; + if (empty($conf->global->PRODUCT_DISABLE_STOCK_LEVELS)) { + print ''; + print ''; + } } // Duration if ($type == 1) { - print ''.$langs->trans("Duration").''; + print ''.$langs->trans("Duration").''; print ''; - print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOST('duration_value', 'alpha'), 0, 1); + print $formproduct->selectMeasuringUnits("duration_unit", "time", (GETPOSTISSET('duration_value') ? GETPOSTISSET('duration_value', 'alpha') : 'h'), 0, 1); print ''; } if ($type != 1) { // Nature, Weight and volume only applies to products and not to services - // Nature - print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; - $statutarray = array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); - print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { + // Nature + print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; + $statutarray = array('1' => $langs->trans("Finished"), '0' => $langs->trans("RowMaterial")); + print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1); + print ''; + } - // Brut Weight - print ''.$langs->trans("Weight").''; - print ''; - print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) { + // Brut Weight + print ''.$langs->trans("Weight").''; + print ''; + print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ?GETPOST('weight_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 2); + print ''; + } // Brut Length if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { - print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; + print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; print ' x '; print ' x '; print ''; @@ -1237,14 +1272,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { // Brut Surface - print ''.$langs->trans("Surface").''; + print ''.$langs->trans("Surface").''; print ''; print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ?GETPOST('surface_units', 'alpha') : '0', 0, 2); print ''; } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { // Brut Volume - print ''.$langs->trans("Volume").''; + print ''.$langs->trans("Volume").''; print ''; print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units') ?GETPOST('volume_units', 'alpha') : '0', 0, 2); print ''; @@ -1252,7 +1287,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) { // Net Measure - print ''.$langs->trans("NetMeasure").''; + print ''.$langs->trans("NetMeasure").''; print ''; print $formproduct->selectMeasuringUnits("net_measure_units", '', GETPOSTISSET('net_measure_units') ?GETPOST('net_measure_units', 'alpha') : (empty($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? 0 : $conf->global->MAIN_WEIGHT_DEFAULT_UNIT), 0, 0); print ''; @@ -1262,41 +1297,38 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Units if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''.$langs->trans('DefaultUnitToShow').''; - print ''; + print ''; print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, 'units'); print ''; } // Custom code if (empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO) && empty($type)) { - print ''.$langs->trans("CustomCode").''; + print ''.$langs->trans("CustomCode").''; // Origin country - print ''.$langs->trans("CountryOrigin").''; + print ''.$langs->trans("CountryOrigin").''; print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); - print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx'); + print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id', '', 0, 'minwidth300 widthcentpercentminusx maxwidth500'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } - print ''; + print ''; // State if (empty($conf->global->PRODUCT_DISABLE_STATE)) { - if ($conf->browser->layout == 'phone') { - print ''; - } + print ''; if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; + print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; } else { - print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; + print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); print ''; } - - print ''; } // Quality control @@ -1306,7 +1338,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Other attributes - $parameters = array('colspan' => 3, 'cols' => '3'); + $parameters = array('colspan' => ' colspan="2"', 'cols'=>2); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { @@ -1316,7 +1348,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Note (private, no output on invoices, propales...) //if (! empty($conf->global->MAIN_DISABLE_NOTES_TAB)) available in create mode //{ - print ''.$langs->trans("NoteNotVisibleOnBill").''; + print ''.$langs->trans("NoteNotVisibleOnBill").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%'); @@ -1327,7 +1359,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($conf->categorie->enabled) { // Categories - print ''.$langs->trans("Categories").''; + print ''.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print ""; @@ -1337,170 +1369,174 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; - if (!empty($conf->global->PRODUIT_MULTIPRICES)) { - // We do no show price array on create when multiprices enabled. - // We must set them on prices tab. - print ''; - // VAT - print ''; - print '
    '.$langs->trans("VATRate").''; - $defaultva = get_default_tva($mysoc, $mysoc); - print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); - print '
    '; + if (empty($conf->global->PRODUCT_DISABLE_PRICES)) { + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + // We do no show price array on create when multiprices enabled. + // We must set them on prices tab. + print ''; + // VAT + print ''; + print '
    '.$langs->trans("VATRate").''; + $defaultva = get_default_tva($mysoc, $mysoc); + print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); + print '
    '; - print '
    '; - } else { - print ''; + print '
    '; + } else { + print '
    '; - // Price - print ''; - print ''; + // Price + print ''; + print ''; - // Min price - print ''; - print ''; + // Min price + print ''; + print ''; - // VAT - print ''; + // VAT + print ''; - print '
    '.$langs->trans("SellingPrice").''; - print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type"); - print '
    '.$langs->trans("SellingPrice").''; + print $form->selectPriceBaseType($conf->global->PRODUCT_PRICE_BASE_TYPE, "price_base_type"); + print '
    '.$langs->trans("MinPrice").''; - print '
    '.$langs->trans("MinPrice").''; + print '
    '.$langs->trans("VATRate").''; - $defaultva = get_default_tva($mysoc, $mysoc); - print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); - print '
    '.$langs->trans("VATRate").''; + $defaultva = get_default_tva($mysoc, $mysoc); + print $form->load_tva("tva_tx", $defaultva, $mysoc, $mysoc, 0, 0, '', false, 1); + print '
    '; + print ''; - print '
    '; + print '
    '; + } } // Accountancy codes + print ''."\n"; print ''; - if (!empty($conf->accounting->enabled)) { - // Accountancy_code_sell - print ''; - print ''; - - // Accountancy_code_sell_intra - if ($mysoc->isInEEC()) { - print ''; + if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) { + if (!empty($conf->accounting->enabled)) { + // Accountancy_code_sell + print ''; print ''; - } - // Accountancy_code_sell_export - print ''; - print ''; + // Accountancy_code_sell_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } - // Accountancy_code_buy - print ''; - print ''; - - // Accountancy_code_buy_intra - if ($mysoc->isInEEC()) { - print ''; + // Accountancy_code_sell_export + print ''; print ''; + + // Accountancy_code_buy + print ''; + print ''; + + // Accountancy_code_buy_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_buy_export + print ''; + print ''; + } else {// For external software + if (!empty($accountancy_code_sell)) { + $object->accountancy_code_sell = $accountancy_code_sell; + } + if (!empty($accountancy_code_sell_intra)) { + $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; + } + if (!empty($accountancy_code_sell_export)) { + $object->accountancy_code_sell_export = $accountancy_code_sell_export; + } + if (!empty($accountancy_code_buy)) { + $object->accountancy_code_buy = $accountancy_code_buy; + } + if (!empty($accountancy_code_buy_intra)) { + $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; + } + if (!empty($accountancy_code_buy_export)) { + $object->accountancy_code_buy_export = $accountancy_code_buy_export; + } + + // Accountancy_code_sell + print ''; + print ''; + + // Accountancy_code_sell_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_sell_export + print ''; + print ''; + + // Accountancy_code_buy + print ''; + print ''; + + // Accountancy_code_buy_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_buy_export + print ''; + print ''; } - - // Accountancy_code_buy_export - print ''; - print ''; - } else // For external software - { - if (!empty($accountancy_code_sell)) { - $object->accountancy_code_sell = $accountancy_code_sell; - } - if (!empty($accountancy_code_sell_intra)) { - $object->accountancy_code_sell_intra = $accountancy_code_sell_intra; - } - if (!empty($accountancy_code_sell_export)) { - $object->accountancy_code_sell_export = $accountancy_code_sell_export; - } - if (!empty($accountancy_code_buy)) { - $object->accountancy_code_buy = $accountancy_code_buy; - } - if (!empty($accountancy_code_buy_intra)) { - $object->accountancy_code_buy_intra = $accountancy_code_buy_intra; - } - if (!empty($accountancy_code_buy_export)) { - $object->accountancy_code_buy_export = $accountancy_code_buy_export; - } - - // Accountancy_code_sell - print ''; - print ''; - - // Accountancy_code_sell_intra - if ($mysoc->isInEEC()) { - print ''; - print ''; - } - - // Accountancy_code_sell_export - print ''; - print ''; - - // Accountancy_code_buy - print ''; - print ''; - - // Accountancy_code_buy_intra - if ($mysoc->isInEEC()) { - print ''; - print ''; - } - - // Accountancy_code_buy_export - print ''; - print ''; } print '
    '.$langs->trans("ProductAccountancySellCode").''; - if ($type == 0) { - $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT); - } else { - $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT); - } - print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); - print '
    '.$langs->trans("ProductAccountancySellIntraCode").'
    '.$langs->trans("ProductAccountancySellCode").''; if ($type == 0) { - $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT); + $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT); } else { - $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT); + $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT); } - print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); + print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); print '
    '.$langs->trans("ProductAccountancySellExportCode").''; - if ($type == 0) { - $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT); - } else { - $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT); - } - print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); - print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; + if ($type == 0) { + $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT); + } else { + $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT); + } + print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; - if ($type == 0) { - $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT); - } else { - $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT); - } - print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); - print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").'
    '.$langs->trans("ProductAccountancySellExportCode").''; if ($type == 0) { - $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT); + $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT); } else { - $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT); + $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT); } - print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); + print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; + if ($type == 0) { + $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT); + } else { + $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT); + } + print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); + print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; + if ($type == 0) { + $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT); + } else { + $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT); + } + print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); + print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; + if ($type == 0) { + $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT); + } else { + $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT); + } + print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1); + print '
    '.$langs->trans("ProductAccountancySellCode").''; + print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; + print '
    '.$langs->trans("ProductAccountancySellExportCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; - if ($type == 0) { - $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT); - } else { - $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT); - } - print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 1); - print '
    '.$langs->trans("ProductAccountancySellCode").''; - print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; - print '
    '.$langs->trans("ProductAccountancySellExportCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; - print '
    '; @@ -1523,14 +1559,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - print ''."\n"; + } // We set country_id, country_code and country for the selected country $object->country_id = GETPOST('country_id') ? GETPOST('country_id') : $object->country_id; @@ -1599,52 +1637,69 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans("ManageLotSerial").''; $statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial")); print $form->selectarray('status_batch', $statutarray, $object->status_batch); - print ''; - if ($object->status_batch !== '0') { + print ''; + if (!empty($object->status_batch) || !empty($conf->use_javascript_ajax)) { + $langs->load("admin"); $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes2"); - $tooltip .= $langs->trans("GenericMaskCodes3"); - $tooltip .= $langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); - $tooltip .= $langs->trans("GenericMaskCodes5"); - print ''.$langs->trans("ManageLotMask").''; - if ($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') { - $mask = ! empty($object->batch_mask) ? $object->batch_mask : $conf->global->LOT_ADVANCED_MASK; + $tooltip .= '
    '.$langs->trans("GenericMaskCodes2"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes3"); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch")); + $tooltip .= '
    '.$langs->trans("GenericMaskCodes5"); + print ''.$langs->trans("ManageLotMask").''; + if ($object->status_batch == '1' && getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == 'mod_lot_advanced') { + $mask = !empty($object->batch_mask) ? $object->batch_mask : getDolGlobalString('LOT_ADVANCED_MASK'); } - if ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced') { - $mask = ! empty($object->batch_mask) ? $object->batch_mask : $conf->global->SN_ADVANCED_MASK; + if ($object->status_batch == '2' && getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && getDolGlobalString('PRODUCTBATCH_SN_ADDON') == 'mod_sn_advanced') { + $mask = !empty($object->batch_mask) ? $object->batch_mask : getDolGlobalString('SN_ADVANCED_MASK'); } - $inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK; - $inherited_mask_sn = $conf->global->SN_ADVANCED_MASK; + $inherited_mask_lot = getDolGlobalString('LOT_ADVANCED_MASK'); + $inherited_mask_sn = getDolGlobalString('SN_ADVANCED_MASK'); print ''; - print $form->textwithpicto('', $tooltip, 1, 1); - print ''; - - print ''; - } else { - print ''; + '; + } + print ''; } - print ''; } } @@ -1667,17 +1722,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1); - print ''.$langs->trans("BarcodeValue").''; + print ''; + print ''.$langs->trans("BarcodeValue").''; $tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode; if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) { $tmpcode = $modBarCodeProduct->getNextValue($object, $fk_barcode_type); } - print ''; + print ''; print ''; } // Description (used in invoice, propal...) - print ''.$langs->trans("Description").''; + print ''.$langs->trans("Description").''; // We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF. $doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%'); @@ -1687,17 +1743,21 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Public Url - print ''.$langs->trans("PublicUrl").''; - print ''; - print ''; + if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { + print ''.$langs->trans("PublicUrl").''; + print img_picto('', 'globe', 'class="pictofixedwidth"'); + print ''; + print ''; + } // Stock if ($object->isProduct() && !empty($conf->stock->enabled)) { // Default warehouse print ''.$langs->trans("DefaultWarehouse").''; + print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); print $formproduct->selectWarehouses($object->fk_default_warehouse, 'fk_default_warehouse', 'warehouseopen', 1); print ' '; - print ''; + print ''; /* print "".''.$langs->trans("StockLimit").''; print ''; @@ -1717,25 +1777,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($object->isService()) { // Duration - print ''.$langs->trans("Duration").''; + print ''.$langs->trans("Duration").''; print ' '; print $formproduct->selectMeasuringUnits("duration_unit", "time", $object->duration_unit, 0, 1); print ''; } else { - // Nature - print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; - print $formproduct->selectProductNature('finished', $object->finished); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { + // Nature + print ''.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; + print $formproduct->selectProductNature('finished', $object->finished); + print ''; + } - // Brut Weight - print ''.$langs->trans("Weight").''; - print ' '; - print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) { + // Brut Weight + print ''.$langs->trans("Weight").''; + print ' '; + print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2); + print ''; + } if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { // Brut Length - print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; + print ''.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; print 'x'; print 'x'; print ' '; @@ -1744,14 +1808,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { // Brut Surface - print ''.$langs->trans("Surface").''; + print ''.$langs->trans("Surface").''; print ' '; print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2); print ''; } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { // Brut Volume - print ''.$langs->trans("Volume").''; + print ''.$langs->trans("Volume").''; print ' '; print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2); print ''; @@ -1759,7 +1823,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) { // Net Measure - print ''.$langs->trans("NetMeasure").''; + print ''.$langs->trans("NetMeasure").''; print ' '; print $formproduct->selectMeasuringUnits("net_measure_units", "", $object->net_measure_units, 0, 0); print ''; @@ -1768,38 +1832,37 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Units if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''.$langs->trans('DefaultUnitToShow').''; - print ''; + print ''; print $form->selectUnits($object->fk_unit, 'units'); print ''; } // Custom code if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { - print ''.$langs->trans("CustomCode").''; + print ''.$langs->trans("CustomCode").''; // Origin country - print ''.$langs->trans("CountryOrigin").''; + print ''.$langs->trans("CountryOrigin").''; print ''; print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country($object->country_id, 'country_id', '', 0, 'minwidth100 maxwidthonsmartphone'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } - print ''; + print ''; // State if (empty($conf->global->PRODUCT_DISABLE_STATE)) { - if ($conf->browser->layout == 'phone') { - print ''; - } + print ''; if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { - print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; + print ''.$form->editfieldkey('RegionStateOrigin', 'state_id', '', $object, 0).''; } else { - print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; + print ''.$form->editfieldkey('StateOrigin', 'state_id', '', $object, 0).''; } + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); print ''; + print ''; } - print ''; } // Quality control @@ -1809,7 +1872,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Other attributes - $parameters = array('colspan' => ' colspan="3"', 'cols' => 3); + $parameters = array('colspan' => ' colspan="2"', 'cols' => 2); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { @@ -1818,7 +1881,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Tags-Categories if ($conf->categorie->enabled) { - print ''.$langs->trans("Categories").''; + print ''.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_PRODUCT); @@ -1834,7 +1897,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Note private if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { - print ''.$langs->trans("NoteNotVisibleOnBill").''; + print ''.$langs->trans("NoteNotVisibleOnBill").''; $doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%'); $doleditor->Create(); @@ -1848,81 +1911,90 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; - if (!empty($conf->accounting->enabled)) { - // Accountancy_code_sell - print ''; - print ''; + if (!$object->isService() && !empty($conf->bom->enabled)) { + print ''; + } - // Accountancy_code_sell_intra - if ($mysoc->isInEEC()) { - print ''; + if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) { + if (!empty($conf->accounting->enabled)) { + // Accountancy_code_sell + print ''; print ''; - } - // Accountancy_code_sell_export - print ''; - print ''; + // Accountancy_code_sell_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } - // Accountancy_code_buy - print ''; - print ''; - - // Accountancy_code_buy_intra - if ($mysoc->isInEEC()) { - print ''; + // Accountancy_code_sell_export + print ''; print ''; + + // Accountancy_code_buy + print ''; + print ''; + + // Accountancy_code_buy_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_buy_export + print ''; + print ''; + } else { + // For external software + // Accountancy_code_sell + print ''; + print ''; + + // Accountancy_code_sell_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_sell_export + print ''; + print ''; + + // Accountancy_code_buy + print ''; + print ''; + + // Accountancy_code_buy_intra + if ($mysoc->isInEEC()) { + print ''; + print ''; + } + + // Accountancy_code_buy_export + print ''; + print ''; } - - // Accountancy_code_buy_export - print ''; - print ''; - } else { - // For external software - // Accountancy_code_sell - print ''; - print ''; - - // Accountancy_code_sell_intra - if ($mysoc->isInEEC()) { - print ''; - print ''; - } - - // Accountancy_code_sell_export - print ''; - print ''; - - // Accountancy_code_buy - print ''; - print ''; - - // Accountancy_code_buy_intra - if ($mysoc->isInEEC()) { - print ''; - print ''; - } - - // Accountancy_code_buy_export - print ''; - print ''; } print '
    '.$langs->trans("ProductAccountancySellCode").''; - print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1); - print '
    '.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + $bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id; + print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1); + print '
    '.$langs->trans("ProductAccountancySellIntraCode").'
    '.$langs->trans("ProductAccountancySellCode").''; - print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1); + print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300'); print '
    '.$langs->trans("ProductAccountancySellExportCode").''; - print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1); - print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; + print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; - print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1); - print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").'
    '.$langs->trans("ProductAccountancySellExportCode").''; - print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1); + print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; + print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; + print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; + print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300'); + print '
    '.$langs->trans("ProductAccountancySellCode").''; + print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; + print '
    '.$langs->trans("ProductAccountancySellExportCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; + print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; - print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1); - print '
    '.$langs->trans("ProductAccountancySellCode").''; - print '
    '.$langs->trans("ProductAccountancySellIntraCode").''; - print '
    '.$langs->trans("ProductAccountancySellExportCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyIntraCode").''; - print '
    '.$langs->trans("ProductAccountancyBuyExportCode").''; - print '
    '; @@ -1964,14 +2036,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print ''; + print '
    '; // Type if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); print ''; } @@ -1983,16 +2055,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $langs->trans("BarcodeType"); print ''; if (($action != 'editbarcodetype') && $usercancreate && $createbarcode) { - print ''; + print ''; } print '
    '; print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); - print ''; + print ''; print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); print '
    id.'">'.img_edit($langs->trans('Edit'), 1).'id.'&token='.newToken().'">'.img_edit($langs->trans('Edit'), 1).'
    '; - print ''; + print ''; if ($action == 'editbarcodetype' || $action == 'editbarcode') { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); } - $fk_barcode_type=''; + $fk_barcode_type = ''; if ($action == 'editbarcodetype') { print $formbarcode->formBarcodeType($_SERVER['PHP_SELF'].'?id='.$object->id, $object->barcode_type, 'fk_barcode_type'); $fk_barcode_type = $object->barcode_type; @@ -2009,10 +2081,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $langs->trans("BarcodeValue"); print ''; if (($action != 'editbarcode') && $usercancreate && $createbarcode) { - print 'id.'">'.img_edit($langs->trans('Edit'), 1).''; + print 'id.'&token='.newToken().'">'.img_edit($langs->trans('Edit'), 1).''; } print ''; - print ''; + print ''; if ($action == 'editbarcode') { $tmpcode = GETPOSTISSET('barcode') ? GETPOST('barcode') : $object->barcode; if (empty($tmpcode) && !empty($modBarCodeProduct->code_auto)) { @@ -2024,7 +2096,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; print ''; - print ' '; + print ' '; print ''; } else { print showValueWithClipboardCPButton($object->barcode); @@ -2032,10 +2104,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; } + // Batch number management (to batch) + if (!empty($conf->productbatch->enabled)) { + if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { + print ''.$langs->trans("ManageLotSerial").''; + print $object->getLibStatut(0, 2); + print ''; + if ((($object->status_batch == '1' && $conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') + || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { + print ''.$langs->trans("ManageLotMask").''; + print $object->batch_mask; + print ''; + } + } + } + // Accountancy sell code print ''; print $langs->trans("ProductAccountancySellCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell)) { $accountingaccount = new AccountingAccount($db); @@ -2052,7 +2139,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($mysoc->isInEEC()) { print ''; print $langs->trans("ProductAccountancySellIntraCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell_intra)) { $accountingaccount2 = new AccountingAccount($db); @@ -2069,7 +2156,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy sell code export print ''; print $langs->trans("ProductAccountancySellExportCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_sell_export)) { $accountingaccount3 = new AccountingAccount($db); @@ -2085,7 +2172,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy buy code print ''; print $langs->trans("ProductAccountancyBuyCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy)) { $accountingaccount4 = new AccountingAccount($db); @@ -2102,7 +2189,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($mysoc->isInEEC()) { print ''; print $langs->trans("ProductAccountancyBuyIntraCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy_intra)) { $accountingaccount5 = new AccountingAccount($db); @@ -2119,7 +2206,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Accountancy buy code export print ''; print $langs->trans("ProductAccountancyBuyExportCode"); - print ''; + print ''; if (!empty($conf->accounting->enabled)) { if (!empty($object->accountancy_code_buy_export)) { $accountingaccount6 = new AccountingAccount($db); @@ -2132,28 +2219,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } print ''; - // Batch number management (to batch) - if (!empty($conf->productbatch->enabled)) { - if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print ''.$langs->trans("ManageLotSerial").''; - print $object->getLibStatut(0, 2); - print ''; - if ((($object->status_batch == '1' &&$conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced') - || ($object->status_batch == '2' && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced' && $conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS))) { - print ''.$langs->trans("ManageLotMask").''; - print $object->batch_mask; - print ''; - } - } - } - // Description - print ''.$langs->trans("Description").''.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).''; + print ''.$langs->trans("Description").''.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).''; // Public URL - print ''.$langs->trans("PublicUrl").''; - print dol_print_url($object->url); - print ''; + if (empty($conf->global->PRODUCT_DISABLE_PUBLIC_URL)) { + print ''.$langs->trans("PublicUrl").''; + print dol_print_url($object->url); + print ''; + } // Default warehouse if ($object->isProduct() && !empty($conf->stock->enabled)) { @@ -2174,7 +2248,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $prodstatic->fetch($combination->fk_product_parent); // Parent product - print ''.$langs->trans("ParentProduct").''; + print ''.$langs->trans("ParentProduct").''; print $prodstatic->getNomUrl(1); print ''; } @@ -2185,11 +2259,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '; print '
    '; - print ''; + print '
    '; if ($object->isService()) { // Duration - print ''; } else { - // Nature - print ''; + if (empty($conf->global->PRODUCT_DISABLE_NATURE)) { + // Nature + print ''; + } // Brut Weight - print '\n"; } - print "\n"; if (empty($conf->global->PRODUCT_DISABLE_SIZE)) { // Brut Length - print ''; } } @@ -2275,10 +2354,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Custom code if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { - print ''; + print ''; // Origin country code - print ''; - print ''; + print ''.$object->lifetime.''; + print ''; } + if (!$object->isService() && !empty($conf->bom->enabled)) { + print ''; + } + + // Other attributes - $parameters = array('colspan' => ' colspan="'.(2 + (($showphoto || $showbarcode) ? 1 : 0)).'"', 'cols' => (2 + (($showphoto || $showbarcode) ? 1 : 0))); + $parameters = array(); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories if ($conf->categorie->enabled) { - print '"; } @@ -2305,7 +2395,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Note private if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) { print ' '."\n"; - print ''."\n"; + print ''."\n"; print ' '."\n"; } @@ -2351,7 +2441,7 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d // Define confirmation messages $formquestionclone = array( 'text' => $langs->trans("ConfirmClone"), - array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'size'=>24), + array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss'=>'width150'), array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1), array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1), ); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index b4e860a1069..2e0d21b0456 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -206,8 +206,8 @@ class Products extends DolibarrApi // Select products of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); - $sql .= " AND c.fk_product = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category); + $sql .= " AND c.fk_product = t.rowid"; } if ($mode == 1) { // Show only products diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 69429677c27..555bc08d03e 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -93,7 +93,7 @@ class FormProduct } $sql = "SELECT e.rowid, e.ref as label, e.description, e.fk_parent"; - if (!empty($fk_product)) { + if (!empty($fk_product) && $fk_product > 0) { if (!empty($batch)) { $sql .= ", pb.qty as stock"; } else { @@ -104,7 +104,7 @@ class FormProduct } $sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_entrepot = e.rowid"; - if (!empty($fk_product)) { + if (!empty($fk_product) && $fk_product > 0) { $sql .= " AND ps.fk_product = ".((int) $fk_product); if (!empty($batch)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb on pb.fk_product_stock = ps.rowid AND pb.batch = '".$this->db->escape($batch)."'"; @@ -123,11 +123,11 @@ class FormProduct // minimum stock if ($stockMin !== false) { - if (!empty($fk_product)) { + if (!empty($fk_product) && $fk_product > 0) { if (!empty($batch)) { - $sql .= " AND pb.qty > ".$this->db->escape($stockMin); + $sql .= " AND pb.qty > ".((float) $stockMin); } else { - $sql .= " AND ps.reel > ".$this->db->escape($stockMin); + $sql .= " AND ps.reel > ".((float) $stockMin); } } } @@ -137,7 +137,7 @@ class FormProduct // minimum stock if ($stockMin !== false) { - $sql .= " HAVING sum(ps.reel) > ".$this->db->escape($stockMin); + $sql .= " HAVING sum(ps.reel) > ".((float) $stockMin); } } $sql .= " ORDER BY ".$orderBy; @@ -234,7 +234,7 @@ class FormProduct if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) { $filterstatus = ''; } - if (!empty($fk_product)) { + if (!empty($fk_product) && $fk_product > 0) { $this->cache_warehouses = array(); } @@ -340,7 +340,7 @@ class FormProduct print ''; - print ''; + print ''; print '
    '.$langs->trans("Duration").''.$object->duration_value.' '; + print '
    '.$langs->trans("Duration").''.$object->duration_value.' '; if ($object->duration_value > 1) { $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years")); } elseif ($object->duration_value > 0) { @@ -2199,23 +2273,27 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
    '.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; - print $object->getLibFinished(); - print '
    '.$form->textwithpicto($langs->trans("NatureOfProductShort"), $langs->trans("NatureOfProductDesc")).''; + print $object->getLibFinished(); + print '
    '.$langs->trans("Weight").''; - if ($object->weight != '') { - print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); - } else { - print ' '; + if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) { + print '
    '.$langs->trans("Weight").''; + if ($object->weight != '') { + print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units); + } else { + print ' '; + } + print "
    '.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; + print '
    '.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").''; if ($object->length != '' || $object->width != '' || $object->height != '') { print $object->length; if ($object->width) { @@ -2232,7 +2310,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) { // Brut Surface - print '
    '.$langs->trans("Surface").''; + print '
    '.$langs->trans("Surface").''; if ($object->surface != '') { print $object->surface." ".measuringUnitString(0, "surface", $object->surface_units); } else { @@ -2242,7 +2320,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) { // Brut Volume - print '
    '.$langs->trans("Volume").''; + print '
    '.$langs->trans("Volume").''; if ($object->volume != '') { print $object->volume." ".measuringUnitString(0, "volume", $object->volume_units); } else { @@ -2253,12 +2331,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) { // Net Measure - print '
    '.$langs->trans("NetMeasure").''; + print '
    '.$langs->trans("NetMeasure").''; if ($object->net_measure != '') { print $object->net_measure." ".measuringUnitString($object->net_measure_units); } else { print ' '; } + print '
    '.$langs->trans("CustomCode").''.$object->customcode.'
    '.$langs->trans("CustomCode").''.$object->customcode.'
    '.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); + print '
    '.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); if (!empty($object->state_id)) { print ' - '.getState($object->state_id, 0, $db); } @@ -2287,17 +2366,28 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Quality Control if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) { - print '
    '.$langs->trans("LifeTime").''.$object->lifetime.'
    '.$langs->trans("QCFrequency").''.$object->qc_frequency.'
    '.$langs->trans("LifeTime").'
    '.$langs->trans("QCFrequency").''.$object->qc_frequency.'
    '.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).''; + if ($object->fk_default_bom) { + $bom_static = new BOM($db); + $bom_static->fetch($object->fk_default_bom); + print $bom_static->getNomUrl(1); + } + print '
    '.$langs->trans("Categories").''; + print '
    '.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1); print "
    '.$langs->trans("NotePrivate").''.(dol_textishtml($object->note_private) ? $object->note_private : dol_nl2br($object->note_private, 1, true)).'
    '.$langs->trans("NotePrivate").''.(dol_textishtml($object->note_private) ? $object->note_private : dol_nl2br($object->note_private, 1, true)).'
    '; print $this->selectWarehouses($selected, $htmlname, '', $addempty); print '
    '; } else { if ($selected) { @@ -382,11 +382,13 @@ class FormProduct * @param string $default Preselected value * @param int|string $adddefault 1=Add empty unit called "Default", ''=Add empty value * @param int $mode 1=Use short label as value, 0=Use rowid, 2=Use scale (power) + * @param string $morecss More CSS * @return string */ - public function selectMeasuringUnits($name = 'measuring_units', $measuring_style = '', $default = '0', $adddefault = 0, $mode = 0) + public function selectMeasuringUnits($name = 'measuring_units', $measuring_style = '', $default = '0', $adddefault = 0, $mode = 0, $morecss = 'maxwidth125') { global $langs, $conf, $mysoc, $db; + $langs->load("other"); $return = ''; @@ -412,7 +414,7 @@ class FormProduct dol_print_error($db); return -1; } else { - $return .= ''; if ($adddefault || $adddefault === '') { $return .= ''; } @@ -445,6 +447,8 @@ class FormProduct $return .= ''; } + $return .= ajax_combobox($name); + return $return; } @@ -547,8 +551,8 @@ class FormProduct $out = ''; $productIdArray = array(); if (!is_array($objectLines) || !count($objectLines)) { - if (!empty($fk_product)) { - $productIdArray[] = $fk_product; + if (!empty($fk_product) && $fk_product > 0) { + $productIdArray[] = (int) $fk_product; } } else { foreach ($objectLines as $line) { @@ -570,8 +574,8 @@ class FormProduct if ($empty) { $out .= ''; } - if (!empty($fk_product)) { - $productIdArray = array($fk_product); // only show lot stock for product + if (!empty($fk_product) && $fk_product > 0) { + $productIdArray = array((int) $fk_product); // only show lot stock for product } else { foreach ($this->cache_lot as $key => $value) { $productIdArray[] = $key; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 16c72297e10..9bc127fdf14 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -231,8 +231,8 @@ class Product extends CommonObject public $desiredstock = 0; /* - * Service expiration - */ + * Service expiration + */ public $duration_value; /** @@ -261,6 +261,13 @@ class Product extends CommonObject */ public $finished; + /** + * fk_default_bom indicates the default bom + * + * @var int + */ + public $fk_default_bom; + /** * We must manage lot/batch number, sell-by date and so on : '1':yes '0':no * @@ -372,6 +379,9 @@ class Product extends CommonObject public $oldcopy; + /** + * @var int Default warehouse Id + */ public $fk_default_warehouse; /** * @var int ID @@ -388,6 +398,10 @@ class Product extends CommonObject * @see $ref_supplier */ public $ref_fourn; + + /** + * @var string ref supplier + */ public $ref_supplier; /** @@ -419,6 +433,31 @@ class Product extends CommonObject public $is_object_used; + /** + * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' is the CSS style to use on field. For example: 'maxwidth200' + * 'help' is a string visible as a tooltip on field + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + /** * @var array fields of object product */ @@ -426,8 +465,8 @@ class Product extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>5), - 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), - 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'!empty($conf->barcode->enabled)', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>1), + 'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>2, 'position'=>15), + 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>'!empty($conf->barcode->enabled)', 'position'=>20, 'visible'=>-1, 'showoncombobox'=>3), 'fk_barcode_type' => array('type'=>'integer', 'label'=>'BarcodeType', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>-1,), 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61), 'note' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62), @@ -511,7 +550,7 @@ class Product extends CommonObject { global $conf, $langs; - $error = 0; + $error = 0; // Clean parameters $this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref))); @@ -1048,16 +1087,16 @@ class Product extends CommonObject $sql .= " SET label = '".$this->db->escape($this->label)."'"; if ($updatetype && ($this->isProduct() || $this->isService())) { - $sql .= ", fk_product_type = ".$this->type; + $sql .= ", fk_product_type = ".((int) $this->type); } $sql .= ", ref = '".$this->db->escape($this->ref)."'"; $sql .= ", ref_ext = ".(!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null"); $sql .= ", default_vat_code = ".($this->default_vat_code ? "'".$this->db->escape($this->default_vat_code)."'" : "null"); - $sql .= ", tva_tx = ".$this->tva_tx; - $sql .= ", recuperableonly = ".$this->tva_npr; - $sql .= ", localtax1_tx = ".$this->localtax1_tx; - $sql .= ", localtax2_tx = ".$this->localtax2_tx; + $sql .= ", tva_tx = ".((float) $this->tva_tx); + $sql .= ", recuperableonly = ".((int) $this->tva_npr); + $sql .= ", localtax1_tx = ".((float) $this->localtax1_tx); + $sql .= ", localtax2_tx = ".((float) $this->localtax2_tx); $sql .= ", localtax1_type = ".($this->localtax1_type != '' ? "'".$this->db->escape($this->localtax1_type)."'" : "'0'"); $sql .= ", localtax2_type = ".($this->localtax2_type != '' ? "'".$this->db->escape($this->localtax2_type)."'" : "'0'"); @@ -1070,6 +1109,7 @@ class Product extends CommonObject $sql .= ", batch_mask = '".$this->db->escape($this->batch_mask)."'"; $sql .= ", finished = ".((!isset($this->finished) || $this->finished < 0 || $this->finished == '') ? "null" : (int) $this->finished); + $sql .= ", fk_default_bom = ".((!isset($this->fk_default_bom) || $this->fk_default_bom < 0 || $this->fk_default_bom == '') ? "null" : (int) $this->fk_default_bom); $sql .= ", net_measure = ".($this->net_measure != '' ? "'".$this->db->escape($this->net_measure)."'" : 'null'); $sql .= ", net_measure_units = ".($this->net_measure_units != '' ? "'".$this->db->escape($this->net_measure_units)."'" : 'null'); $sql .= ", weight = ".($this->weight != '' ? "'".$this->db->escape($this->weight)."'" : 'null'); @@ -1122,8 +1162,8 @@ class Product extends CommonObject // Multilangs if (!empty($conf->global->MAIN_MULTILANGS)) { if ($this->setMultiLangs($user) < 0) { - $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; - return -2; + $this->error = $langs->trans("Error")." : ".$this->db->error()." - ".$sql; + return -2; } } @@ -1627,6 +1667,36 @@ class Product extends CommonObject } } + /** + * used to check if price have really change to avoid log pollution + * + * @param int $level price level to change + * @return array + */ + private function getArrayForPriceCompare($level = 0) + { + + $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); + + foreach ($testExit as $field) { + if (!isset($this->$field[$level])) { + return array(); + } + } + + $lastPrice = array( + 'level' => $level ? $level : 1, + 'multiprices' => doubleval($this->multiprices[$level]), + 'multiprices_ttc' => doubleval($this->multiprices_ttc[$level]), + 'multiprices_base_type' => $this->multiprices_base_type[$level], + 'multiprices_min' => doubleval($this->multiprices_min[$level]), + 'multiprices_min_ttc' => doubleval($this->multiprices_min_ttc[$level]), + 'multiprices_tva_tx' => doubleval($this->multiprices_tva_tx[$level]), + 'multiprices_recuperableonly' => doubleval($this->multiprices_recuperableonly[$level]), + ); + + return $lastPrice; + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1652,8 +1722,8 @@ class Product extends CommonObject // Add new price $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price(price_level,date_price, fk_product, fk_user_author, price, price_ttc, price_base_type,tosell, tva_tx, default_vat_code, recuperableonly,"; $sql .= " localtax1_tx, localtax2_tx, localtax1_type, localtax2_type, price_min,price_min_ttc,price_by_qty,entity,fk_price_expression) "; - $sql .= " VALUES(".($level ? $level : 1).", '".$this->db->idate($now)."',".$this->id.",".$user->id.",".$this->price.",".$this->price_ttc.",'".$this->db->escape($this->price_base_type)."',".$this->status.",".$this->tva_tx.", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").",".$this->tva_npr.","; - $sql .= " ".$this->localtax1_tx.", ".$this->localtax2_tx.", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".$this->price_min.",".$this->price_min_ttc.",".$this->price_by_qty.",".$conf->entity.",".($this->fk_price_expression > 0 ? $this->fk_price_expression : 'null'); + $sql .= " VALUES(".($level ? $level : 1).", '".$this->db->idate($now)."', ".$this->id.", ".$user->id.", ".price2num($this->price).", ".price2num($this->price_ttc).",'".$this->db->escape($this->price_base_type)."',".((int) $this->status).", ".price2num($this->tva_tx).", ".($this->default_vat_code ? ("'".$this->db->escape($this->default_vat_code)."'") : "null").", ".((int) $this->tva_npr).","; + $sql .= " ".price2num($this->localtax1_tx).", ".price2num($this->localtax2_tx).", '".$this->db->escape($this->localtax1_type)."', '".$this->db->escape($this->localtax2_type)."', ".price2num($this->price_min).", ".price2num($this->price_min_ttc).", ".price2num($this->price_by_qty).", ".$conf->entity.",".($this->fk_price_expression > 0 ? ((int) $this->fk_price_expression) : 'null'); $sql .= ")"; dol_syslog(get_class($this)."::_log_price", LOG_DEBUG); @@ -1975,6 +2045,8 @@ class Product extends CommonObject { global $conf, $langs; + $lastPriceData = $this->getArrayForPriceCompare($level); // temporary store current price before update + $id = $this->id; dol_syslog(get_class($this)."::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level." npr=".$newnpr." newdefaultvatcode=".$newdefaultvatcode); @@ -2107,7 +2179,11 @@ class Product extends CommonObject // Price by quantity $this->price_by_qty = $newpbq; - $this->_log_price($user, $level); // Save price for level into table product_price + // check if price have really change before log + $newPriceData = $this->getArrayForPriceCompare($level); + if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || empty($conf->global->PRODUIT_MULTIPRICES)) { + $this->_log_price($user, $level); // Save price for level into table product_price + } $this->level = $level; // Store level of price edited for trigger @@ -2168,7 +2244,7 @@ class Product extends CommonObject // Check parameters if (!$id && !$ref && !$ref_ext && !$barcode) { $this->error = 'ErrorWrongParameters'; - dol_syslog(get_class($this)."::fetch ".$this->error); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } @@ -2176,7 +2252,7 @@ class Product extends CommonObject $sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly as tva_npr, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,"; $sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,"; $sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,"; - $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished,"; + $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom,"; if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; } else { @@ -2185,8 +2261,8 @@ class Product extends CommonObject //For MultiCompany //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity - $separatedEntityPMP = false; - $separatedStock = false; + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. if (!empty($conf->global->MULTICOMPANY_PRODUCT_SHARING_ENABLED)) { if (!empty($conf->global->MULTICOMPANY_PMP_PER_ENTITY_ENABLED)) { $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . MAIN_DB_PREFIX . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); @@ -2201,24 +2277,26 @@ class Product extends CommonObject $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); } } - if ($separatedStock) { - $sql .= " SUM(sp.reel) as stock,"; - } else { - $sql .= " p.stock,"; - } if ($separatedEntityPMP) { - $sql .= " ppe.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " ppe.pmp,"; } else { - $sql .= " p.pmp, p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " p.pmp,"; + } + $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf,"; + if ($separatedStock) { + $sql .= " SUM(sp.reel) as stock"; + } else { + $sql .= " p.stock"; } - $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) || $separatedEntityPMP) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); } if ($separatedStock) { - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_stock as sp ON sp.fk_product = p.rowid"; + $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; } + if ($id) { $sql .= " WHERE p.rowid = ".((int) $id); } else { @@ -2232,12 +2310,28 @@ class Product extends CommonObject } } if ($separatedStock) { - $sql .= " AND sp.fk_entrepot IN ( - SELECT rowid - FROM ".MAIN_DB_PREFIX."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; + $sql .= " GROUP BY p.rowid, p.ref, p.ref_ext, p.label, p.description, p.url, p.note_public, p.note, p.customcode, p.fk_country, p.fk_state, p.lifetime, p.qc_frequency, p.price, p.price_ttc,"; + $sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,"; + $sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,"; + $sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,"; + $sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished,"; + if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { + $sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,"; + } else { + $sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,"; + } + if ($separatedEntityPMP) { + $sql .= " ppe.pmp,"; + } else { + $sql .= " p.pmp,"; + } + $sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.batch_mask, p.fk_unit,"; + $sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf"; + if (!$separatedStock) { + $sql .= ", p.stock"; + } } - $resql = $this->db->query($sql); if ($resql) { unset($this->oldcopy); @@ -2285,6 +2379,8 @@ class Product extends CommonObject $this->localtax2_type = $obj->localtax2_type; $this->finished = $obj->finished; + $this->fk_default_bom = $obj->fk_default_bom; + $this->duration = $obj->duration; $this->duration_value = substr($obj->duration, 0, dol_strlen($obj->duration) - 1); $this->duration_unit = substr($obj->duration, -1); @@ -2348,8 +2444,8 @@ class Product extends CommonObject $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; - $sql .= " AND price_level=".$i; - $sql .= " AND fk_product = ".$this->id; + $sql .= " AND price_level=".((int) $i); + $sql .= " AND fk_product = ".((int) $this->id); $sql .= " ORDER BY date_price DESC, rowid DESC"; $sql .= " LIMIT 1"; $resql = $this->db->query($sql); @@ -2367,39 +2463,39 @@ class Product extends CommonObject // Price by quantity /* - $this->prices_by_qty[$i]=$result["price_by_qty"]; - $this->prices_by_qty_id[$i]=$result["rowid"]; - // Récuperation de la liste des prix selon qty si flag positionné - if ($this->prices_by_qty[$i] == 1) - { - $sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type"; - $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; - $sql.= " WHERE fk_product_price = ".$this->prices_by_qty_id[$i]; - $sql.= " ORDER BY quantity ASC"; - $resultat=array(); - $resql = $this->db->query($sql); - if ($resql) - { - $ii=0; - while ($result= $this->db->fetch_array($resql)) { - $resultat[$ii]=array(); - $resultat[$ii]["rowid"]=$result["rowid"]; - $resultat[$ii]["price"]= $result["price"]; - $resultat[$ii]["unitprice"]= $result["unitprice"]; - $resultat[$ii]["quantity"]= $result["quantity"]; - $resultat[$ii]["remise_percent"]= $result["remise_percent"]; - $resultat[$ii]["remise"]= $result["remise"]; // deprecated - $resultat[$ii]["price_base_type"]= $result["price_base_type"]; - $ii++; - } - $this->prices_by_qty_list[$i]=$resultat; - } - else - { - dol_print_error($this->db); - return -1; - } - }*/ + $this->prices_by_qty[$i]=$result["price_by_qty"]; + $this->prices_by_qty_id[$i]=$result["rowid"]; + // Récuperation de la liste des prix selon qty si flag positionné + if ($this->prices_by_qty[$i] == 1) + { + $sql = "SELECT rowid, price, unitprice, quantity, remise_percent, remise, price_base_type"; + $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; + $sql.= " WHERE fk_product_price = ".$this->prices_by_qty_id[$i]; + $sql.= " ORDER BY quantity ASC"; + $resultat=array(); + $resql = $this->db->query($sql); + if ($resql) + { + $ii=0; + while ($result= $this->db->fetch_array($resql)) { + $resultat[$ii]=array(); + $resultat[$ii]["rowid"]=$result["rowid"]; + $resultat[$ii]["price"]= $result["price"]; + $resultat[$ii]["unitprice"]= $result["unitprice"]; + $resultat[$ii]["quantity"]= $result["quantity"]; + $resultat[$ii]["remise_percent"]= $result["remise_percent"]; + $resultat[$ii]["remise"]= $result["remise"]; // deprecated + $resultat[$ii]["price_base_type"]= $result["price_base_type"]; + $ii++; + } + $this->prices_by_qty_list[$i]=$resultat; + } + else + { + dol_print_error($this->db); + return -1; + } + }*/ } else { $this->error = $this->db->lasterror; return -1; @@ -2458,7 +2554,7 @@ class Product extends CommonObject $sql .= " price_base_type, tva_tx, default_vat_code, tosell, price_by_qty, rowid, recuperableonly"; $sql .= " FROM ".MAIN_DB_PREFIX."product_price"; $sql .= " WHERE entity IN (".getEntity('productprice').")"; - $sql .= " AND price_level=".$i; + $sql .= " AND price_level=".((int) $i); $sql .= " AND fk_product = ".$this->id; $sql .= " ORDER BY date_price DESC, rowid DESC"; $sql .= " LIMIT 1"; @@ -2513,9 +2609,9 @@ class Product extends CommonObject } if (!empty($conf->dynamicprices->enabled) && !empty($this->fk_price_expression) && empty($ignore_expression)) { - include_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; + include_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); - $price_result = $priceparser->parseProduct($this); + $price_result = $priceparser->parseProduct($this); if ($price_result >= 0) { $this->price = $price_result; // Calculate the VAT @@ -2533,7 +2629,7 @@ class Product extends CommonObject return 0; } } else { - $this->error = $this->db->lasterror; + $this->error = $this->db->lasterror(); return -1; } } @@ -2570,7 +2666,7 @@ class Product extends CommonObject $sql .= " AND mp.fk_product =".$this->id; $sql .= " AND mp.role ='".$this->db->escape($role)."'"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2578,7 +2674,7 @@ class Product extends CommonObject $obj = $this->db->fetch_object($result); $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; - $this->stats_mo['qty_'.$role] = $obj->qty ? $obj->qty : 0; + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() } else { $this->error = $this->db->error(); $error++; @@ -2623,14 +2719,14 @@ class Product extends CommonObject $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid"; $sql .= " WHERE "; $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND b.fk_product =".$this->id; + $sql .= " AND b.fk_product =".((int) $this->id); $sql .= " GROUP BY b.rowid"; $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); - $this->stats_bom['nb_toproduce'] = $obj->nb_toproduce ? $obj->nb_toproduce : 0; - $this->stats_bom['qty_toproduce'] = $obj->qty_toproduce ? price2num($obj->qty_toproduce) : 0; + $this->stats_bom['nb_toproduce'] = !empty($obj->nb_toproduce) ? $obj->nb_toproduce : 0; + $this->stats_bom['qty_toproduce'] = !empty($obj->qty_toproduce) ? price2num($obj->qty_toproduce) : 0; } else { $this->error = $this->db->error(); $error++; @@ -2642,13 +2738,13 @@ class Product extends CommonObject $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid"; $sql .= " WHERE "; $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND bl.fk_product =".$this->id; + $sql .= " AND bl.fk_product =".((int) $this->id); $result = $this->db->query($sql); if ($result) { $obj = $this->db->fetch_object($result); - $this->stats_bom['nb_toconsume'] = $obj->nb_toconsume ? $obj->nb_toconsume : 0; - $this->stats_bom['qty_toconsume'] = $obj->qty_toconsume ? price2num($obj->qty_toconsume) : 0; + $this->stats_bom['nb_toconsume'] = !empty($obj->nb_toconsume) ? $obj->nb_toconsume : 0; + $this->stats_bom['qty_toconsume'] = !empty($obj->qty_toconsume) ? price2num($obj->qty_toconsume) : 0; } else { $this->error = $this->db->error(); $error++; @@ -2696,7 +2792,7 @@ class Product extends CommonObject } //$sql.= " AND pr.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2771,7 +2867,7 @@ class Product extends CommonObject } //$sql.= " AND pr.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -2826,7 +2922,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND c.fk_statut in (".$this->db->sanitize($filtrestatut).")"; @@ -2928,7 +3024,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if ($filtrestatut != '') { $sql .= " AND c.fk_statut in (".$this->db->sanitize($filtrestatut).")"; // Peut valoir 0 @@ -2990,7 +3086,7 @@ class Product extends CommonObject $sql .= " AND e.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND c.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; @@ -3071,7 +3167,7 @@ class Product extends CommonObject $sql .= " AND cf.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND cf.fk_soc = ".$socid; + $sql .= " AND cf.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND cf.fk_statut IN (".$this->db->sanitize($filtrestatut).")"; @@ -3127,7 +3223,7 @@ class Product extends CommonObject $sql .= " AND m.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND m.fk_soc = ".$socid; + $sql .= " AND m.fk_soc = ".((int) $socid); } if ($filtrestatut <> '') { $sql .= " AND m.status IN (".$this->db->sanitize($filtrestatut).")"; @@ -3222,7 +3318,7 @@ class Product extends CommonObject } //$sql.= " AND c.statut != 0"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3296,7 +3392,7 @@ class Product extends CommonObject } //$sql.= " AND f.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3370,7 +3466,7 @@ class Product extends CommonObject } //$sql.= " AND f.fk_statut != 0"; if ($socid > 0) { - $sql .= " AND f.fk_soc = ".$socid; + $sql .= " AND f.fk_soc = ".((int) $socid); } $result = $this->db->query($sql); @@ -3612,7 +3708,7 @@ class Product extends CommonObject $sql .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(p.datep,'%Y%m')"; @@ -3715,7 +3811,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_commande,'%Y%m')"; @@ -3766,7 +3862,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_commande,'%Y%m')"; @@ -3820,7 +3916,7 @@ class Product extends CommonObject $sql .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(c.date_contrat,'%Y%m')"; @@ -3873,7 +3969,7 @@ class Product extends CommonObject $sql .= " AND d.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; } if ($socid > 0) { - $sql .= " AND d.fk_soc = ".$socid; + $sql .= " AND d.fk_soc = ".((int) $socid); } $sql .= $morefilter; $sql .= " GROUP BY date_format(d.date_valid,'%Y%m')"; @@ -3928,10 +4024,10 @@ class Product extends CommonObject $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty,incdec)'; $sql .= ' VALUES ('.((int) $id_pere).', '.((int) $id_fils).', '.((float) $qty).', '.((int) $incdec).')'; if (!$this->db->query($sql)) { - dol_print_error($this->db); - return -1; + dol_print_error($this->db); + return -1; } else { - return 1; + return 1; } } } @@ -4135,7 +4231,7 @@ class Product extends CommonObject return -1; } } else { - // If the supplier price already exists for this product and quantity + // If the supplier price already exists for this product and quantity $this->product_fourn_price_id = $obj->rowid; return 0; } @@ -4310,16 +4406,16 @@ class Product extends CommonObject // les fournisseurs /*$sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur (" - . " datec, fk_product, fk_soc, ref_fourn, fk_user_author )" - . " SELECT '".$this->db->idate($now)."', ".$toId.", fk_soc, ref_fourn, fk_user_author" - . " FROM ".MAIN_DB_PREFIX."product_fournisseur" - . " WHERE fk_product = ".((int) $fromId); + . " datec, fk_product, fk_soc, ref_fourn, fk_user_author )" + . " SELECT '".$this->db->idate($now)."', ".$toId.", fk_soc, ref_fourn, fk_user_author" + . " FROM ".MAIN_DB_PREFIX."product_fournisseur" + . " WHERE fk_product = ".((int) $fromId); - if ( ! $this->db->query($sql ) ) - { - $this->db->rollback(); - return -1; - }*/ + if ( ! $this->db->query($sql ) ) + { + $this->db->rollback(); + return -1; + }*/ // les prix de fournisseurs. $sql = "INSERT ".MAIN_DB_PREFIX."product_fournisseur_price ("; @@ -4400,7 +4496,7 @@ class Product extends CommonObject // Recursive call if there is childs to child if (is_array($desc_pere['childs'])) { - //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; $this->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1] * $multiply, $level + 1, $id, $ignore_stock_load); } } @@ -4597,17 +4693,17 @@ class Product extends CommonObject } $alreadyfound[$rec['rowid']] = 1; $prods[$rec['rowid']] = array( - 0=>$rec['rowid'], - 1=>$rec['qty'], - 2=>$rec['fk_product_type'], - 3=>$this->db->escape($rec['label']), - 4=>$rec['incdec'], - 5=>$rec['ref'] + 0=>$rec['rowid'], + 1=>$rec['qty'], + 2=>$rec['fk_product_type'], + 3=>$this->db->escape($rec['label']), + 4=>$rec['incdec'], + 5=>$rec['ref'] ); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); if (empty($firstlevelonly)) { - $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1); + $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1); foreach ($listofchilds as $keyChild => $valueChild) { $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } @@ -5066,9 +5162,10 @@ class Product extends CommonObject /** * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products) * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id. - * If ENTREPOT_EXTRA_STATUS set, filtering on warehouse status possible. + * If ENTREPOT_EXTRA_STATUS is set, filtering on warehouse status is possible. * * @param string $option '' = Load all stock info, also from closed and internal warehouses, 'nobatch', 'novirtual' + * You can also filter on 'warehouseclosed', 'warehouseopen', 'warehouseinternal' * @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation * @return int < 0 if KO, > 0 if OK * @see load_virtual_stock(), loadBatchInfo() @@ -5082,16 +5179,20 @@ class Product extends CommonObject $this->stock_warehouse = array(); $this->stock_theorique = 0; + // Set filter on warehouse status $warehouseStatus = array(); - if (preg_match('/warehouseclosed/', $option)) { - $warehouseStatus[] = Entrepot::STATUS_CLOSED; + $warehouseStatus[Entrepot::STATUS_CLOSED] = Entrepot::STATUS_CLOSED; } if (preg_match('/warehouseopen/', $option)) { - $warehouseStatus[] = Entrepot::STATUS_OPEN_ALL; + $warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL; } if (preg_match('/warehouseinternal/', $option)) { - $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; + if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { + $warehouseStatus[Entrepot::STATUS_OPEN_INTERNAL] = Entrepot::STATUS_OPEN_INTERNAL; + } else { + $warehouseStatus[Entrepot::STATUS_OPEN_ALL] = Entrepot::STATUS_OPEN_ALL; + } } $sql = "SELECT ps.rowid, ps.reel, ps.fk_entrepot"; @@ -5100,10 +5201,12 @@ class Product extends CommonObject $sql .= " WHERE w.entity IN (".getEntity('stock').")"; $sql .= " AND w.rowid = ps.fk_entrepot"; $sql .= " AND ps.fk_product = ".$this->id; - if (!empty($conf->global->ENTREPOT_EXTRA_STATUS) && count($warehouseStatus)) { + if (count($warehouseStatus)) { $sql .= " AND w.statut IN (".$this->db->sanitize(implode(',', $warehouseStatus)).")"; } + $sql .= " ORDER BY ps.reel ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation; + dol_syslog(get_class($this)."::load_stock", LOG_DEBUG); $result = $this->db->query($sql); if ($result) { @@ -5141,7 +5244,7 @@ class Product extends CommonObject * Load value ->stock_theorique of a product. Property this->id must be defined. * This function need a lot of load. If you use it on list, use a cache to execute it one for each product id. * - * @param int $includedraftpoforvirtual Include draft status of PO for virtual stock calculation + * @param int $includedraftpoforvirtual Include draft status and not yet approved Purchase Orders for virtual stock calculation * @return int < 0 if KO, > 0 if OK * @see load_stock(), loadBatchInfo() */ @@ -5180,9 +5283,9 @@ class Product extends CommonObject $stock_sending_client = $this->stats_expedition['qty']; } if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled)) { - $filterStatus = '1,2,3,4'; + $filterStatus = empty($conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK) ? '2,3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; if (isset($includedraftpoforvirtual)) { - $filterStatus = '0,'.$filterStatus; + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them } $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1); if ($result < 0) { @@ -5190,17 +5293,6 @@ class Product extends CommonObject } $stock_commande_fournisseur = $this->stats_commande_fournisseur['qty']; } - if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { - $filterStatus = '4'; - if (isset($includedraftpoforvirtual)) { - $filterStatus = '0,'.$filterStatus; - } - $result = $this->load_stats_reception(0, $filterStatus, 1); - if ($result < 0) { - dol_print_error($this->db, $this->error); - } - $stock_reception_fournisseur = $this->stats_reception['qty']; - } if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && empty($conf->reception->enabled)) { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) { @@ -5379,11 +5471,11 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Retourne tableau de toutes les photos du produit + * Return an array with all photos of product found on disk. There is no sorting criteria. * - * @param string $dir Repertoire a scanner - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @return array Tableau de photos + * @param string $dir Directory to scan + * @param int $nbmax Number maxium of photos (0=no maximum) + * @return array Array of photos */ public function liste_photos($dir, $nbmax = 0) { @@ -5404,9 +5496,10 @@ class Product extends CommonObject if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) { $nbphoto++; - // On determine nom du fichier vignette + // We forge name of thumb. $photo = $file; $photo_vignette = ''; + $regs = array(); if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs)) { $photo_vignette = preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0]; } @@ -5424,7 +5517,7 @@ class Product extends CommonObject $tabobj[$nbphoto - 1] = $obj; - // On continue ou on arrete de boucler ? + // Do we have to continue with next photo ? if ($nbmax && $nbphoto >= $nbmax) { break; } @@ -5439,9 +5532,9 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Efface la photo du produit et sa vignette + * Delete a photo and its thumbs * - * @param string $file Chemin de l'image + * @param string $file Path to image file * @return void */ public function delete_photo($file) @@ -5735,8 +5828,8 @@ class Product extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'product_customer_price', - 'product_customer_price_log' + 'product_customer_price', + 'product_customer_price_log' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 10704f2f53e..4408afd9ff1 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2007-2021 Laurent Destailleur * Copyright (C) 2013-2014 Cedric GROSS * * This program is free software; you can redistribute it and/or modify @@ -44,8 +44,8 @@ class Productbatch extends CommonObject public $tms = ''; public $fk_product_stock; - public $sellby = ''; - public $eatby = ''; + public $sellby = ''; // dlc + public $eatby = ''; // dmd/dluo public $batch = ''; public $qty; public $warehouseid; @@ -384,7 +384,7 @@ class Productbatch extends CommonObject $sql .= " t.qty,"; $sql .= " t.import_key"; $sql .= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; - $sql .= " WHERE fk_product_stock=".$fk_product_stock; + $sql .= " WHERE fk_product_stock=".((int) $fk_product_stock); if (!empty($eatby)) { array_push($where, " eatby = '".$this->db->idate($eatby)."'"); // deprecated @@ -436,7 +436,7 @@ class Productbatch extends CommonObject */ public static function findAll($db, $fk_product_stock, $with_qty = 0, $fk_product = 0) { - global $langs; + global $langs, $conf; $ret = array(); $sql = "SELECT"; @@ -454,14 +454,20 @@ class Productbatch extends CommonObject } $sql .= " FROM ".MAIN_DB_PREFIX."product_batch as t"; if ($fk_product > 0) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.fk_product = ".$fk_product." AND pl.batch = t.batch"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot as pl ON pl.fk_product = ".((int) $fk_product)." AND pl.batch = t.batch"; // TODO May add extrafields to ? } - $sql .= " WHERE fk_product_stock=".$fk_product_stock; + $sql .= " WHERE fk_product_stock=".((int) $fk_product_stock); if ($with_qty) { $sql .= " AND t.qty <> 0"; } + $sql .= " ORDER BY "; + // TODO : use product lifo and fifo when product will implement it + if ($fk_product > 0) { $sql .= "pl.eatby ASC, pl.sellby ASC, "; } + $sql .= "t.eatby ASC, t.sellby ASC "; + $sql .= ", t.qty ".(!empty($conf->global->DO_NOT_TRY_TO_DEFRAGMENT_STOCKS_WAREHOUSE)?'DESC':'ASC'); // Note : qty ASC is important for expedition card, to avoid stock fragmentation + dol_syslog("productbatch::findAll", LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 9b0d29b4cdd..0683732d6cb 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -209,7 +209,7 @@ class Productcustomerprice extends CommonObject $sql .= "fk_user,"; $sql .= "import_key"; $sql .= ") VALUES ("; - $sql .= " ".$conf->entity.","; + $sql .= " ".((int) $conf->entity).","; $sql .= " '".$this->db->idate(dol_now())."',"; $sql .= " ".(!isset($this->fk_product) ? 'NULL' : "'".$this->db->escape($this->fk_product)."'").","; $sql .= " ".(!isset($this->fk_soc) ? 'NULL' : "'".$this->db->escape($this->fk_soc)."'").","; @@ -226,7 +226,7 @@ class Productcustomerprice extends CommonObject $sql .= " ".(!isset($this->localtax1_tx) ? 'NULL' : (empty($this->localtax1_tx) ? 0 : $this->localtax1_tx)).","; $sql .= " ".(empty($this->localtax2_type) ? "'0'" : "'".$this->db->escape($this->localtax2_type)."'").","; $sql .= " ".(!isset($this->localtax2_tx) ? 'NULL' : (empty($this->localtax2_tx) ? 0 : $this->localtax2_tx)).","; - $sql .= " ".$user->id.","; + $sql .= " ".((int) $user->id).","; $sql .= " ".(!isset($this->import_key) ? 'NULL' : "'".$this->db->escape($this->import_key)."'").""; $sql .= ")"; diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index a1d92cc492a..67c24ac37c8 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -105,7 +105,6 @@ class Propalmergepdfproduct extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal_merge_pdf_product("; - $sql .= "fk_product,"; $sql .= "file_name,"; if ($conf->global->MAIN_MULTILANGS) { @@ -114,25 +113,19 @@ class Propalmergepdfproduct extends CommonObject $sql .= "fk_user_author,"; $sql .= "fk_user_mod,"; $sql .= "datec"; - - $sql .= ") VALUES ("; - - $sql .= " ".(!isset($this->fk_product) ? 'NULL' : "'".$this->db->escape($this->fk_product)."'").","; + $sql .= " ".(!isset($this->fk_product) ? 'NULL' : ((int) $this->fk_product)).","; $sql .= " ".(!isset($this->file_name) ? 'NULL' : "'".$this->db->escape($this->file_name)."'").","; if ($conf->global->MAIN_MULTILANGS) { $sql .= " ".(!isset($this->lang) ? 'NULL' : "'".$this->db->escape($this->lang)."'").","; } - $sql .= " ".$user->id.","; - $sql .= " ".$user->id.","; + $sql .= " ".((int) $user->id).","; + $sql .= " ".((int) $user->id).","; $sql .= " '".$this->db->idate(dol_now())."'"; - - $sql .= ")"; $this->db->begin(); - dol_syslog(__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); @@ -408,10 +401,10 @@ class Propalmergepdfproduct extends CommonObject if (!$error) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product"; - $sql .= " WHERE fk_product=".$product_id; + $sql .= " WHERE fk_product = ".((int) $product_id); if ($conf->global->MAIN_MULTILANGS && !empty($lang_id)) { - $sql .= " AND lang='".$this->db->escape($lang_id)."'"; + $sql .= " AND lang = '".$this->db->escape($lang_id)."'"; } dol_syslog(__METHOD__, LOG_DEBUG); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 442232686d3..e2539dae31c 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -50,7 +50,9 @@ if (!empty($user->socid)) { } $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('productcompositioncard', 'globalcard')); $object = new Product($db); $objectid = 0; @@ -60,6 +62,19 @@ if ($id > 0 || !empty($ref)) { $id = $object->id; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} + /* * Actions @@ -188,7 +203,7 @@ print dol_get_fiche_head($head, 'subproduct', $titre, -1, $picto); if ($id > 0 || !empty($ref)) { /* - * Fiche en mode edition + * Product card */ if ($user->rights->produit->lire || $user->rights->service->lire) { $linkback = ''.$langs->trans("BackToList").''; @@ -206,6 +221,16 @@ if ($id > 0 || !empty($ref)) { print ''; + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + // Nature if ($object->type != Product::TYPE_SERVICE) { print ''; + if (!empty($arrayfields['p.rowid']['checked'])) { + print ''; + } if (!empty($arrayfields['p.ref']['checked'])) { print ''; + print ''; } // State if (!empty($arrayfields['p.fk_state']['checked'])) { - print ''; + print ''; } // Accountancy code sell if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) { @@ -1058,6 +1087,9 @@ if ($resql) { print ''; print ''; + if (!empty($arrayfields['p.rowid']['checked'])) { + print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", "", $param, "", $sortfield, $sortorder); + } if (!empty($arrayfields['p.ref']['checked'])) { print_liste_field_titre($arrayfields['p.ref']['label'], $_SERVER["PHP_SELF"], "p.ref", "", $param, "", $sortfield, $sortorder); } @@ -1236,8 +1268,8 @@ if ($resql) { $product_static->id = $obj->rowid; $product_static->ref = $obj->ref; - $product_static->ref_fourn = $obj->ref_supplier; // deprecated - $product_static->ref_supplier = $obj->ref_supplier; + $product_static->ref_fourn = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; // deprecated + $product_static->ref_supplier = empty($obj->ref_supplier) ? '' : $obj->ref_supplier; $product_static->label = $obj->label; $product_static->finished = $obj->finished; $product_static->type = $obj->fk_product_type; @@ -1281,6 +1313,16 @@ if ($resql) { print ''; + // Ref + if (!empty($arrayfields['p.rowid']['checked'])) { + print '\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } + // Ref if (!empty($arrayfields['p.ref']['checked'])) { print ''; + } + // Selling price - print ''; print ''; + } + // We show only vat for level 1 - print ''; + print ''; print ''; print ''; } else { + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + // TVA - print ''; // This code hides the numeric price input if is not selected, loads the editor page if editor button is pressed @@ -1470,7 +1517,6 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul } print ''; - print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL; if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { print ''; } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 342acb49b6e..f8db6915409 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -190,7 +190,7 @@ if ($fourn_id > 0) { } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; $sql .= " p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock"; diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 38b16cea44a..ea9901a3794 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -179,7 +179,7 @@ if ($fourn_id > 0) { } // Insert categ filter if ($search_categ) { - $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); + $sql .= " AND cp.fk_categorie = ".((int) $search_categ); } if ($search_warehouse) { $sql .= natural_search("e.ref", $search_warehouse); diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index 053d9d6b1a8..52eec409185 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -41,10 +41,9 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('productstatscontract')); +$hookmanager->initHooks(array('productstatsbom')); $mesg = ''; $option = ''; @@ -67,6 +66,8 @@ if (!$sortfield) { $sortfield = "b.date_valid"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View @@ -137,7 +138,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b"; $sql .= " WHERE "; $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND b.fk_product =".$product->id; + $sql .= " AND b.fk_product = ".((int) $product->id); $sql .= $db->order($sortfield, $sortorder); // Count total nb of records @@ -183,9 +184,8 @@ if ($id > 0 || !empty($ref)) { $sql .= " SUM(bl.qty) as qty_toconsume"; $sql .= " FROM ".MAIN_DB_PREFIX."bom_bom as b"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."bom_bomline as bl ON bl.fk_bom=b.rowid"; - $sql .= " WHERE "; - $sql .= " b.entity IN (".getEntity('bom').")"; - $sql .= " AND bl.fk_product=".$product->id; + $sql .= " WHERE b.entity IN (".getEntity('bom').")"; + $sql .= " AND bl.fk_product = ".((int) $product->id); $sql .= " GROUP BY b.rowid, b.ref, b.date_valid, b.status"; $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 2dae292884e..3e7d9045dc8 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -58,7 +58,9 @@ if (!empty($user->socid)) { // Security check $fieldvalue = (!empty($id) ? $id : $ref); $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('productstatscard', 'globalcard')); $tmp = dol_getdate(dol_now()); $currentyear = $tmp['year']; @@ -66,6 +68,8 @@ if (empty($search_year)) { $search_year = $currentyear; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * Actions @@ -184,8 +188,8 @@ if ($result || empty($id)) { // Tag if ($conf->categorie->enabled) { print ''; } @@ -207,7 +211,7 @@ if ($result || empty($id)) { print $form->selectarray('search_year', $arrayyears, $search_year, 1, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, $usercancreate, $typeformat); + print '
    '.$langs->trans("Nature").''; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index af44521dc05..0b15ad7a85c 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -95,9 +95,19 @@ if ($id > 0 || !empty($ref)) { } $modulepart = 'produit'; + $permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* @@ -113,7 +123,7 @@ if ($reshook < 0) { if (empty($reshook)) { // Delete line if product propal merge is linked to a file if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { - if ($action == 'confirm_deletefile' && $confirm == 'yes') { + if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permissiontoadd) { //extract file name $urlfile = GETPOST('urlfile', 'alpha'); $filename = basename($urlfile); @@ -131,7 +141,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; } -if ($action == 'filemerge') { +if ($action == 'filemerge' && $permissiontoadd) { $is_refresh = GETPOST('refresh'); if (empty($is_refresh)) { $filetomerge_file_array = GETPOST('filetoadd'); diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 5286b932ca7..87cb8dea2c5 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -93,7 +93,7 @@ class PriceGlobalVariable $sql .= ") VALUES ("; $sql .= " ".(isset($this->code) ? "'".$this->db->escape($this->code)."'" : "''").","; $sql .= " ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; - $sql .= " ".$this->value; + $sql .= " ".((float) $this->value); $sql .= ")"; $this->db->begin(); @@ -182,7 +182,7 @@ class PriceGlobalVariable $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql .= " code = ".(isset($this->code) ? "'".$this->db->escape($this->code)."'" : "''").","; $sql .= " description = ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; - $sql .= " value = ".$this->value; + $sql .= " value = ".((float) $this->value); $sql .= " WHERE rowid = ".$this->id; $this->db->begin(); diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 172c004a2d7..331a65971b6 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -103,12 +103,12 @@ class PriceGlobalVariableUpdater $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." ("; $sql .= "type, description, parameters, fk_variable, update_interval, next_update, last_status"; $sql .= ") VALUES ("; - $sql .= " ".$this->type.","; + $sql .= " ".((int) $this->type).","; $sql .= " ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; $sql .= " ".(isset($this->parameters) ? "'".$this->db->escape($this->parameters)."'" : "''").","; - $sql .= " ".$this->fk_variable.","; - $sql .= " ".$this->update_interval.","; - $sql .= " ".$this->next_update.","; + $sql .= " ".((int) $this->fk_variable).","; + $sql .= " ".((int) $this->update_interval).","; + $sql .= " ".((int) $this->next_update).","; $sql .= " ".(isset($this->last_status) ? "'".$this->db->escape($this->last_status)."'" : "''"); $sql .= ")"; @@ -200,12 +200,12 @@ class PriceGlobalVariableUpdater // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; - $sql .= " type = ".$this->type.","; + $sql .= " type = ".((int) $this->type).","; $sql .= " description = ".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "''").","; $sql .= " parameters = ".(isset($this->parameters) ? "'".$this->db->escape($this->parameters)."'" : "''").","; - $sql .= " fk_variable = ".$this->fk_variable.","; - $sql .= " update_interval = ".$this->update_interval.","; - $sql .= " next_update = ".$this->next_update.","; + $sql .= " fk_variable = ".((int) $this->fk_variable).","; + $sql .= " update_interval = ".((int) $this->update_interval).","; + $sql .= " next_update = ".((int) $this->next_update).","; $sql .= " last_status = ".(isset($this->last_status) ? "'".$this->db->escape($this->last_status)."'" : "''"); $sql .= " WHERE rowid = ".$this->id; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0d5ea9647f5..97f29de72f6 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -103,17 +103,19 @@ if ($id > 0 || $ref) { $object->fetch($id, $ref); } -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); +$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); +$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); -if (!$sortfield) { - $sortfield = "s.nom"; +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); } -if (!$sortorder) { - $sortorder = "ASC"; -} - -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); /* @@ -124,9 +126,6 @@ if ($cancel) { $action = ''; } -$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); -$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); - $parameters = array('socid'=>$socid, 'id_prod'=>$id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -383,7 +382,7 @@ if ($id > 0 || $ref) { echo $formconfirm; } - if ($action <> 'edit' && $action <> 're-edit') { + if ($action != 'edit' && $action != 're-edit') { $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); $picto = ($object->type == Product::TYPE_SERVICE ? 'service' : 'product'); @@ -405,13 +404,23 @@ if ($id > 0 || $ref) { print '
    '; print ''; + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + // Cost price. Can be used for margin module for option "calculate margin on explicit cost price print ''; @@ -426,7 +435,7 @@ if ($id > 0 || $ref) { // Best buying Price print ''; - print ''; + print ''; } // Supplier ref if ($usercancreate) { // change required right here - print ''; + print ''; } else { - print ''; + print ''; } // Availability diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 0e709f54f99..f08ddd217ab 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -105,7 +105,8 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be print ''; } print ''; - print ''; + print ''; + print ''; if ($i == 0) { print ''; } @@ -287,7 +288,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= " WHERE p.entity IN (".getEntity($product_static->element, 1).")"; if ($type != '') { - $sql .= " AND p.fk_product_type = ".$type; + $sql .= " AND p.fk_product_type = ".((int) $type); } // Add where from hooks $parameters = array(); @@ -336,11 +337,11 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $product_static->status_buy = $objp->tobuy; $product_static->status_batch = $objp->tobatch; - //Multilangs + // Multilangs if (!empty($conf->global->MAIN_MULTILANGS)) { $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$objp->rowid; + $sql .= " WHERE fk_product=".((int) $objp->rowid); $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $resultd = $db->query($sql); @@ -354,10 +355,10 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us print ''; - print '\n"; - print ''; + print ''; print ""; @@ -372,7 +373,7 @@ if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($us $objp->price = $price_result; } } - print ''; - print ''; - print ''; if ($conf->productbatch->enabled) { - print ''; } @@ -654,13 +765,16 @@ if ($object->id > 0) { // Real quantity print ''; print ''; + $qty_tmp = price2num(GETPOST("id_".$obj->rowid."_input_tmp", 'MS')) >= 0 ? GETPOST("id_".$obj->rowid."_input_tmp") : $qty_view; + print ''; } else { print $obj->qty_view; $totalfound += $obj->qty_view; @@ -679,7 +793,7 @@ if ($object->id > 0) { print ''; if ($object->status == $object::STATUS_VALIDATED) { - print '
    '; + print '
    '; } print ''; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 1c1e09e3162..bc2ebdf20b4 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -49,8 +49,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { + // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -58,7 +59,9 @@ $pagenext = $page + 1; // Initialize technical objects $object = new Inventory($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->inventory->dir_output.'/temp/massgeneration/'.$user->id; +// no inventory docs yet +// $diroutputmassaction = $conf->inventory->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = null; $hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -66,12 +69,59 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { $sortorder = "ASC"; } +// Initialize array of search criterias +$search_all = GETPOST('search_all', 'alphanohtml'); +$search = array(); +foreach ($object->fields as $key => $val) { + if (GETPOST('search_'.$key, 'alpha') !== '') { + $search[$key] = GETPOST('search_'.$key, 'alpha'); + } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } +} + +// List of fields to search into when doing a "search in all" +$fieldstosearchall = array(); +foreach ($object->fields as $key => $val) { + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } +} +// Extra fields +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->stock->lire; +$permissiontoadd = $user->rights->stock->creer; +$permissiontodelete = $user->rights->stock->supprimer; + // Security check $socid = 0; if ($user->socid > 0) { // Protection if external user @@ -79,63 +129,19 @@ if ($user->socid > 0) { // Protection if external user accessforbidden(); } if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $result = restrictedArea($user, 'stock', $objectid); + $result = restrictedArea($user, 'stock'); } else { - $result = restrictedArea($user, 'stock', $objectid, '', 'inventory_advance'); + $result = restrictedArea($user, 'stock', 0, '', 'inventory_advance'); } -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - -// List of fields to search into when doing a "search in all" -$fieldstosearchall = array(); -foreach ($object->fields as $key => $val) { - if ($val['searchall']) { - $fieldstosearchall['t.'.$key] = $val['label']; - } -} - -// Definition of fields for list -$arrayfields = array(); -foreach ($object->fields as $key => $val) { - // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']); - } -} -// Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} -$object->fields = dol_sort_array($object->fields, 'position'); -$arrayfields = dol_sort_array($arrayfields, 'position'); - -$permissiontoread = $user->rights->stock->lire; -$permissiontoadd = $user->rights->stock->creer; -$permissiontodelete = $user->rights->stock->supprimer; - /* * Actions */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -155,8 +161,12 @@ if (empty($reshook)) { if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers foreach ($object->fields as $key => $val) { $search[$key] = ''; + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = ''; + $search[$key.'_dtend'] = ''; + } } - $toselect = ''; + $toselect = array(); $search_array_options = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') @@ -184,18 +194,18 @@ $now = dol_now(); //$help_url="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory"; $help_url = ''; $title = $langs->trans('ListOfInventories'); +$morejs = array(); +$morecss = array(); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } } // Add fields from hooks @@ -204,29 +214,48 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } + if ($search_all) { $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } @@ -239,7 +268,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; /* If a group by is required -$sql.= " GROUP BY " +$sql.= " GROUP BY "; foreach($object->fields as $key => $val) { $sql.='t.'.$key.', '; @@ -250,7 +279,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) { } // Add where from hooks $parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql=preg_replace('/,\s*$/','', $sql); */ @@ -296,7 +325,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -321,6 +350,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -337,7 +370,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -351,7 +384,7 @@ print ''; $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/inventory/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit); +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); // Add code for pre mass action (confirmation or email presend form) $topicmail = "Information"; @@ -391,31 +424,38 @@ $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfi $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat); + print '
    '; $textdesc = $langs->trans("CostPriceDescription"); $textdesc .= "
    ".$langs->trans("CostPriceUsage"); $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print '
    '; + print ''; print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print '
    '.$langs->trans("BuyingPriceMin").''; + print ''; $product_fourn = new ProductFournisseur($db); if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) { if ($product_fourn->product_fourn_price_id > 0) { @@ -836,12 +845,13 @@ END; print ''; print ''; - print ''; + print ''."\n"; } + // Actions buttons - print "\n
    \n"; + print '
    '."\n"; if ($action != 'add_price' && $action != 'update_price') { $parameters = array(); @@ -854,8 +864,7 @@ END; } } - print "\n
    \n"; - print '
    '; + print "
    \n"; if ($user->rights->fournisseur->lire) { // Duplicate ? this check is already in the head of this file $param = ''; @@ -1017,14 +1026,14 @@ END; // Supplier if (!empty($arrayfields['s.nom']['checked'])) { - print '
    '.$productfourn->getSocNomUrl(1, 'supplier').''.$productfourn->getSocNomUrl(1, 'supplier').''.$productfourn->getNomUrl().''.$productfourn->getNomUrl().''.$productfourn->fourn_ref.''.$productfourn->fourn_ref.'
    '.$langs->trans("Search").'
    '; + print ''; print $product_static->getNomUrl(1, '', 16); print "'.dol_trunc($objp->label, 32).''.dol_escape_htmltag($objp->label).'"; print dol_print_date($db->jdate($objp->datem), 'day'); print "'; + print ''; if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') { print price($objp->price_ttc).' '.$langs->trans("TTC"); } else { @@ -445,8 +446,8 @@ function activitytrim($product_type) $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; $sql .= " AND f.rowid = fd.fk_facture"; $sql .= " AND pf.fk_facture = f.rowid"; - $sql .= " AND pf.fk_paiement= p.rowid"; - $sql .= " AND fd.product_type=".$product_type; + $sql .= " AND pf.fk_paiement = p.rowid"; + $sql .= " AND fd.product_type = ".((int) $product_type); $sql .= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate), 1)."'"; $sql .= " GROUP BY annee, mois "; $sql .= " ORDER BY annee, mois "; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 6a29a414ed7..067869ba5ba 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -49,7 +49,10 @@ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { // Initialize technical objects $object = new Inventory($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; +// no inventory docs yet +$includedocgeneration = false; +$diroutputmassaction = null; +// $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -168,20 +171,6 @@ $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks|DE:Modul_Best llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; // Part to create @@ -194,7 +183,7 @@ if ($action == 'create') { if ($backtopage) { print ''; } - if ($backtopageforcancel) { + if (!empty($backtopageforcancel)) { print ''; } @@ -275,10 +264,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1); } - // Confirmation to delete line - if ($action == 'deleteline') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1); - } // Clone confirmation if ($action == 'clone') { @@ -304,7 +289,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); + $parameters = array('formConfirm' => $formconfirm); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $formconfirm .= $hookmanager->resPrint; @@ -483,7 +468,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'inventory', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, 'inventory', 0, 1, '', $MAXEVENT, '', $morehtmlright); print ''; } diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 126fff5b96b..9fb74c96f83 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -65,24 +65,29 @@ class Inventory extends CommonObject const STATUS_CANCELED = 9; /** - * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. - * 'enabled' is a condition when the field must be managed. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'noteditable' says if field is not editable (1 or 0) - * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). - * 'default' is a default value for creation (can still be replaced by the global setup of default values) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). - * 'position' is the sort order of field. * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' is the CSS style to use on field. For example: 'maxwidth200' - * 'help' is a string visible as a tooltip on field - * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200', 'minwidth300 maxwidth500 widthcentpercentminusx' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record - * 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel") + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ // BEGIN MODULEBUILDER PROPERTIES @@ -93,17 +98,17 @@ class Inventory extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-1, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object', 'css'=>'maxwidth200'), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), - 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'), - 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct'), + 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax200'), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'index'=>1, 'help'=>'InventoryForASpecificWarehouse', 'picto'=>'stock', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'visible'=>1, 'enabled'=>1, 'position'=>32, 'index'=>1, 'help'=>'InventoryForASpecificProduct', 'picto'=>'product', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'tdoverflowmax200'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1, 'position'=>35), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501), 'date_validation' => array('type'=>'datetime', 'label'=>'DateValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>502), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid'), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511), - 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax200'), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax200'), + 'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'visible'=>-2, 'enabled'=>1, 'position'=>512, 'csslist'=>'tdoverflowmax200'), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 2=>'Recorded', 9=>'Canceled')) @@ -635,33 +640,35 @@ class Inventory extends CommonObject */ public function info($id) { - $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; - $sql .= ' fk_user_creat, fk_user_modif'; + $sql = 'SELECT rowid, date_creation as datec, tms as datem, date_validation as datev,'; + $sql .= ' fk_user_creat, fk_user_modif, fk_user_valid'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; $sql .= ' WHERE t.rowid = '.((int) $id); $result = $this->db->query($sql); if ($result) { if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; - if ($obj->fk_user_author) { + + if ($obj->fk_user_creat > 0) { $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); + $cuser->fetch($obj->fk_user_creat); $this->user_creation = $cuser; } - if ($obj->fk_user_valid) { + if ($obj->fk_user_modif > 0) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_creation = $muser; + } + + if ($obj->fk_user_valid > 0) { $vuser = new User($this->db); $vuser->fetch($obj->fk_user_valid); $this->user_validation = $vuser; } - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } - $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->datev); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2abc830eb7c..01968855836 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -160,7 +160,7 @@ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { if (! $error) { $db->commit(); } else { - $db->rollbak(); + $db->rollback(); } } @@ -185,8 +185,11 @@ if ($action =='updateinventorylines' && $permissiontoadd) { if (GETPOST("id_".$lineid, 'alpha') != '') { // If a value was set ('0' or something else) $qtytoupdate = price2num(GETPOST("id_".$lineid, 'alpha'), 'MS'); - $result = $inventoryline->fetch($lineid); + if ($qtytoupdate < 0) { + $result = -1; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if ($result > 0) { $inventoryline->qty_view = $qtytoupdate; $resultupdate = $inventoryline->update($user); @@ -251,7 +254,10 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } - + if (price2num(GETPOST('qtytoadd'), 'MS') < 0) { + $error++; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if (!$error && !empty($conf->productbatch->enabled)) { $tmpproduct = new Product($db); $result = $tmpproduct->fetch($fk_product); @@ -443,7 +449,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); - print '
    '; + print ''; print ''; print ''; print ''; @@ -531,11 +537,116 @@ if ($object->id > 0) { // Popup for mass barcode scanning if ($action == 'updatebyscaning') { + if ($permissiontoadd) { + print ''; + } include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); print $formother->getHTMLScannerForm(); } + //Call method to undo changes in real qty + print ''; print '
    '; //print '
    '; @@ -610,7 +721,7 @@ if ($object->id > 0) { while ($i < $num) { $obj = $db->fetch_object($resql); - if (is_object($cacheOfWarehouses[$obj->fk_warehouse])) { + if (isset($cacheOfWarehouses[$obj->fk_warehouse])) { $warehouse_static = $cacheOfWarehouses[$obj->fk_warehouse]; } else { $warehouse_static = new Entrepot($db); @@ -619,7 +730,7 @@ if ($object->id > 0) { $cacheOfWarehouses[$warehouse_static->id] = $warehouse_static; } - if (is_object($cacheOfProducts[$obj->fk_product])) { + if (isset($cacheOfProducts[$obj->fk_product])) { $product_static = $cacheOfProducts[$obj->fk_product]; } else { $product_static = new Product($db); @@ -633,15 +744,15 @@ if ($object->id > 0) { } print '
    '; + print ''; print $warehouse_static->getNomUrl(1); print ''; + print ''; print $product_static->getNomUrl(1); print ''; + print ''; print $obj->batch; print ''; if ($object->status == $object::STATUS_VALIDATED) { - $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view; + $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; + print '  '; print ''.img_delete().''; print '
    '."\n"; +print '
    '."\n"; // Fields title search // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } @@ -439,14 +479,14 @@ print ''."\n"; // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -466,7 +506,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -478,6 +518,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -490,7 +531,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Show here line of result print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif ($key == 'status') { @@ -503,7 +544,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } @@ -511,6 +552,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -522,6 +565,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } @@ -577,7 +626,8 @@ print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; } print '
    '."\n"; print ''."\n"; print ''."\n"; - +// no inventory docs yet +/* if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty = 1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { @@ -597,7 +647,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n print $formfile->showdocuments('massfilesarea_mymodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } - +*/ // End of page llxFooter(); $db->close(); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index eb3fc71d53a..a975dc2c21b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -58,6 +58,7 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_id = GETPOST("search_id", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_ref_supplier = GETPOST("search_ref_supplier", 'alpha'); $search_barcode = GETPOST("search_barcode", 'alpha'); @@ -193,9 +194,10 @@ $isInEEC = isInEEC($mysoc); $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "ppe"; -// Definition of fields for lists +// Definition of array of fields for columns $arrayfields = array( - 'p.ref'=>array('label'=>"Ref", 'checked'=>1), + 'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), + 'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10), //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(! empty($conf->barcode->enabled))), 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10), 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(!empty($conf->product->enabled) && !empty($conf->service->enabled)), 'position'=>11), @@ -239,6 +241,19 @@ $arrayfields = array( 'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000), 'p.tobuy'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Buy").')', 'checked'=>1, 'position'=>1000) ); +/*foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = dol_eval($val['visible'], 1); + $arrayfields['p.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'] + ); + } +}*/ + // MultiPrices if ($conf->global->PRODUIT_MULTIPRICES) { @@ -300,6 +315,7 @@ if (empty($reshook)) { // Purge search criteria if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $sall = ""; + $search_id = ''; $search_ref = ""; $search_ref_supplier = ""; $search_label = ""; @@ -426,6 +442,9 @@ if (!empty($conf->variants->enabled) && (!empty($conf->global->PRODUIT_ATTRIBUTE $sql .= " AND pac.rowid IS NULL"; } +if ($search_id) { + $sql .= natural_search('p.rowid', $search_id, 1); +} if ($search_ref) { $sql .= natural_search('p.ref', $search_ref); } @@ -451,7 +470,7 @@ if (dol_strlen($canvas) > 0) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".((int) $catid); } if ($catid == -2) { $sql .= " AND cp.fk_categorie IS NULL"; @@ -801,6 +820,7 @@ if ($resql) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields if ($massactionbutton) { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); @@ -811,6 +831,11 @@ if ($resql) { // Lines with input filters print '
    '; + print ''; + print ''; print ''; @@ -998,11 +1023,15 @@ if ($resql) { } // Country if (!empty($arrayfields['p.fk_country']['checked'])) { - print ''.$form->select_country($search_country, 'search_country', '', 0).''; + print $form->select_country($search_country, 'search_country', '', 0); + print ''.$formcompany->select_state($search_state, $search_country).''; + print $formcompany->select_state($search_state, $search_country); + print '
    '; + print $product_static->id; + print "'; diff --git a/htdocs/product/note.php b/htdocs/product/note.php index add915181a2..c54bd3637ae 100644 --- a/htdocs/product/note.php +++ b/htdocs/product/note.php @@ -51,14 +51,31 @@ if ($id > 0 || !empty($ref)) { $permissionnote = $user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} + + +$hookmanager->initHooks(array('productnote')); /* * Actions */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* @@ -67,23 +84,23 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, $form = new Form($db); -$helpurl = ''; +$help_url = ''; if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) { - $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + $help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { - $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } $title = $langs->trans('ProductServiceCard'); $shortlabel = dol_trunc($object->label, 16); if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) { $title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('Notes'); - $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; + $help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) { $title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('Notes'); - $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; + $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } llxHeader('', $title, $help_url); diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index f23b6eae92d..8ffae0bee8c 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -60,9 +60,7 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$staticproduct = new Product($db); - -$result = restrictedArea($user, 'produit|service', 0, 'product&product'); +restrictedArea($user, 'produit|service', 0, 'product&product', '', ''); /* @@ -213,7 +211,7 @@ if ($mode && $mode != '-1') { if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active $sql = "SELECT label"; $sql .= " FROM ".MAIN_DB_PREFIX."product_lang"; - $sql .= " WHERE fk_product=".$prodid; + $sql .= " WHERE fk_product = ".((int) $prodid); $sql .= " AND lang='".$db->escape($langs->getDefaultLang())."'"; $sql .= " LIMIT 1"; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 7dfb94be79f..03867bb65e9 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -50,7 +50,6 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Load translation files required by the page $langs->loadLangs(array('products', 'bills', 'companies', 'other')); -$mesg = ''; $error = 0; $errors = array(); @@ -82,7 +81,16 @@ if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productpricecard', 'globalcard')); -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} /* @@ -337,6 +345,7 @@ if (empty($reshook)) { $newprice = price2num($newprice, 'MU'); $newprice_min = price2num($val['price_min'], 'MU'); + $newvattx = price2num($val['vat_tx']); if (!empty($conf->global->PRODUCT_MINIMUM_RECOMMENDED_PRICE) && $newprice_min < $maxpricesupplier) { setEventMessages($langs->trans("MinimumPriceLimit", price($maxpricesupplier, 0, '', 1, - 1, - 1, 'auto')), null, 'errors'); @@ -344,13 +353,12 @@ if (empty($reshook)) { break; } - if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type']) { + if ($object->multiprices[$key] != $newprice || $object->multiprices_min[$key] != $newprice_min || $object->multiprices_base_type[$key] != $val['price_base_type'] || $object->multiprices_tva_tx[$key] != $newvattx) { $res = $object->updatePrice($newprice, $val['price_base_type'], $user, $val['vat_tx'], $newprice_min, $key, $val['npr'], $psq, 0, $val['localtaxes_array'], $val['default_vat_code']); } else { $res = 0; } - if ($res < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); @@ -709,8 +717,18 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ $soc->id = $socid; $soc->fetch($socid); + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat); + print '
    '; + print '
    '; print $langs->trans("SellingPrice"); print ''; @@ -783,13 +801,33 @@ if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_ } } else { if (!empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) { // using this option is a bug. kept for backward compatibility + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat); + print '
    '.$langs->trans("DefaultTaxRate").'
    '.$langs->trans("DefaultTaxRate").''.vatrate($object->multiprices_tva_tx[1], true).'
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat); + print '
    '.$langs->trans("DefaultTaxRate").''; + print '
    '.$langs->trans("DefaultTaxRate").''; $positiverates = ''; if (price2num($object->tva_tx)) { @@ -1100,34 +1138,41 @@ print dol_get_fiche_end(); /* * Action bar */ + + if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price' || $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty') { print "\n".'
    '."\n"; - if ($object->isVariant()) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } else { - if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; - } - } - if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + if (empty($reshook)) { + if ($object->isVariant()) { if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + print ''; } - } - - if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + } else { + if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''; + if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + } + + if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } + + if ($user->rights->produit->creer || $user->rights->service->creer) { + print ''; + } } } } @@ -1203,15 +1248,17 @@ if ($action == 'edit_price' && $object->getRights()->creer) { // Only show price mode and expression selector if module is enabled if (!empty($conf->dynamicprices->enabled)) { // Price mode selector + print ''."\n"; print '
    '.$langs->trans("PriceMode").''; + print img_picto('', 'dynamicprice', 'class="pictofixedwidth"'); $price_expression = new PriceExpression($db); - $price_expression_list = array(0 => $langs->trans("PriceNumeric")); //Put the numeric mode as first option + $price_expression_list = array(0 => $langs->trans("Numeric").' ('.$langs->trans("NoDynamicPrice").')'); //Put the numeric mode as first option foreach ($price_expression->list_price_expression() as $entry) { $price_expression_list[$entry->id] = $entry->title; } $price_expression_preselection = GETPOST('eid') ? GETPOST('eid') : ($object->fk_price_expression ? $object->fk_price_expression : '0'); print $form->selectarray('eid', $price_expression_list, $price_expression_preselection); - print ' 
    '.$langs->trans("PriceExpressionEditor").'
    '; + print '  '.$langs->trans("PriceExpressionEditor").''; print '
    '.$langs->trans("PriceBase").''.$langs->trans("DefaultTaxRate").'
    '.$langs->trans("Categories").''; - $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'paddingright'); - $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); + $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); + $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth300'); print $moreforfilter; print '
    '; - print '
    '; + print '
    '; print '
    '; print '
    '; diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index fe8016f362a..623306536b7 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -43,13 +43,10 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatsorder')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -75,6 +72,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; $sql .= " AND d.fk_commande = c.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(c.date_commande) IN ('.$db->sanitize($search_month).')'; } @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index bc8346e39b1..fd64a1c0572 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -42,10 +42,9 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('productstatssupplyorder')); +$hookmanager->initHooks(array('productstatssupplierorder')); $mesg = ''; @@ -74,6 +73,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View @@ -151,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity = ".$conf->entity; $sql .= " AND d.fk_commande = c.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(c.date_commande) IN ('.$db->sanitize($search_month).')'; } @@ -159,7 +160,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ' AND YEAR(c.date_commande) IN ('.$db->sanitize($search_year).')'; } if (!$user->rights->societe->client->voir && !$socid) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index e419593208c..f71c907a430 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -40,13 +40,10 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatscontract')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -65,6 +62,8 @@ if (!$sortfield) { $sortfield = "c.date_contrat"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View @@ -143,7 +142,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE c.rowid = cd.fk_contrat"; $sql .= " AND c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('contract').")"; - $sql .= " AND cd.fk_product =".$product->id; + $sql .= " AND cd.fk_product = ".((int) $product->id); if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index fa7d4fae24f..b8a83e847c2 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -44,7 +44,6 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatsinvoice')); @@ -77,6 +76,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); /* @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; $sql .= " AND d.fk_facture = f.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(f.datef) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 018f1c28f02..6eaf5a33e22 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -44,12 +44,9 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('productstatssupplyinvoice')); - -$mesg = ''; +$hookmanager->initHooks(array('productstatssupplierinvoice')); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE f.fk_soc = s.rowid"; $sql .= " AND f.entity IN (".getEntity('facture_fourn').")"; $sql .= " AND d.fk_facture_fourn = f.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(f.datef) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 1cabfd9ef85..5a5c33312ca 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2021 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -40,12 +40,9 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('productstatscontract')); - -$mesg = ''; +$hookmanager->initHooks(array('productstatsmo')); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -65,6 +62,8 @@ if (!$sortfield) { $sortfield = "c.date_valid"; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + /* * View @@ -138,7 +137,7 @@ if ($id > 0 || !empty($ref)) { $sql .= ", ".MAIN_DB_PREFIX."mrp_production as cd"; $sql .= " WHERE c.rowid = cd.fk_mo"; $sql .= " AND c.entity IN (".getEntity('mo').")"; - $sql .= " AND cd.fk_product =".$product->id; + $sql .= " AND cd.fk_product = ".((int) $product->id); if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 7dfc8b6d1db..f2a26d4af73 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -48,8 +48,6 @@ $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('productstatspropal')); -$mesg = ''; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -76,6 +74,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ @@ -152,7 +153,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('propal').")"; $sql .= " AND d.fk_propal = p.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(p.datep) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 86689786b2d..b30983bbda5 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -43,12 +43,9 @@ $socid = ''; if (!empty($user->socid)) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('productstatspropal')); - -$mesg = ''; +$hookmanager->initHooks(array('productstatssupplierpropal')); // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; @@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_year = ''; } +$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + + /* * View */ @@ -152,7 +152,7 @@ if ($id > 0 || !empty($ref)) { $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")"; $sql .= " AND d.fk_supplier_proposal = p.rowid"; - $sql .= " AND d.fk_product =".$product->id; + $sql .= " AND d.fk_product = ".((int) $product->id); if (!empty($search_month)) { $sql .= ' AND MONTH(p.datep) IN ('.$db->sanitize($search_month).')'; } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b8698ff7ad3..5ea58da6deb 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2016 Francis Appels * Copyright (C) 2021 Noé Cendrier + * Copyright (C) 2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -168,7 +169,7 @@ if (empty($reshook)) { // Modification entrepot if ($action == 'update' && !$cancel) { if ($object->fetch($id)) { - $object->label = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); $object->fk_project = GETPOST('projectid'); $object->description = GETPOST("desc"); @@ -178,8 +179,8 @@ if (empty($reshook)) { $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id"); - $object->phone = GETPOST("phone"); - $object->fax = GETPOST("fax"); + $object->phone = GETPOST("phone"); + $object->fax = GETPOST("fax"); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); @@ -331,7 +332,7 @@ if ($action == 'create') { // Status print ''.$langs->trans("Status").''; - print ''; foreach ($object->statuts as $key => $value) { if ($key == 1) { print ''; @@ -340,6 +341,7 @@ if ($action == 'create') { } } print ''; + print ajax_combobox('warehousestatus'); print ''; // Other attributes @@ -612,6 +614,14 @@ if ($action == 'create') { } $sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.price, p.price_ttc, p.entity,"; + $sql .= "p.tosell, p.tobuy,"; + $sql .= "p.accountancy_code_sell,"; + $sql .= "p.accountancy_code_sell_intra,"; + $sql .= "p.accountancy_code_sell_export,"; + $sql .= "p.accountancy_code_buy,"; + $sql .= "p.accountancy_code_buy_intra,"; + $sql .= "p.accountancy_code_buy_export,"; + $sql .= 'p.barcode,'; if ($separatedPMP) { $sql .= " pa.pmp as ppmp,"; } else { @@ -636,10 +646,10 @@ if ($action == 'create') { $sql .= " WHERE ps.fk_product = p.rowid"; $sql .= " AND ps.reel <> 0"; // We do not show if stock is 0 (no product in this warehouse) - $sql .= " AND ps.fk_entrepot = ".$object->id; + $sql .= " AND ps.fk_entrepot = ".((int) $object->id); if ($separatedPMP) { - $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ". (int) $conf->entity; + $sql .= " AND pa.fk_product = p.rowid AND pa.entity = ".(int) $conf->entity; } $sql .= $db->order($sortfield, $sortorder); @@ -669,13 +679,13 @@ if ($action == 'create') { } } - //print ''.dol_print_date($objp->datem).''; print ''; + $parameters = array('obj'=>$objp); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print ""; + $productstatic->id = $objp->rowid; $productstatic->ref = $objp->ref; $productstatic->label = $objp->produit; @@ -683,11 +693,22 @@ if ($action == 'create') { $productstatic->entity = $objp->entity; $productstatic->status_batch = $objp->tobatch; $productstatic->fk_unit = $objp->fk_unit; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->barcode = $objp->barcode; + $productstatic->accountancy_code_sell = $objp->accountancy_code_sell; + $productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra; + $productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export; + $productstatic->accountancy_code_buy = $objp->accountancy_code_buy; + $productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra; + $productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export; + + print ""; print $productstatic->getNomUrl(1, 'stock', 16); print ''; // Label - print ''.$objp->produit.''; + print ''.dol_escape_htmltag($objp->produit).''; print ''; $valtoshow = price(price2num($objp->value, 'MS'), 0, '', 0, 0); // TODO replace with a qty() function @@ -705,10 +726,10 @@ if ($action == 'create') { print ''; } // Price buy PMP - print ''.price(price2num($objp->ppmp, 'MU')).''; + print ''.price(price2num($objp->ppmp, 'MU')).''; // Total PMP - print ''.price(price2num($objp->ppmp * $objp->value, 'MT')).''; + print ''.price(price2num($objp->ppmp * $objp->value, 'MT')).''; $totalvalue += price2num($objp->ppmp * $objp->value, 'MT'); // Price sell min @@ -768,6 +789,7 @@ if ($action == 'create') { } print ' '; print ' '; + print ' '; print ''; } else { dol_print_error($db); @@ -852,7 +874,7 @@ if ($action == 'create') { // Status print ''.$langs->trans("Status").''; - print ''; foreach ($object->statuts as $key => $value) { if ($key == $object->statut) { print ''; @@ -861,6 +883,8 @@ if ($action == 'create') { } } print ''; + print ajax_combobox('warehousestatus'); + print ''; // Other attributes diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index 9b022a840fc..42a03a1836a 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -95,7 +95,7 @@ class StockMovements extends DolibarrApi */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') { - global $db, $conf; + global $conf; $obj_ret = array(); @@ -176,7 +176,7 @@ class StockMovements extends DolibarrApi } if ($qty == 0) { - throw new RestException(503, "Making a stock movement with a quentity of 0 is not possible"); + throw new RestException(503, "Making a stock movement with a quantity of 0 is not possible"); } // Type increase or decrease diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index dc15e092155..92df16fa867 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -127,7 +127,7 @@ class Entrepot extends CommonObject 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>30), 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), - 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>1, 'searchall'=>1), + 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1), 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), @@ -173,7 +173,7 @@ class Entrepot extends CommonObject $this->statuts[self::STATUS_CLOSED] = 'Closed2'; if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { - $this->statuts[self::STATUS_OPEN_ALL] = 'OpenAll'; + $this->statuts[self::STATUS_OPEN_ALL] = 'OpenAnyMovement'; $this->statuts[self::STATUS_OPEN_INTERNAL] = 'OpenInternal'; } else { $this->statuts[self::STATUS_OPEN_ALL] = 'Opened'; @@ -293,17 +293,17 @@ class Entrepot extends CommonObject $this->town = trim($this->town); $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); - $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; + $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot"; $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", fk_project = ".(($this->fk_project > 0) ? $this->fk_project : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; - $sql .= ", statut = ".$this->statut; + $sql .= ", statut = ".((int) $this->statut); $sql .= ", lieu = '".$this->db->escape($this->lieu)."'"; $sql .= ", address = '".$this->db->escape($this->address)."'"; $sql .= ", zip = '".$this->db->escape($this->zip)."'"; $sql .= ", town = '".$this->db->escape($this->town)."'"; - $sql .= ", fk_pays = ".$this->country_id; + $sql .= ", fk_pays = ".((int) $this->country_id); $sql .= ", phone = '".$this->db->escape($this->phone)."'"; $sql .= ", fax = '".$this->db->escape($this->fax)."'"; $sql .= " WHERE rowid = ".((int) $id); @@ -690,13 +690,15 @@ class Entrepot extends CommonObject /** * Return clickable name (possibility with the pictogram) * - * @param int $withpicto with pictogram - * @param string $option Where the link point to - * @param int $showfullpath 0=Show ref only. 1=Show full path instead of Ref (this->fk_parent must be defined) - * @param int $notooltip 1=Disable tooltip - * @return string String with URL + * @param int $withpicto with pictogram + * @param string $option Where the link point to + * @param int $showfullpath 0=Show ref only. 1=Show full path instead of Ref (this->fk_parent must be defined) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '', $showfullpath = 0, $notooltip = 0) + public function getNomUrl($withpicto = 0, $option = '', $showfullpath = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { global $conf, $langs, $hookmanager; $langs->load("stocks"); @@ -722,6 +724,17 @@ class Entrepot extends CommonObject $url = DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id; + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } + } + $linkclose = ''; if (empty($notooltip)) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index d8dad67bee2..f0c7d51c86b 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -126,31 +126,32 @@ class MouvementStock extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Add a movement of stock (in one direction only). + * This is the lowest level method to record a stock change. * $this->origin can be also be set to save the source object of movement. * - * @param User $user User object - * @param int $fk_product Id of product - * @param int $entrepot_id Id of warehouse - * @param int $qty Qty of movement (can be <0 or >0 depending on parameter type) - * @param int $type Direction of movement: - * 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer), - * 2=output (stock decrease), 3=input (stock increase) - * Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2. - * @param int $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed. - * @param string $label Label of stock movement - * @param string $inventorycode Inventory code - * @param string $datem Force date of movement + * @param User $user User object + * @param int $fk_product Id of product + * @param int $entrepot_id Id of warehouse + * @param int $qty Qty of movement (can be <0 or >0 depending on parameter type) + * @param int $type Direction of movement: + * 0=input (stock increase by a stock transfer), 1=output (stock decrease by a stock transfer), + * 2=output (stock decrease), 3=input (stock increase) + * Note that qty should be > 0 with 0 or 3, < 0 with 1 or 2. + * @param int $price Unit price HT of product, used to calculate average weighted price (AWP or PMP in french). If 0, average weighted price is not changed. + * @param string $label Label of stock movement + * @param string $inventorycode Inventory code + * @param string $datem Force date of movement * @param integer|string $eatby eat-by date. Will be used if lot does not exists yet and will be created. * @param integer|string $sellby sell-by date. Will be used if lot does not exists yet and will be created. - * @param string $batch batch number - * @param boolean $skip_batch If set to true, stock movement is done without impacting batch record - * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) - * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) - * @return int <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK + * @param string $batch batch number + * @param boolean $skip_batch If set to true, stock movement is done without impacting batch record + * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) + * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) + * @return int <0 if KO, 0 if fk_product is null or product id does not exists, >0 if OK */ public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0) { - // phpcs:disable + // phpcs:enable global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -159,39 +160,40 @@ class MouvementStock extends CommonObject $error = 0; dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch); - // start hook at beginning - global $action, $hookmanager; - $hookmanager->initHooks(array('mouvementstock')); - // Hook of thirdparty module - if (is_object($hookmanager)) { + // Call hook at beginning + global $action, $hookmanager; + $hookmanager->initHooks(array('mouvementstock')); + + if (is_object($hookmanager)) { $parameters = array( - 'currentcontext' => 'mouvementstock', - 'user' => &$user, - 'fk_product' => &$fk_product, - 'entrepot_id' => &$entrepot_id, - 'qty' => &$qty, - 'type' => &$type, - 'price' => &$price, - 'label' => &$label, - 'inventorycode' => &$inventorycode, - 'datem' => &$datem, - 'eatby' => &$eatby, - 'sellby' => &$sellby, - 'batch' => &$batch, - 'skip_batch' => &$skip_batch, - 'id_product_batch' => &$id_product_batch + 'currentcontext' => 'mouvementstock', + 'user' => &$user, + 'fk_product' => &$fk_product, + 'entrepot_id' => &$entrepot_id, + 'qty' => &$qty, + 'type' => &$type, + 'price' => &$price, + 'label' => &$label, + 'inventorycode' => &$inventorycode, + 'datem' => &$datem, + 'eatby' => &$eatby, + 'sellby' => &$sellby, + 'batch' => &$batch, + 'skip_batch' => &$skip_batch, + 'id_product_batch' => &$id_product_batch ); - $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { - if (!empty($hookmanager->resPrint)) + if (!empty($hookmanager->resPrint)) { dol_print_error('', $hookmanager->resPrint); + } return $reshook; } elseif ($reshook > 0) { return $hookmanager->resPrint; } - } - // end hook at beginning + } + // end hook at beginning // Clean parameters $price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value. @@ -199,7 +201,8 @@ class MouvementStock extends CommonObject $now = (!empty($datem) ? $datem : dol_now()); // Check parameters - if (empty($fk_product)) return 0; + if (!($fk_product > 0)) return 0; + if (!($entrepot_id > 0)) return 0; if (is_numeric($eatby) && $eatby < 0) { dol_syslog(get_class($this)."::_create start ErrorBadValueForParameterEatBy eatby = ".$eatby); @@ -235,19 +238,25 @@ class MouvementStock extends CommonObject dol_print_error('', "Failed to fetch product"); return -1; } - if ($product->id <= 0) { // Can happen if database is corrupted + if ($product->id <= 0) { // Can happen if database is corrupted (a product id exist in stock with product that has been removed) return 0; } + // Define if we must make the stock change (If product type is a service or if stock is used also for services) + // Only record into stock tables wil be disabled by this (the rest like writing into lot table or movement of subproucts are done) + $movestock = 0; + if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1; + $this->db->begin(); - $product->load_stock('novirtual'); + // Set value $product->stock_reel and detail per warehouse into $product->stock_warehouse array + if ($movestock) { + $product->load_stock('novirtual'); + } - // Test if product require batch data. If yes, and there is not, we throw an error. - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) - { - if (empty($batch)) - { + // Test if product require batch data. If yes, and there is not or values are not correct, we throw an error. + if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if (empty($batch)) { $langs->load("errors"); $this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref); dol_syslog("Try to make a movement of a product with status_batch on without any batch data"); @@ -263,26 +272,20 @@ class MouvementStock extends CommonObject // If found and eatby/sellby not defined into table and not provided, we do nothing // If not found, we add record $sql = "SELECT pb.rowid, pb.batch, pb.eatby, pb.sellby FROM ".MAIN_DB_PREFIX."product_lot as pb"; - $sql .= " WHERE pb.fk_product = ".$fk_product." AND pb.batch = '".$this->db->escape($batch)."'"; + $sql .= " WHERE pb.fk_product = ".((int) $fk_product)." AND pb.batch = '".$this->db->escape($batch)."'"; dol_syslog(get_class($this)."::_create scan serial for this product to check if eatby and sellby match", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $num = $this->db->num_rows($resql); $i = 0; - if ($num > 0) - { - while ($i < $num) - { + if ($num > 0) { + while ($i < $num) { $obj = $this->db->fetch_object($resql); - if ($obj->eatby) - { - if ($eatby) - { + if ($obj->eatby) { + if ($eatby) { $tmparray = dol_getdate($eatby, true); $eatbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); - if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility - { + if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) { // We test date without hours and with hours for backward compatibility // If found and eatby/sellby defined into table and provided and differs, return error $langs->load("stocks"); $this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby), 'dayhour'), dol_print_date($eatbywithouthour, 'dayhour')); @@ -294,14 +297,12 @@ class MouvementStock extends CommonObject $eatby = $obj->eatby; // If found and eatby/sellby defined into table and not provided, we take value from table } } else { - if ($eatby) // If found and eatby/sellby not defined into table and provided, we update table - { + if ($eatby) { // If found and eatby/sellby not defined into table and provided, we update table $productlot = new Productlot($this->db); $result = $productlot->fetch($obj->rowid); $productlot->eatby = $eatby; $result = $productlot->update($user); - if ($result <= 0) - { + if ($result <= 0) { $this->error = $productlot->error; $this->errors = $productlot->errors; $this->db->rollback(); @@ -309,14 +310,11 @@ class MouvementStock extends CommonObject } } } - if ($obj->sellby) - { - if ($sellby) - { + if ($obj->sellby) { + if ($sellby) { $tmparray = dol_getdate($sellby, true); $sellbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); - if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) // We test date without hours and with hours for backward compatibility - { + if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) { // We test date without hours and with hours for backward compatibility // If found and eatby/sellby defined into table and provided and differs, return error $this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)); dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)), LOG_ERR); @@ -326,17 +324,13 @@ class MouvementStock extends CommonObject } else { $sellby = $obj->sellby; // If found and eatby/sellby defined into table and not provided, we take value from table } - } - else - { - if ($sellby) // If found and eatby/sellby not defined into table and provided, we update table - { + } else { + if ($sellby) { // If found and eatby/sellby not defined into table and provided, we update table $productlot = new Productlot($this->db); $result = $productlot->fetch($obj->rowid); $productlot->sellby = $sellby; $result = $productlot->update($user); - if ($result <= 0) - { + if ($result <= 0) { $this->error = $productlot->error; $this->errors = $productlot->errors; $this->db->rollback(); @@ -347,9 +341,7 @@ class MouvementStock extends CommonObject $i++; } - } - else // If not found, we add record - { + } else { // If not found, we add record $productlot = new Productlot($this->db); $productlot->entity = $conf->entity; $productlot->fk_product = $fk_product; @@ -358,44 +350,37 @@ class MouvementStock extends CommonObject $productlot->eatby = $eatby; $productlot->sellby = $sellby; $result = $productlot->create($user); - if ($result <= 0) - { + if ($result <= 0) { $this->error = $productlot->error; $this->errors = $productlot->errors; $this->db->rollback(); return -4; } } - } - else - { + } else { dol_print_error($this->db); $this->db->rollback(); return -1; } } - // Define if we must make the stock change (If product type is a service or if stock is used also for services) - $movestock = 0; - if ($product->type != Product::TYPE_SERVICE || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) $movestock = 1; - // Check if stock is enough when qty is < 0 // Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2. - if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) - { - if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) - { + if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) { + if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { $foundforbatch = 0; $qtyisnotenough = 0; - foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) - { - if ($batch != $batchcursor) continue; + + foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { + if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c' + continue; + } + $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break; } - if (!$foundforbatch || $qtyisnotenough) - { + if (!$foundforbatch || $qtyisnotenough) { $langs->load("stocks"); include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $tmpwarehouse = new Entrepot($this->db); @@ -406,11 +391,8 @@ class MouvementStock extends CommonObject $this->db->rollback(); return -8; } - } - else - { - if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) - { + } else { + if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) { $langs->load("stocks"); $this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; $this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref; @@ -420,8 +402,7 @@ class MouvementStock extends CommonObject } } - if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after - { + if ($movestock) { // Change stock for current product, change for subproduct is done after // Set $origintype, fk_origin, fk_project $fk_project = 0; if (!empty($this->origin)) { // This is set by caller for tracking reason @@ -431,10 +412,8 @@ class MouvementStock extends CommonObject $fk_project = $fk_origin; } else { $res = $this->origin->fetch($fk_origin); - if ($res > 0) - { - if (!empty($this->origin->fk_project)) - { + if ($res > 0) { + if (!empty($this->origin->fk_project)) { $fk_project = $this->origin->fk_project; } } @@ -453,26 +432,23 @@ class MouvementStock extends CommonObject $sql .= " ".($batch ? "'".$this->db->escape($batch)."'" : "null").", "; $sql .= " ".($eatby ? "'".$this->db->idate($eatby)."'" : "null").", "; $sql .= " ".($sellby ? "'".$this->db->idate($sellby)."'" : "null").", "; - $sql .= " ".$this->entrepot_id.", ".$this->qty.", ".((int) $this->type).","; - $sql .= " ".$user->id.","; + $sql .= " ".((int) $this->entrepot_id).", ".((float) $this->qty).", ".((int) $this->type).","; + $sql .= " ".((int) $user->id).","; $sql .= " '".$this->db->escape($label)."',"; $sql .= " ".($inventorycode ? "'".$this->db->escape($inventorycode)."'" : "null").","; $sql .= " ".price2num($price).","; - $sql .= " ".$fk_origin.","; + $sql .= " ".((int) $fk_origin).","; $sql .= " '".$this->db->escape($origintype)."',"; - $sql .= " ".$fk_project; + $sql .= " ".((int) $fk_project); $sql .= ")"; dol_syslog(get_class($this)."::_create insert record into stock_mouvement", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $mvid = $this->db->last_insert_id(MAIN_DB_PREFIX."stock_mouvement"); $this->id = $mvid; - } - else - { + } else { $this->error = $this->db->lasterror(); $this->errors[] = $this->error; $error = -1; @@ -485,18 +461,15 @@ class MouvementStock extends CommonObject // Test if there is already a record for couple (warehouse / product), so later we will make an update or create. $alreadyarecord = 0; - if (!$error) - { + if (!$error) { $sql = "SELECT rowid, reel FROM ".MAIN_DB_PREFIX."product_stock"; $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); // This is a unique key dol_syslog(get_class($this)."::_create check if a record already exists in product_stock", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $obj = $this->db->fetch_object($resql); - if ($obj) - { + if ($obj) { $alreadyarecord = 1; $oldqtywarehouse = $obj->reel; $fk_product_stock = $obj->rowid; @@ -510,10 +483,8 @@ class MouvementStock extends CommonObject // Calculate new AWP (PMP) $newpmp = 0; - if (!$error) - { - if ($type == 0 || $type == 3) - { + if (!$error) { + if ($type == 0 || $type == 3) { // After a stock increase // Note: PMP is calculated on stock input only (type of movement = 0 or 3). If type == 0 or 3, qty should be > 0. // Note: Price should always be >0 or 0. PMP should be always >0 (calculated on input) @@ -540,10 +511,8 @@ class MouvementStock extends CommonObject } } // Update stock quantity - if (!$error) - { - if ($alreadyarecord > 0) - { + if (!$error) { + if ($alreadyarecord > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + ".((float) $qty); $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); } else { @@ -554,51 +523,29 @@ class MouvementStock extends CommonObject dol_syslog(get_class($this)."::_create update stock value", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) - { + if (!$resql) { $this->errors[] = $this->db->lasterror(); $error = -3; - } - elseif (empty($fk_product_stock)) - { + } elseif (empty($fk_product_stock)) { $fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock"); } } - // Update detail stock for batch product - if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) - { - // check unicity for serial numbered equipments ( different for lots managed products) - if ( $product->status_batch == 2 && $qty > 0 ) - { - if ( $this->getBatchCount($fk_product, $batch) > 0 ) - { - $error++; - $this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref); - } - elseif ( $qty > 1 ) - { - $error++; - $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch); - } + // Update detail of stock for the lot. + if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if ($id_product_batch > 0) { + $result = $this->createBatch($id_product_batch, $qty); + } else { + $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); + $result = $this->createBatch($param_batch, $qty); } - - if ( ! $error ) - { - if ($id_product_batch > 0) - { - $result = $this->createBatch($id_product_batch, $qty); - } else { - $param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch); - $result = $this->createBatch($param_batch, $qty); - } - if ($result < 0) $error++; + if ($result < 0) { + $error++; } } // Update PMP and denormalized value of stock qty at product level - if (!$error) - { + if (!$error) { $newpmp = price2num($newpmp, 'MU'); // $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty; @@ -610,8 +557,7 @@ class MouvementStock extends CommonObject dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) - { + if (!$resql) { $this->errors[] = $this->db->lasterror(); $error = -4; } @@ -625,26 +571,31 @@ class MouvementStock extends CommonObject } // Add movement for sub products (recursive call) - if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) - { + if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) { $error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode); // we use 0 as price, because AWP must not change for subproduct } - if ($movestock && !$error) - { + if ($movestock && !$error) { // Call trigger $result = $this->call_trigger('STOCK_MOVEMENT', $user); if ($result < 0) $error++; // End call triggers + + // Check unicity for serial numbered equipments once all movement were done. + if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) { + if ($product->status_batch == 2 && $qty > 0) { // We check only if we increased qty + if ($this->getBatchCount($fk_product, $batch) > 1) { + $error++; + $this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $batch, $product->ref); + } + } + } } - if (!$error) - { + if (!$error) { $this->db->commit(); return $mvid; - } - else - { + } else { $this->db->rollback(); dol_syslog(get_class($this)."::_create error code=".$error, LOG_ERR); return -6; @@ -768,35 +719,27 @@ class MouvementStock extends CommonObject dol_syslog(get_class($this)."::_createSubProduct for parent product ".$idProduct, LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $i = 0; - while ($obj = $this->db->fetch_object($resql)) - { + while ($obj = $this->db->fetch_object($resql)) { $pids[$i] = $obj->fk_product_fils; $pqtys[$i] = $obj->qty; $i++; } $this->db->free($resql); - } - else - { + } else { $error = -2; } // Create movement for each subproduct - foreach ($pids as $key => $value) - { - if (!$error) - { + foreach ($pids as $key => $value) { + if (!$error) { $tmpmove = dol_clone($this, 1); $result = $tmpmove->_create($user, $pids[$key], $entrepot_id, ($qty * $pqtys[$key]), $type, 0, $label, $inventorycode); // This will also call _createSubProduct making this recursive - if ($result < 0) - { + if ($result < 0) { $this->error = $tmpmove->error; $this->errors = array_merge($this->errors, $tmpmove->errors); - if ($result == -2) - { + if ($result == -2) { $this->errors[] = $langs->trans("ErrorNoteAlsoThatSubProductCantBeFollowedByLot"); } $error = $result; @@ -862,27 +805,26 @@ class MouvementStock extends CommonObject } - /** - * Return nb of subproducts lines for a product - * - * @param int $id Id of product - * @return int <0 if KO, nb of subproducts if OK - * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class. - */ - /* - public function nbOfSubProducts($id) - { - $nbSP=0; + // /** + // * Return nb of subproducts lines for a product + // * + // * @param int $id Id of product + // * @return int <0 if KO, nb of subproducts if OK + // * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class. + // */ + // public function nbOfSubProducts($id) + // { + // $nbSP=0; - $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association"; - $resql.= " WHERE fk_product_pere = ".((int) $id); - if ($this->db->query($resql)) - { - $obj=$this->db->fetch_object($resql); - $nbSP=$obj->nb; - } - return $nbSP; - }*/ + // $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association"; + // $resql.= " WHERE fk_product_pere = ".((int) $id); + // if ($this->db->query($resql)) + // { + // $obj=$this->db->fetch_object($resql); + // $nbSP=$obj->nb; + // } + // return $nbSP; + // } /** * Count number of product in stock before a specific date @@ -901,8 +843,7 @@ class MouvementStock extends CommonObject dol_syslog(get_class($this).__METHOD__.'', LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { + if ($resql) { $obj = $this->db->fetch_object($resql); if ($obj) $nb = $obj->nb; return (empty($nb) ? 0 : $nb); @@ -930,19 +871,16 @@ class MouvementStock extends CommonObject $result = 0; // Try to find an existing record with same batch number or id - if (is_numeric($dluo)) - { + if (is_numeric($dluo)) { $result = $pdluo->fetch($dluo); - if (empty($pdluo->id)) - { + if (empty($pdluo->id)) { // We didn't find the line. May be it was deleted before by a previous move in same transaction. $this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.'; $this->errors[] = $this->error; $result = -2; } } elseif (is_array($dluo)) { - if (isset($dluo['fk_product_stock'])) - { + if (isset($dluo['fk_product_stock'])) { $vfk_product_stock = $dluo['fk_product_stock']; $vbatchnumber = $dluo['batchnumber']; @@ -956,8 +894,7 @@ class MouvementStock extends CommonObject $result = -1; } - if ($result >= 0) - { + if ($result >= 0) { // No error if ($pdluo->id > 0) { // product_batch record found //print "Avant ".$pdluo->qty." Apres ".($pdluo->qty + $qty)."
    "; @@ -975,8 +912,7 @@ class MouvementStock extends CommonObject $pdluo->batch = $vbatchnumber; $result = $pdluo->create($user, 1); - if ($result < 0) - { + if ($result < 0) { $this->error = $pdluo->error; $this->errors = $pdluo->errors; } @@ -1036,6 +972,10 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; $origin = new Reception($this->db); break; + case 'inventory': + require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; + $origin = new Inventory($this->db); + break; default: if ($origintype) { @@ -1269,16 +1209,14 @@ class MouvementStock extends CommonObject } /** - * Retrieve number of equipments for a product batch + * Retrieve number of equipments for a product lot/serial * - * @param int $fk_product Product id - * @param varchar $batch batch number - * @return int <0 if KO, number of equipments if OK + * @param int $fk_product Product id + * @param string $batch batch number + * @return int <0 if KO, number of equipments found if OK */ private function getBatchCount($fk_product, $batch) { - global $conf; - $cpt = 0; $sql = "SELECT sum(pb.qty) as cpt"; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 2a3b3cf2e20..360978ac736 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -87,7 +87,7 @@ class Productlot extends CommonObject */ public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>15, 'notnull'=>1, 'index'=>1, 'searchall'=>1), + 'fk_product' => array('type'=>'integer:Product:product/class/product.class.php', 'label'=>'Product', 'enabled'=>1, 'visible'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1, 'searchall'=>1), 'batch' => array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>1, 'notnull'=>0, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'comment'=>'Batch', 'searchall'=>1), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20), 'sellby' => array('type'=>'date', 'label'=>'SellByDate', 'enabled'=>'empty($conf->global->PRODUCT_DISABLE_SELLBY)?1:0', 'visible'=>5, 'position'=>60), @@ -402,7 +402,7 @@ class Productlot extends CommonObject $sql .= ' sellby = '.(!isset($this->sellby) || dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').','; $sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').','; $sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').','; - $sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').','; + $sql .= ' scrapping_date = '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) != 0 ? "'".$this->db->idate($this->scrapping_date)."'" : 'null').','; //$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').','; //$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').','; $sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').','; diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index aea8c3e1f14..d8138c7f149 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -280,10 +280,10 @@ class ProductStockEntrepot extends CommonObject $sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere); } - if (!empty($fk_product)) { - $sql .= ' AND fk_product = '.$fk_product; - } elseif (!empty($fk_entrepot)) { - $sql .= ' AND fk_entrepot = '.$fk_entrepot; + if (!empty($fk_product) && $fk_product > 0) { + $sql .= ' AND fk_product = '.((int) $fk_product); + } elseif (!empty($fk_entrepot) && $fk_entrepot > 0) { + $sql .= ' AND fk_entrepot = '.((int) $fk_entrepot); } // "elseif" used instead of "if" because getting list with specified fk_product and specified fk_entrepot would be the same as doing a fetch diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index ae8b13c776f..b8f998c0ec0 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -75,9 +75,6 @@ if (!$sortorder) { $sortorder = "ASC"; } -// Security check -$result = restrictedArea($user, 'stock'); - // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new Entrepot($db); $extrafields = new ExtraFields($db); @@ -106,7 +103,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -126,7 +123,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : 'help' ); } } @@ -136,6 +133,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'); +// Security check +$result = restrictedArea($user, 'stock'); + /* * Actions @@ -165,6 +165,7 @@ if (empty($reshook)) { } $toselect = array(); $search_array_options = array(); + $search_category_list = array(); } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { @@ -189,7 +190,6 @@ if (empty($reshook)) { $form = new Form($db); $warehouse = new Entrepot($db); -$totalarray = array(); $now = dol_now(); $help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; @@ -246,7 +246,7 @@ if (!empty($conf->categorie->enabled)) { foreach ($search as $key => $val) { $class_key = $key; if ($class_key == 'status') { - $class_key = 'statut'; // remove this after refactor entrepot.class property statut to status + $class_key = 'statut'; // remove this after refactoring entrepot.class property statut to status } if (($key == 'status' && $search[$key] == -1) || $key == 'entity') { continue; @@ -317,10 +317,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { } } // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { +if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; } else { - $sql .= $db->plimit($limit + 1, $offset); + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } $resql = $db->query($sql); if (!$resql) { @@ -332,7 +334,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { } // Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { +if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".DOL_URL_ROOT.'/product/stock/card.php?id='.$id); @@ -442,7 +444,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table +print '
    '; print ''."\n"; // Fields title search @@ -453,22 +455,22 @@ foreach ($object->fields as $key => $val) { if ($key == 'statut') { continue; } - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''."\n"; // Loop on record // -------------------------------------------------------------------- $i = 0; -if ($num) { - $warehouse = new Entrepot($db); +$totalarray = array(); - while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); - if (empty($obj)) { - break; // Should not happen +$warehouse = new Entrepot($db); + +while ($i < min($num, $limit)) { + $obj = $db->fetch_object($resql); + if (empty($obj)) { + break; // Should not happen + } + + // Store properties in $object + $warehouse->setVarsFromFetchObj($obj); + + $warehouse->label = $warehouse->ref; + + // Show here line of result + print ''; + + foreach ($warehouse->fields as $key => $val) { + if ($key == 'statut') { + continue; + } + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; } - $warehouse->id = $obj->rowid; - $warehouse->ref = $obj->ref; - $warehouse->label = $obj->ref; - $warehouse->lieu = $obj->lieu; - $warehouse->fk_parent = $obj->fk_parent; - $warehouse->statut = $obj->statut; - - foreach ($object->fields as $key => $val) { - $warehouse->{$key} = $obj->{$key}; + if (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif ($key == 'ref') { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - // Show here line of result - print ''; + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) { + $cssforfield = 'tdoverflowmax100'; + } - foreach ($warehouse->fields as $key => $val) { + if (!empty($arrayfields['t.'.$key]['checked'])) { + print ''; if ($key == 'statut') { - continue; + print $warehouse->getLibStatut(5); } - $cssforfield = (empty($val['css']) ? '' : $val['css']); - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; + if ($key == 'phone') { + print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); + } elseif ($key == 'fax') { + print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); + } else { + print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); } - - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + print ''; + if (!$i) { + $totalarray['nbfield']++; } - - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - - if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - if ($key == 'statut') { - print $warehouse->getLibStatut(5); - } - if ($key == 'phone') { - print dol_print_phone($obj->phone, '', 0, $obj->rowid, 'AC_TEL'); - } elseif ($key == 'fax') { - print dol_print_phone($obj->fax, '', 0, $obj->rowid, 'AC_FAX'); - } else { - print $warehouse->showOutputField($val, $key, $warehouse->$key, ''); - } - print ''; + if (!empty($val['isameasure'])) { if (!$i) { - $totalarray['nbfield']++; + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } - if (!empty($val['isameasure'])) { - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; - } - $totalarray['val']['t.'.$key] += $warehouse->$key; + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); } - } - } - - // Stock qty - if (!empty($arrayfields["stockqty"]['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'stockqty'; - } - } - - // PMP value - if (!empty($arrayfields["estimatedvalue"]['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'estimatedvalue'; - } - } - - // Selling value - if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 'estimatedstockvaluesell'; + $totalarray['val']['t.'.$key] += $warehouse->$key; } } + } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - - // Status - if (!empty($arrayfields['t.statut']['checked'])) { - print ''; - if (!$i) { - $totalarray['nbfield']++; - } + // Stock qty + if (!empty($arrayfields["stockqty"]['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'stockqty'; + } + } - // Action column - print ''; if (!$i) { $totalarray['nbfield']++; } - - print ''."\n"; - - - $i++; + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'estimatedvalue'; + } } - if ($totalnboflines - $offset <= $limit) { - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // Selling value + if (!empty($arrayfields["estimatedstockvaluesell"]['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'estimatedstockvaluesell'; + } } + + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + // Status + if (!empty($arrayfields['t.statut']['checked'])) { + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Action column + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + + print ''."\n"; + + + $i++; +} + +if ($totalnboflines - $offset <= $limit) { + // Show total line + include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +} + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''; } $db->free($resql); diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index f2432ea25af..9f3390d34af 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -209,7 +209,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree ); if ($result1 < 0) { $error++; - setEventMessages($product->errors, $product->errorss, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } // Add stock @@ -224,7 +224,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree ); if ($result2 < 0) { $error++; - setEventMessages($product->errors, $product->errorss, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } } else { $arraybatchinfo = $product->loadBatchInfo($batch); @@ -253,7 +253,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree ); if ($result1 < 0) { $error++; - setEventMessages($product->errors, $product->errorss, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } // Add stock @@ -271,7 +271,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree ); if ($result2 < 0) { $error++; - setEventMessages($product->errors, $product->errorss, 'errors'); + setEventMessages($product->error, $product->errors, 'errors'); } } } else { diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 0f2cec28ec9..44e9e7ecea9 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -86,6 +86,7 @@ $search_user = trim(GETPOST("search_user")); $search_batch = trim(GETPOST("search_batch")); $search_qty = trim(GETPOST("search_qty")); $search_type_mouvement = GETPOST('search_type_mouvement', 'int'); +$search_fk_projet=GETPOST("search_fk_projet", 'int'); $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -198,6 +199,7 @@ if (empty($reshook)) { $search_user = ""; $search_batch = ""; $search_qty = ''; + $search_fk_projet=0; $sall = ""; $toselect = ''; $search_array_options = array(); @@ -549,6 +551,9 @@ if (!empty($search_batch)) { if (!empty($product_id)) { $sql .= natural_search('p.rowid', $product_id); } +if (!empty($search_fk_projet) && $search_fk_projet != '-1') { + $sql .= natural_search('m.fk_projet', $search_fk_projet); +} if ($search_qty != '') { $sql .= natural_search('m.value', $search_qty, 1); } @@ -889,7 +894,7 @@ if ($resql) { $moreforfilter = ''; - $parameters = array(); + $parameters = array('arrayfields'=>&$arrayfields); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; @@ -1255,6 +1260,14 @@ if ($resql) { } print ''; } + + // Extra fields + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + // Fields from hook + $parameters = array('arrayfields'=>$arrayfields, 'objp'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray); + $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif (strpos($val['type'], 'integer:') === 0 || strpos($val['type'], 'sellist:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth125', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { print ''; } @@ -518,14 +520,14 @@ foreach ($object->fields as $key => $val) { if ($key == 'statut') { continue; } - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -564,162 +566,176 @@ print '
    '.price2num($obj->stockqty, 5).''; - if (price2num($obj->estimatedvalue, 'MT')) { - print ''.price(price2num($obj->estimatedvalue, 'MT'), 1).''; - } else { - print ''; - } - print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { - if ($obj->sellvalue) { - print ''.price(price2num($obj->sellvalue, 'MT'), 1).''; + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; } - } else { - $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); - print $form->textwithtooltip($langs->trans("Variable"), $htmltext); - } - print ''.$warehouse->LibStatut($obj->statut, 5).''.price2num($obj->stockqty, 5).''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; + // PMP value + if (!empty($arrayfields["estimatedvalue"]['checked'])) { + print ''; + if (price2num($obj->estimatedvalue, 'MT')) { + print ''.price(price2num($obj->estimatedvalue, 'MT'), 1).''; + } else { + print ''; } print '
    '; + if (empty($conf->global->PRODUIT_MULTIPRICES)) { + if ($obj->sellvalue) { + print ''.price(price2num($obj->sellvalue, 'MT'), 1).''; + } + } else { + $htmltext = $langs->trans("OptionMULTIPRICESIsOn"); + print $form->textwithtooltip($langs->trans("Variable"), $htmltext); + } + print ''.$warehouse->LibStatut($obj->statut, 5).''; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print '
    '.$langs->trans("NoRecordFound").'
    '; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b97e9b6c2d2..7fcee8f59cd 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -9,6 +9,7 @@ * Copyright (C) 2014-2015 Cédric Gross * Copyright (C) 2015 Marcos García * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,13 +77,12 @@ $batchnumber = GETPOST('batch_number', 'san_alpha'); if (!empty($batchnumber)) { $batchnumber = trim($batchnumber); } +$cost_price = GETPOST('cost_price', 'alpha'); // Security check if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit&stock', $id, 'product&product', '', '', $fieldid); - $object = new Product($db); $extrafields = new ExtraFields($db); @@ -114,6 +114,20 @@ $hookmanager->initHooks(array('stockproductcard', 'globalcard')); $error = 0; +$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->lire) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->lire)); +$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer)); + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $id, 'product&product', '', '', $fieldid); +} + /* * Actions @@ -129,6 +143,21 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +if ($action == 'setcost_price') { + if ($id) { + $result = $object->fetch($id); + $object->cost_price = price2num($cost_price); + $result = $object->update($object->id, $user); + if ($result > 0) { + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); + $action = ''; + } else { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } +} + if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer)) { $seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $desiredstock = GETPOST('desiredstock'); @@ -521,6 +550,45 @@ if ($id > 0 || $ref) { llxHeader('', $title, $helpurl); + if (!empty($conf->use_javascript_ajax)) { + ?> + + 0) { $head = product_prepare_head($object); $titre = $langs->trans("CardProduct".$object->type); @@ -547,8 +615,18 @@ if ($id > 0 || $ref) { print ''; + // Type + if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) { + $typeformat = 'select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); + print ''; + } + if ($conf->productbatch->enabled) { - print ''; } @@ -559,7 +637,7 @@ if ($id > 0 || $ref) { $textdesc .= "
    ".$langs->trans("CostPriceUsage"); $text = $form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', ''); print $form->editfieldkey($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); - print ''; @@ -857,17 +935,24 @@ if (!$variants) { print ''; print ''; print ''; + if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) { $colspan = 3; - print ''; + print ''; print ''; if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { $colspan--; - print ''; + print ''; } if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { $colspan--; - print ''; + print ''; } print ''; print ''; @@ -886,7 +971,7 @@ if (!$variants) { $sql .= " WHERE ps.reel != 0"; $sql .= " AND ps.fk_entrepot = e.rowid"; $sql .= " AND e.entity IN (".getEntity('stock').")"; - $sql .= " AND ps.fk_product = ".$object->id; + $sql .= " AND ps.fk_product = ".((int) $object->id); $sql .= " ORDER BY e.ref"; $entrepotstatic = new Entrepot($db); @@ -914,26 +999,38 @@ if (!$variants) { $stock_real = price2num($obj->reel, 'MS'); print ''; - print ''; - print ''; - // PMP - print ''; - // Value purchase - print ''; - // Sell price - print ''; - // Value sell + + print ''; + + // PMP + print ''; + + // Value purchase + print ''; + + // Sell price print ''; + + // Value sell + print ''; print ''; @@ -984,7 +1081,7 @@ if (!$variants) { print ''; print ''; } else { - print "\n".''; print ''; print ''; // Value to sell diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 5b19288deff..08b565c90a0 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -94,7 +94,9 @@ $usercanread = $user->rights->produit->lire; $usercancreate = $user->rights->produit->creer; $usercandelete = $user->rights->produit->supprimer; -$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +if (empty($upload_dir)) { + $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +} $permissiontoread = $usercanread; $permissiontoadd = $usercancreate; @@ -191,7 +193,6 @@ if ($object->id) { print dol_get_fiche_end(); - $permission = ($user->rights->produit->creer); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 00c8c186c66..78a18ca960b 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2021 Ferran Marcet * Copyright (C) 2019 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -93,7 +93,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -113,19 +113,8 @@ foreach ($object->fields as $key => $val) { } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]), - 'langfile'=>$extrafields->attributes[$object->table_element]['langfile'][$key] - ); - } - } -} +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'); @@ -310,7 +299,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id); + header("Location: ".DOL_URL_ROOT.'/product/stock/productlot_card.php?id='.$id); exit; } @@ -552,6 +541,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 73124fd7bad..824d667e934 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -66,7 +66,7 @@ $fourn_id = GETPOST('fourn_id', 'int'); $fk_supplier = GETPOST('fk_supplier', 'int'); $fk_entrepot = GETPOST('fk_entrepot', 'int'); -//List all visible warehouses +// List all visible warehouses $resWar = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "entrepot WHERE entity IN (" . $db->sanitize(getEntity('stock')) .")"); $listofqualifiedwarehousesid = ""; $count = 0; @@ -103,6 +103,7 @@ if (!$sortorder) { $sortorder = 'ASC'; } +// Define virtualdiffersfromphysical $virtualdiffersfromphysical = 0; if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) @@ -224,17 +225,24 @@ if ($action == 'order' && GETPOST('valid')) { $suppliersid = array_keys($suppliers); foreach ($suppliers as $supplier) { $order = new CommandeFournisseur($db); + // Check if an order for the supplier exists $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur"; $sql .= " WHERE fk_soc = ".((int) $suppliersid[$i]); - $sql .= " AND source = 42 AND fk_statut = 0"; + $sql .= " AND source = ".((int) $order::SOURCE_ID_REPLENISHMENT)." AND fk_statut = ".$order::STATUS_DRAFT; $sql .= " AND entity IN (".getEntity('commande_fournisseur').")"; $sql .= " ORDER BY date_creation DESC"; $resql = $db->query($sql); if ($resql && $db->num_rows($resql) > 0) { $obj = $db->fetch_object($resql); + $order->fetch($obj->rowid); + $order->fetch_thirdparty(); + foreach ($supplier['lines'] as $line) { + if (empty($line->remise_percent)) { + $line->remise_percent = $order->thirdparty->remise_supplier_percent; + } $result = $order->addline( $line->desc, $line->subprice, @@ -268,13 +276,19 @@ if ($action == 'order' && GETPOST('valid')) { } else { $order->socid = $suppliersid[$i]; $order->fetch_thirdparty(); - //trick to know which orders have been generated this way - $order->source = 42; + + // Trick to know which orders have been generated using the replenishment feature + $order->source = $order::SOURCE_ID_REPLENISHMENT; + foreach ($supplier['lines'] as $line) { + if (empty($line->remise_percent)) { + $line->remise_percent = $order->thirdparty->remise_supplier_percent; + } $order->lines[] = $line; } $order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id; $order->mode_reglement_id = $order->thirdparty->mode_reglement_supplier_id; + $id = $order->create($user); if ($id < 0) { $fail++; @@ -325,7 +339,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre } $sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; -$sql .= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; +$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type,'; $sql .= ' p.tms as datem, p.duration, p.tobuy,'; $sql .= ' p.desiredstock, p.seuil_stock_alerte,'; if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { @@ -346,11 +360,8 @@ $sql .= $hookmanager->resPrint; $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product AND s.fk_entrepot IN ('.$db->sanitize($listofqualifiedwarehousesid).')'; //$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')'; -if ($fk_supplier > 0) { - $sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')'; -} if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.$fk_entrepot.')'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')'; } // Add fields from hooks @@ -377,9 +388,17 @@ if ($search_label) { $sql .= natural_search('p.label', $search_label); } $sql .= ' AND p.tobuy = 1'; -if (empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) { // Add test to exclude products that has variants +if (!empty($conf->variants->eabled) && empty($conf->global->VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT)) { // Add test to exclude products that has variants $sql .= ' AND p.rowid NOT IN (SELECT pac.fk_product_parent FROM '.MAIN_DB_PREFIX.'product_attribute_combination as pac WHERE pac.entity IN ('.getEntity('product').'))'; } +if ($fk_supplier > 0) { + $sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))'; +} +// Add where from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price'; $sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql .= ', p.duration, p.tobuy'; @@ -891,7 +910,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; // Current stock (all warehouses) - print ''; + print ''; // Current stock (warehouse selected only) if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index b36d530d624..4892004db72 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -45,7 +45,7 @@ if ($user->socid) { $result = restrictedArea($user, 'produit|service'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('stockreplenishlist')); +$hookmanager->initHooks(array('stockatdate')); //checks if a product has been ordered @@ -116,7 +116,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' } $warehouseStatus = array(); -if ($conf->global->ENTREPOT_EXTRA_STATUS) { +if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) { //$warehouseStatus[] = Entrepot::STATUS_CLOSED; $warehouseStatus[] = Entrepot::STATUS_OPEN_ALL; $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; @@ -136,10 +136,10 @@ if ($date && $dateIsValid) { // Avoid heavy sql if mandatory date is not defined $sql .= " AND w.statut IN (".$db->sanitize(implode(',', $warehouseStatus)).")"; } if ($productid > 0) { - $sql .= " AND ps.fk_product = ".$productid; + $sql .= " AND ps.fk_product = ".((int) $productid); } if ($fk_warehouse > 0) { - $sql .= " AND ps.fk_entrepot = ".$fk_warehouse; + $sql .= " AND ps.fk_entrepot = ".((int) $fk_warehouse); } $sql .= " GROUP BY fk_product, fk_entrepot"; //print $sql; @@ -294,8 +294,8 @@ if ($sortfield == 'stock' && $fk_warehouse > 0) { } $sql .= $db->order($sortfield, $sortorder); +$nbtotalofrecords = 0; if ($date && $dateIsValid) { // We avoid a heavy sql if mandatory parameter date not yet defined - $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); @@ -356,14 +356,14 @@ print '
    '; print ''.$langs->trans('Date').' '.$form->selectDate(($date ? $date : -1), 'date'); print '   '; -print img_picto('', 'product').' '; -print $langs->trans('Product').' '; -print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300', 0, '', null, 1); +print img_picto('', 'product', 'class="pictofiwedwidth"').' '; +print ' '; +print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, $langs->trans('Product'), 0, 'maxwidth300', 0, '', null, 1); print '   '; -print img_picto('', 'stock').' '; -print $langs->trans('Warehouse').' '; -print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, '', 0, 0, null, '', null, 1, false, 'e.ref'); +print img_picto('', 'stock', 'class="pictofiwedwidth"'); +print ' '; +print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, $langs->trans('Warehouse'), 0, 0, null, '', null, 1, false, 'e.ref'); print '
    '; $parameters = array(); @@ -618,7 +618,9 @@ if (empty($date) || ! $dateIsValid) { print '
    '; + print (empty($conf->global->PRODUCT_DENY_CHANGE_PRODUCT_TYPE)) ? $form->editfieldkey("Type", 'fk_product_type', $object->type, $object, 0, $typeformat) : $langs->trans('Type'); + print ''; + print $form->editfieldval("Type", 'fk_product_type', $object->type, $object, 0, $typeformat); + print '
    '.$langs->trans("ManageLotSerial").''; + print '
    '.$langs->trans("ManageLotSerial").''; print $object->getLibStatut(0, 2); print '
    '; + print ''; print $form->editfieldval($text, 'cost_price', $object->cost_price, $object, $usercancreate, 'amount:6'); print '
    '; + if (!empty($conf->use_javascript_ajax)) { + print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'   '; + print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").''; + //print ' '.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', ''); + } + print ''.$langs->trans("batch_number").''.$langs->trans("EatByDate").''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").''.$langs->trans("SellByDate").'
    '.$entrepotstatic->getNomUrl(1).''.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').''.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').''.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { - print price(price2num($object->price, 'MU'), 1); - } else { - print $langs->trans("Variable"); + + // Warehouse + print ''; + print $entrepotstatic->getNomUrl(1); + if (!empty($conf->use_javascript_ajax) && !empty($conf->productbatch->enabled) && $object->hasbatch()) { + print ''; + print (empty($conf->global->STOCK_SHOW_ALL_BATCH_BY_DEFAULT) ? '(+)' : '(-)'); + print ''; } print ''.$stock_real.($stock_real < 0 ? ' '.img_warning() : '').''.(price2num($object->pmp) ? price2num($object->pmp, 'MU') : '').''.(price2num($object->pmp) ? price(price2num($object->pmp * $obj->reel, 'MT')) : '').''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { - print price(price2num($object->price * $obj->reel, 'MT'), 1); - } else { - print $langs->trans("Variable"); + print price(price2num($object->price, 'MU'), 1); + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + print $form->textwithpicto('', $langs->trans("Variable")); + } + print ''; + print price(price2num($object->price * $obj->reel, 'MT'), 1); + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + print $form->textwithpicto('', $langs->trans("Variable")); } print '
    '; + print "\n".'
    '; print ''; print $product_lot_static->getNomUrl(1); @@ -1045,10 +1142,9 @@ if (!$variants) { print $totalvalue ? price(price2num($totalvalue, 'MT'), 1) : ' '; print ''; - if (empty($conf->global->PRODUIT_MULTIPRICES)) { - print ($total ? price($totalvaluesell / $total, 1) : ' '); - } else { - print $langs->trans("Variable"); + print ($total ? price($totalvaluesell / $total, 1) : ' '); + if (!empty($conf->global->PRODUIT_MULTIPRICES)) { + print $form->textwithpicto('', $langs->trans("Variable")); } print ''.($fk_entrepot > 0 ? $alertstockwarehouse : $alertstock).''.$warning.$stock.''.$warning.$stock; + print ''; + print '
    '; print ''; -$db->free($resql); +if (!empty($resql)) { + $db->free($resql); +} print dol_get_fiche_end(); diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 45b45136410..0cae81e36c7 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -45,100 +45,125 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid'); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); + +if ($id > 0 || !empty($ref)) { + $object = new Product($db); + $object->fetch($id, $ref); +} + +if ($object->id > 0) { + if ($object->type == $object::TYPE_PRODUCT) { + restrictedArea($user, 'produit', $object->id, 'product&product', '', ''); + } + if ($object->type == $object::TYPE_SERVICE) { + restrictedArea($user, 'service', $object->id, 'product&product', '', ''); + } +} else { + restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype); +} + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('producttranslationcard', 'globalcard')); /* * Actions */ -// retour a l'affichage des traduction si annulation -if ($cancel == $langs->trans("Cancel")) { - $action = ''; +$parameters = array('id'=>$id, 'ref'=>$ref); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - -if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) { - $object = new Product($db); - $object->fetch($id); - $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); - setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); - $action = ''; -} - -// Add translation -if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { - $object = new Product($db); - $object->fetch($id); - $current_lang = $langs->getDefaultLang(); - - // update de l'objet - if (GETPOST("forcelangprod") == $current_lang) { - $object->label = GETPOST("libelle"); - $object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); - $object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); - - $object->update($object->id, $user); - } else { - $object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle"); - $object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); - $object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); - } - - // save in database - if (GETPOST("forcelangprod")) { - $result = $object->setMultiLangs($user); - } else { - $object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language")); - $result = -1; - } - - if ($result > 0) { +if (empty($reshook)) { + // retour a l'affichage des traduction si annulation + if ($cancel == $langs->trans("Cancel")) { $action = ''; - } else { - $action = 'add'; - setEventMessages($object->error, $object->errors, 'errors'); } -} -// Edit translation -if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { - $object = new Product($db); - $object->fetch($id); - $current_lang = $langs->getDefaultLang(); + if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) { + $object = new Product($db); + $object->fetch($id); + $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + $action = ''; + } - foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet - if ($key == $current_lang) { - $object->label = GETPOST("libelle-".$key); - $object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); - $object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); + // Add translation + if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object = new Product($db); + $object->fetch($id); + $current_lang = $langs->getDefaultLang(); + + // update de l'objet + if (GETPOST("forcelangprod") == $current_lang) { + $object->label = GETPOST("libelle"); + $object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); + $object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); + + $object->update($object->id, $user); } else { - $object->multilangs[$key]["label"] = GETPOST("libelle-".$key); - $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml')); - $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml')); + $object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle"); + $object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml')); + $object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml')); + } + + // save in database + if (GETPOST("forcelangprod")) { + $result = $object->setMultiLangs($user); + } else { + $object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language")); + $result = -1; + } + + if ($result > 0) { + $action = ''; + } else { + $action = 'add'; + setEventMessages($object->error, $object->errors, 'errors'); } } - $result = $object->setMultiLangs($user); - if ($result > 0) { - $action = ''; - } else { - $action = 'edit'; - setEventMessages($object->error, $object->errors, 'errors'); + // Edit translation + if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object = new Product($db); + $object->fetch($id); + $current_lang = $langs->getDefaultLang(); + + foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet + if ($key == $current_lang) { + $object->label = GETPOST("libelle-" . $key); + $object->description = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); + $object->other = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml')); + } else { + $object->multilangs[$key]["label"] = GETPOST("libelle-" . $key); + $object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml')); + $object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml')); + } + } + + $result = $object->setMultiLangs($user); + if ($result > 0) { + $action = ''; + } else { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } } -} -// Delete translation -if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { - $object = new Product($db); - $object->fetch($id); - $langtodelete = GETPOST('langdel', 'alpha'); + // Delete translation + if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) { + $object = new Product($db); + $object->fetch($id); + $langtodelete = GETPOST('langdel', 'alpha'); - $result = $object->delMultiLangs($langtodelete, $user); - if ($result > 0) { - $action = ''; - } else { - $action = 'edit'; - setEventMessages($object->error, $object->errors, 'errors'); + $result = $object->delMultiLangs($langtodelete, $user); + if ($result > 0) { + $action = ''; + } else { + $action = 'edit'; + setEventMessages($object->error, $object->errors, 'errors'); + } } } @@ -201,11 +226,15 @@ print dol_get_fiche_end(); */ print "\n".'
    '."\n"; -if ($action == '') { - if ($user->rights->produit->creer || $user->rights->service->creer) { - print ''.$langs->trans("Add").''; - if ($cnt_trans > 0) { - print ''.$langs->trans("Update").''; +$parameters = array(); +$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been +if (empty($reshook)) { + if ($action == '') { + if ($user->rights->produit->creer || $user->rights->service->creer) { + print '' . $langs->trans("Add") . ''; + if ($cnt_trans > 0) { + print '' . $langs->trans("Update") . ''; + } } } } @@ -248,6 +277,9 @@ if ($action == 'edit') { } } + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print '
    '; print '
    '; @@ -319,6 +351,9 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service } print '
    '; + $parameters = array(); + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + print dol_get_fiche_end(); print '
    '; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 0191cc74ef8..60484eb4f17 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -425,7 +425,7 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_SH $sql .= " AND ect.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listoftaskcontacttype))).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id; } if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } $sql .= " AND p.fk_statut=1"; $sql .= " GROUP BY p.ref, p.title, p.rowid, p.fk_statut, p.fk_opp_status, p.public, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee"; diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index b0195200dd5..8897f9550a3 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -204,7 +204,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') if ($result >= 0 || $result == -2) { // Contact add ok or already contact of task // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -478,7 +478,7 @@ $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '. print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; @@ -503,18 +503,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 087fe5b8f0b..6e474ea8568 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -156,7 +156,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') if ($result >= 0 || $result == -2) { // Contact add ok or already contact of task // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -391,12 +391,12 @@ if ($usertoprocess->id != $user->id) { $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); } print '
    '; -print img_picto('', 'projecttask'); +print img_picto('', 'projecttask', 'class="pictofixedwidth"'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1); print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; @@ -422,18 +422,18 @@ $includeonly = 'hierachyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 0a275cb46e3..ecb2a0bdaf5 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -214,7 +214,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask') if ($result >= 0 || $result == -2) { // Contact add ok or already contact of task // Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project) $sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact'; - $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'"; + $sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -488,12 +488,12 @@ if ($usertoprocess->id != $user->id) { $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); } print '
    '; -print img_picto('', 'projecttask'); +print img_picto('', 'projecttask', 'class="pictofixedwidth"'); $formproject->selectTasks($socid ? $socid : -1, $taskid, 'taskid', 32, 0, '-- '.$langs->trans("ChooseANotYetAssignedTask").' --', 1, 0, 0, '', '', 'all', $usertoprocess); print '
    '; print ' '; print $formcompany->selectTypeContact($object, '', 'type', 'internal', 'rowid', 0, 'maxwidth150onsmartphone'); -print ''; +print ''; print '
    '; print '
    '; @@ -556,18 +556,18 @@ $includeonly = 'hierarchyme'; if (empty($user->rights->user->user->lire)) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('User'), 'user', 'class="paddingright pictofixedwidth"').$form->select_dolusers($search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire ? 0 : 0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter .= '
    '; if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) { $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('Project'), 'project', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; $moreforfilter .= '
    '; $moreforfilter .= '
    '; - $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright"').''; + $moreforfilter .= img_picto($langs->trans('Filter').' '.$langs->trans('ThirdParty'), 'company', 'class="paddingright pictofixedwidth"').''; $moreforfilter .= '
    '; } diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php index 288e2282a40..eaea44dd22b 100644 --- a/htdocs/projet/admin/project.php +++ b/htdocs/projet/admin/project.php @@ -219,6 +219,10 @@ if ($action == 'updateMaskTask') { $projectToSelect = GETPOST('projectToSelect', 'alpha'); dolibarr_set_const($db, 'PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY', $projectToSelect, 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value } + if (GETPOST('PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS')) { + $timesheetFreezeDuration = GETPOST('timesheetFreezeDuration', 'alpha'); + dolibarr_set_const($db, 'PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS', intval($timesheetFreezeDuration), 'chaine', 0, '', $conf->entity); //Allow to disable this configuration if empty value + } } elseif (preg_match('/^(set|del)_?([A-Z_]+)$/', $action, $reg)) { // Set boolean (on/off) constants if (!dolibarr_set_const($db, $reg[2], ($reg[1] === 'set' ? '1' : '0'), 'chaine', 0, '', $conf->entity) > 0) { @@ -797,6 +801,7 @@ print ''; print ''; +print ''; $key = 'PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE'; echo '', @@ -808,6 +813,14 @@ echo '', '', ''; +print ''; +print ''.$langs->trans("TimesheetPreventAfterFollowingMonths").''; + +print ''; +print ' '; +print ''; +print ''; +print ''; print ''; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 5264fa02596..d933e6f55a0 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -82,7 +82,7 @@ if (empty($mode) || $mode != 'gettasks') { // Mode to get list of tasks if ($mode == 'gettasks') { $formproject = new FormProjets($db); - $formproject->selectTasks((!empty($$socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); + $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), ''); return; } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3c2d5b02829..b14fcfc73fd 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -89,6 +89,8 @@ $socid = GETPOST('socid', 'int'); //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. restrictedArea($user, 'projet', $object->id, 'projet&project'); +$permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php + /* * Actions @@ -121,6 +123,8 @@ if (empty($reshook)) { $action = ''; } + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + if ($action == 'add' && $user->rights->projet->creer) { $error = 0; if (!GETPOST('ref')) { @@ -132,9 +136,11 @@ if (empty($reshook)) { $error++; } - if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } // Create with status validated immediatly @@ -270,9 +276,11 @@ if (empty($reshook)) { } } - if ($object->opp_amount && ($object->opp_status <= 0)) { - $error++; - setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + if ($object->opp_amount && ($object->opp_status <= 0)) { + $error++; + setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors'); + } } if (!$error) { @@ -511,7 +519,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Ref $suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref); - print ''.$langs->trans("Ref").''; + print ''.$langs->trans("Ref").''; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print ''; @@ -796,7 +804,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Ref $suggestedref = $object->ref; print ''.$langs->trans("Ref").''; - print ''; + print ''; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print ''; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index b0b94264fb0..38f525626ba 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -146,7 +146,7 @@ class Projects extends DolibarrApi } // Select projects of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_project = t.rowid "; + $sql .= " AND c.fk_categorie = ".((int) $category)." AND c.fk_project = t.rowid "; } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index ca42e8a3fd1..4f52dd48057 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -224,7 +224,7 @@ class Project extends CommonObject public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'ID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'ref' =>array('type'=>'varchar(50)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>15, 'searchall'=>1), - 'title' =>array('type'=>'varchar(255)', 'label'=>'ProjectLabel', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>17, 'showoncombobox'=>1, 'searchall'=>1), + 'title' =>array('type'=>'varchar(255)', 'label'=>'ProjectLabel', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>17, 'showoncombobox'=>2, 'searchall'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>19), 'fk_soc' =>array('type'=>'integer', 'label'=>'Thirdparty', 'enabled'=>1, 'visible'=>0, 'position'=>20), 'dateo' =>array('type'=>'date', 'label'=>'DateStart', 'enabled'=>1, 'visible'=>1, 'position'=>30), @@ -253,6 +253,7 @@ class Project extends CommonObject 'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserCreation', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>210), 'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModification', 'enabled'=>1, 'visible'=>0, 'position'=>215), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>220), + 'email_msgid'=>array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'enabled'=>1, 'visible'=>-1, 'position'=>250, 'help'=>'EmailMsgIDWhenSourceisEmail'), 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'position'=>500) ); // END MODULEBUILDER PROPERTIES @@ -486,7 +487,7 @@ class Project extends CommonObject $sql .= ", title = '".$this->db->escape($this->title)."'"; $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : "null"); - $sql .= ", fk_statut = ".$this->statut; + $sql .= ", fk_statut = ".((int) $this->statut); $sql .= ", fk_opp_status = ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'null'); $sql .= ", opp_percent = ".((is_numeric($this->opp_percent) && $this->opp_percent != '') ? $this->opp_percent : 'null'); $sql .= ", public = ".($this->public ? 1 : 0); @@ -583,7 +584,8 @@ class Project extends CommonObject { global $conf; - if (empty($id) && empty($ref)) { + if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) { + dol_syslog(get_class($this)."::fetch Bad parameters", LOG_WARNING); return -1; } @@ -742,7 +744,8 @@ class Project extends CommonObject 'datefieldname' => $datefieldname, 'dates' => $dates, 'datee' => $datee, - 'fk_projet' => $projectkey + 'fk_projet' => $projectkey, + 'ids' => $ids, ); $reshook = $hookmanager->executeHooks('getElementList', $parameters, $object, $action); if ($reshook > 0) { @@ -1777,13 +1780,13 @@ class Project extends CommonObject if ($tableName == "actioncomm") { $sql .= " SET fk_project=".$this->id; - $sql .= " WHERE id=".$elementSelectId; + $sql .= " WHERE id=".((int) $elementSelectId); } elseif ($tableName == "entrepot") { $sql .= " SET fk_project=".$this->id; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } else { $sql .= " SET fk_projet=".$this->id; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } dol_syslog(get_class($this)."::update_element", LOG_DEBUG); @@ -1813,10 +1816,10 @@ class Project extends CommonObject if ($tableName == "actioncomm") { $sql .= " SET fk_project=NULL"; - $sql .= " WHERE id=".$elementSelectId; + $sql .= " WHERE id=".((int) $elementSelectId); } else { $sql .= " SET ".$projectfield."=NULL"; - $sql .= " WHERE rowid=".$elementSelectId; + $sql .= " WHERE rowid=".((int) $elementSelectId); } dol_syslog(get_class($this)."::remove_element", LOG_DEBUG); @@ -1888,10 +1891,10 @@ class Project extends CommonObject $sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'w') - 1)."')"; if ($taskid) { - $sql .= " AND ptt.fk_task=".$taskid; + $sql .= " AND ptt.fk_task=".((int) $taskid); } if (is_numeric($userid)) { - $sql .= " AND ptt.fk_user=".$userid; + $sql .= " AND ptt.fk_user=".((int) $userid); } //print $sql; @@ -1951,10 +1954,10 @@ class Project extends CommonObject $sql .= " AND (ptt.task_date >= '".$this->db->idate($datestart)."' "; $sql .= " AND ptt.task_date <= '".$this->db->idate(dol_time_plus_duree($datestart, 1, 'm') - 1)."')"; if ($task_id) { - $sql .= " AND ptt.fk_task=".$taskid; + $sql .= " AND ptt.fk_task=".((int) $taskid); } if (is_numeric($userid)) { - $sql .= " AND ptt.fk_user=".$userid; + $sql .= " AND ptt.fk_user=".((int) $userid); } //print $sql; @@ -2048,7 +2051,7 @@ class Project extends CommonObject $response->nbtodo++; $project_static->statut = $obj->status; - $project_static->opp_status = $obj->opp_status; + $project_static->opp_status = $obj->fk_opp_status; $project_static->datee = $this->db->jdate($obj->datee); if ($project_static->hasDelay()) { diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 42c5ae2135f..1845e303704 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -68,7 +68,7 @@ class ProjectStats extends Stats $sql .= ", ".MAIN_DB_PREFIX."c_lead_status as cls"; $sql .= $this->buildWhere(); // For external user, no check is done on company permission because readability is managed by public status of project and assignement. - //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid; + //if ($socid > 0) $sql.= " AND t.fk_soc = ".((int) $socid); // No check is done on company permission because readability is managed by public status of project and assignement. //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; $sql .= " AND t.fk_opp_status = cls.rowid"; @@ -133,7 +133,7 @@ class ProjectStats extends Stats // $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON sc.fk_soc=t.fk_soc AND sc.fk_user=" . $user->id; $sql .= $this->buildWhere(); // For external user, no check is done on company permission because readability is managed by public status of project and assignement. - //if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid; + //if ($socid > 0) $sql.= " AND t.fk_soc = ".((int) $socid); // No check is done on company permission because readability is managed by public status of project and assignement. //if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; $sql .= " GROUP BY year"; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 0f84313b75a..5b92b9cccdf 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -116,6 +116,7 @@ class Task extends CommonObject public $timespent_datehour; // More accurate start date (same than timespent_date but includes hours, minutes and seconds) public $timespent_withhour; // 1 = we entered also start hours for timesheet line public $timespent_fk_user; + public $timespent_thm; public $timespent_note; public $comments = array(); @@ -274,7 +275,8 @@ class Task extends CommonObject } $sql .= " WHERE "; if (!empty($ref)) { - $sql .= "t.ref = '".$this->db->escape($ref)."'"; + $sql .= "entity IN (".getEntity('project').")"; + $sql .= " AND t.ref = '".$this->db->escape($ref)."'"; } else { $sql .= "t.rowid = ".((int) $id); } @@ -853,7 +855,7 @@ class Task extends CommonObject $sql .= " AND p.rowid = ec.element_id"; $sql .= " AND ctc.rowid = ec.fk_c_type_contact"; $sql .= " AND ctc.element = 'project'"; - $sql .= " AND ec.fk_socpeople = ".$filteronprojuser; + $sql .= " AND ec.fk_socpeople = ".((int) $filteronprojuser); $sql .= " AND ec.statut = 4"; $sql .= " AND ctc.source = 'internal'"; } @@ -862,12 +864,12 @@ class Task extends CommonObject $sql .= " AND p.rowid = ec2.element_id"; $sql .= " AND ctc2.rowid = ec2.fk_c_type_contact"; $sql .= " AND ctc2.element = 'project_task'"; - $sql .= " AND ec2.fk_socpeople = ".$filterontaskuser; + $sql .= " AND ec2.fk_socpeople = ".((int) $filterontaskuser); $sql .= " AND ec2.statut = 4"; $sql .= " AND ctc2.source = 'internal'"; } if ($socid) { - $sql .= " AND p.fk_soc = ".$socid; + $sql .= " AND p.fk_soc = ".((int) $socid); } if ($projectid) { $sql .= " AND p.rowid IN (".$this->db->sanitize($projectid).")"; @@ -1157,6 +1159,18 @@ class Task extends CommonObject $this->timespent_datehour = $this->timespent_date; } + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + + $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_time ("; @@ -1211,6 +1225,7 @@ class Task extends CommonObject $ret = -2; } + // Update hourly rate of this time spent entry $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql .= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $this->timespent_fk_user).")"; // set average hour rate of user $sql .= " WHERE rowid = ".((int) $tasktime_id); @@ -1351,9 +1366,9 @@ class Task extends CommonObject } /** - * Load one record of time spent + * Load properties of timespent of a task from the time spent ID. * - * @param int $id Id object + * @param int $id Id in time spent table * @return int <0 if KO, >0 if OK */ public function fetchTimeSpent($id) @@ -1424,6 +1439,7 @@ class Task extends CommonObject $sql .= " ptt.task_duration,"; $sql .= " ptt.fk_user,"; $sql .= " ptt.note,"; + $sql .= " ptt.thm,"; $sql .= " pt.rowid as task_id,"; $sql .= " pt.ref as task_ref,"; $sql .= " pt.label as task_label,"; @@ -1434,7 +1450,7 @@ class Task extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as ptt, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid"; $sql .= " WHERE ptt.fk_task = pt.rowid AND pt.fk_projet = p.rowid"; - $sql .= " AND ptt.fk_user = ".$userobj->id; + $sql .= " AND ptt.fk_user = ".((int) $userobj->id); $sql .= " AND pt.entity IN (".getEntity('project').")"; if ($morewherefilter) { $sql .= $morewherefilter; @@ -1470,6 +1486,7 @@ class Task extends CommonObject $newobj->timespent_withhour = $obj->task_date_withhour; $newobj->timespent_duration = $obj->task_duration; $newobj->timespent_fk_user = $obj->fk_user; + $newobj->timespent_thm = $obj->thm; // hourly rate $newobj->timespent_note = $obj->note; $arrayres[] = $newobj; @@ -1518,16 +1535,27 @@ class Task extends CommonObject $this->timespent_note = trim($this->timespent_note); } + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time SET"; $sql .= " task_date = '".$this->db->idate($this->timespent_date)."',"; $sql .= " task_datehour = '".$this->db->idate($this->timespent_datehour)."',"; $sql .= " task_date_withhour = ".(empty($this->timespent_withhour) ? 0 : 1).","; - $sql .= " task_duration = ".$this->timespent_duration.","; - $sql .= " fk_user = ".$this->timespent_fk_user.","; + $sql .= " task_duration = ".((int) $this->timespent_duration).","; + $sql .= " fk_user = ".((int) $this->timespent_fk_user).","; $sql .= " note = ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null"); - $sql .= " WHERE rowid = ".$this->timespent_id; + $sql .= " WHERE rowid = ".((int) $this->timespent_id); dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); if ($this->db->query($sql)) { @@ -1551,10 +1579,12 @@ class Task extends CommonObject } if ($ret == 1 && ($this->timespent_old_duration != $this->timespent_duration)) { - $newDuration = $this->timespent_duration - $this->timespent_old_duration; - + // Recalculate amount of time spent for task and update denormalized field $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; $sql .= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".((int) $this->id).")"; + if (isset($this->progress)) { + $sql .= ", progress = ".((float) $this->progress); // Do not overwrite value if not provided + } $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); @@ -1563,6 +1593,17 @@ class Task extends CommonObject $this->db->rollback(); $ret = -2; } + + // Update hourly rate of this time spent entry, but only if it was not set initialy + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; + $sql .= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".((int) $this->timespent_fk_user).")"; // set average hour rate of user + $sql .= " WHERE (thm IS NULL OR thm = 0) AND rowid = ".((int) $this->timespent_id); + + dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); + if (!$this->db->query($sql)) { + $this->error = $this->db->lasterror(); + $ret = -2; + } } if ($ret >= 0) { @@ -1584,6 +1625,17 @@ class Task extends CommonObject $error = 0; + if (! empty($conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS)) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $restrictBefore = dol_time_plus_duree(dol_now(), - $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS, 'm'); + + if ($this->timespent_date < $restrictBefore) { + $this->error = $langs->trans('TimeRecordingRestrictedToNMonthsBack', $conf->global->PROJECT_TIMESHEET_PREVENT_AFTER_MONTHS); + $this->errors[] = $this->error; + return -1; + } + } + $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_time"; @@ -1986,7 +2038,8 @@ class Task extends CommonObject global $conf, $langs; // For external user, no check is done on company because readability is managed by public status of project and assignement. - //$socid=$user->socid; + //$socid = $user->socid; + $socid = 0; $projectstatic = new Project($this->db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid); @@ -2007,10 +2060,7 @@ class Task extends CommonObject $sql .= " AND p.rowid IN (".$this->db->sanitize($projectsListId).")"; } // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser - //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; - if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; - } + //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser // if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))"; @@ -2083,7 +2133,7 @@ class Task extends CommonObject // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser //if ($socid || ! $user->rights->societe->client->voir) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id.") OR (s.rowid IS NULL))"; @@ -2119,7 +2169,7 @@ class Task extends CommonObject $now = dol_now(); - $datetouse = ($this->date_end > 0) ? $this->date_end : ($this->datee > 0 ? $this->datee : 0); + $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 3f9ec04d437..df31724d07c 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -40,11 +40,6 @@ $ref = GETPOST('ref', 'alpha'); $mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0); //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects -// Security check -$socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. -$result = restrictedArea($user, 'projet', $id, 'projet&project'); - $object = new Project($db); include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once @@ -82,6 +77,11 @@ if (!$sortfield) { $sortfield = "name"; } +// Security check +$socid = 0; +//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +$result = restrictedArea($user, 'projet', $id, 'projet&project'); + /* @@ -164,8 +164,8 @@ if ($object->id > 0) { print dol_get_fiche_end(); - $modulepart = 'project'; - $permission = ($userWrite > 0); + $modulepart = 'projet'; + $permissiontoadd = ($userWrite > 0); $permtoedit = ($userWrite > 0); include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index a6e3af11979..7fcfe3bc92b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -1030,7 +1030,7 @@ foreach ($listofreferent as $key => $value) { $addform .= ''; $addform .= ''; $addform .= ''; - $addform .= ''; + $addform .= ''; $addform .= '
    '.$langs->trans("SelectElement").''.$selectList.'
    '; $addform .= ''; $addform .= '
    '; @@ -1039,7 +1039,7 @@ foreach ($listofreferent as $key => $value) { if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform .= '
    '; if ($testnew) { - $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; + $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { $addform .= ''.($buttonnew ? $langs->trans($buttonnew) : $langs->trans("Create")).''; } diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index d8c875d2933..aa9d9a8a437 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -213,7 +213,7 @@ if ($mine || empty($user->rights->projet->all->lire)) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // If we have this test true, it also means projectset is not 2 } if ($socid) { - $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; + $sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".((int) $socid).")"; } $sql .= " ORDER BY p.tms DESC"; $sql .= $db->plimit($max, 0); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a9f17f5439b..6d7ec7d351e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -25,7 +25,7 @@ /** * \file htdocs/projet/list.php - * \ingroup projet + * \ingroup project * \brief Page to list projects */ @@ -167,23 +167,35 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; -// Add none object fields to fields for list +// Add non object fields to fields for list $arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1)); $arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23); $arrayfields['opp_weighted_amount'] = array('label'=>$langs->trans('OpportunityWeightedAmountShort'), 'checked'=>0, 'position'=> 116, 'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1), 'position'=>106); +// Force some fields according to search_usage filter... +if (GETPOST('search_usage_opportunity')) { + //$arrayfields['p.usage_opportunity']['visible'] = 1; // Not require, filter on search_opp_status is enough + //$arrayfields['p.usage_opportunity']['checked'] = 1; // Not require, filter on search_opp_status is enough +} +if (GETPOST('search_usage_event_organization')) { + $arrayfields['p.fk_opp_status']['enabled'] = 0; + $arrayfields['p.opp_amount']['enabled'] = 0; + $arrayfields['p.opp_percent']['enabled'] = 0; + $arrayfields['opp_weighted_amount']['enabled'] = 0; + $arrayfields['p.usage_organize_event']['visible'] = 1; + $arrayfields['p.usage_organize_event']['checked'] = 1; +} $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); - /* * Actions */ @@ -297,7 +309,7 @@ if (empty($reshook)) { * View */ -$socstatic = new Societe($db); +$companystatic = new Societe($db); $form = new Form($db); $formother = new FormOther($db); $formproject = new FormProjets($db); @@ -330,12 +342,14 @@ if (count($listofprojectcontacttype) == 0) { } $distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. -$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat"; -$sql .= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount "; -$sql .= ", p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event"; -$sql .= ", accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth"; -$sql .= ", s.rowid as socid, s.nom as name, s.email"; -$sql .= ", cls.code as opp_status_code"; +$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,"; +$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,"; +$sql .= " p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,"; +$sql .= " p.email_msgid,"; +$sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth,"; +$sql .= " s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client,"; +$sql .= " country.code as country_code,"; +$sql .= " cls.code as opp_status_code"; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { @@ -355,6 +369,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_lead_status as cls on p.fk_opp_status = cls.rowid"; // We'll need this table joined to the select in order to filter by sale // No check is done on company permission because readability is managed by public status of project and assignement. @@ -400,12 +415,12 @@ if ($search_status >= 0) { if ($search_status == 99) { $sql .= " AND p.fk_statut <> 2"; } else { - $sql .= " AND p.fk_statut = ".$db->escape($search_status); + $sql .= " AND p.fk_statut = ".((int) $search_status); } } if ($search_opp_status) { if (is_numeric($search_opp_status) && $search_opp_status > 0) { - $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status); + $sql .= " AND p.fk_opp_status = ".((int) $search_opp_status); } if ($search_opp_status == 'all') { $sql .= " AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)"; @@ -421,7 +436,7 @@ if ($search_opp_status) { } } if ($search_public != '') { - $sql .= " AND p.public = ".$db->escape($search_public); + $sql .= " AND p.public = ".((int) $search_public); } // For external user, no check is done on company permission because readability is managed by public status of project and assignement. //if ($socid > 0) $sql.= " AND s.rowid = ".((int) $socid); @@ -717,6 +732,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + print '
    '; print ''."\n"; @@ -859,6 +875,11 @@ if (!empty($arrayfields['p.tms']['checked'])) { print ''; } +if (!empty($arrayfields['p.email_msgid']['checked'])) { + // Email msg id + print ''; +} if (!empty($arrayfields['p.fk_statut']['checked'])) { print ''; @@ -1009,7 +1041,7 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['s.nom']['checked'])) { print ''; + if (!$i) $totalarray['nbfield']++; + } // Status if (!empty($arrayfields['p.fk_statut']['checked'])) { print ''; diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 8b65156570a..9fee6615c40 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -46,6 +46,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob // Security check $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +$hookmanager->initHooks(array('projetnote')); $result = restrictedArea($user, 'projet', $id, 'projet&project'); $permissionnote = $user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php @@ -55,7 +56,13 @@ $permissionnote = $user->rights->projet->creer; // Used by the include of action * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 6b1b0eac4c1..afd86f3ed07 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Laurent Destailleur + * Copyright (C) 2015-2021 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,8 +45,7 @@ if ($user->socid > 0) { } $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -283,7 +282,8 @@ print '
    '; print ''; + print ''; $arrayofstatus = array(); @@ -951,6 +972,9 @@ if (!empty($arrayfields['p.datec']['checked'])) { if (!empty($arrayfields['p.tms']['checked'])) { print_liste_field_titre($arrayfields['p.tms']['label'], $_SERVER["PHP_SELF"], "p.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap '); } +if (!empty($arrayfields['p.email_msgid']['checked'])) { + print_liste_field_titre($arrayfields['p.email_msgid']['label'], $_SERVER["PHP_SELF"], "p.email_msgid", "", $param, '', $sortfield, $sortorder, 'center '); +} if (!empty($arrayfields['p.fk_statut']['checked'])) { print_liste_field_titre($arrayfields['p.fk_statut']['label'], $_SERVER["PHP_SELF"], "p.fk_statut", "", $param, '', $sortfield, $sortorder, 'right '); } @@ -978,9 +1002,17 @@ while ($i < min($num, $limit)) { $userAccess = $object->restrictedProjectArea($user); // why this ? if ($userAccess >= 0) { - $socstatic->id = $obj->socid; - $socstatic->name = $obj->name; - $socstatic->email = $obj->email; + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; + $companystatic->client = $obj->client; + $companystatic->code_client = $obj->code_client; + $companystatic->email = $obj->email; + $companystatic->phone = $obj->phone; + $companystatic->address = $obj->address; + $companystatic->zip = $obj->zip; + $companystatic->town = $obj->town; + $companystatic->country_code = $obj->country_code; print '
    '; if ($obj->socid) { - print $socstatic->getNomUrl(1); + print $companystatic->getNomUrl(1); } else { print ' '; } @@ -1022,9 +1054,9 @@ while ($i < min($num, $limit)) { if (!empty($arrayfields['commercial']['checked'])) { print ''; if ($obj->socid) { - $socstatic->id = $obj->socid; - $socstatic->name = $obj->name; - $listsalesrepresentatives = $socstatic->getSalesRepresentatives($user); + $companystatic->id = $obj->socid; + $companystatic->name = $obj->name; + $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user); $nbofsalesrepresentative = count($listsalesrepresentatives); if ($nbofsalesrepresentative > 6) { // We print only number @@ -1041,7 +1073,9 @@ while ($i < min($num, $limit)) { $userstatic->entity = $val['entity']; $userstatic->photo = $val['photo']; $userstatic->login = $val['login']; - $userstatic->phone = $val['phone']; + $userstatic->office_phone = $val['office_phone']; + $userstatic->office_fax = $val['office_fax']; + $userstatic->user_mobile = $val['user_mobile']; $userstatic->job = $val['job']; $userstatic->gender = $val['gender']; print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, '', 0, 0, 12) : $userstatic->getNomUrl(-2); @@ -1282,6 +1316,13 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } } + // Email MsgID + if (!empty($arrayfields['p.email_msgid']['checked'])) { + print ''; + print $obj->email_msgid; + print ''.$object->getLibStatut(5).'
    '; print ''; // Company print ''; // User /*print ''; -print ''; +print ''; print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; -print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print '
    '.$langs->trans("ProjectCommercial").''; @@ -300,7 +300,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
    '; print ''; print '

    '; @@ -325,12 +325,12 @@ foreach ($data_all_year as $val) { print ''; print ' 0 ? '&userid='.$userid : '').'">'.$oldyear.''; - if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print '0'; - print '0'; - print '0'; - } print '0'; + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { + print '0'; + print '0'; + print '0'; + } print ''; } @@ -338,9 +338,9 @@ foreach ($data_all_year as $val) { print ' 0 ? '&userid='.$userid : '').'">'.$year.''; print ''.$val['nb'].''; if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { - print ''.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').''; - print ''.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').''; - print ''.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').''; + print ''.($val['total'] ? price(price2num($val['total'], 'MT'), 1) : '0').''; + print ''.($val['avg'] ? price(price2num($val['avg'], 'MT'), 1) : '0').''; + print ''.(isset($val['weighted']) ? price(price2num($val['weighted'], 'MT'), 1) : '0').''; } print ''; $oldyear = $year; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index df4a94b6dfd..d4b5bf89bbf 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -614,22 +614,24 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; + // Label print ''.$langs->trans("Label").''; print ''; print ''; - // List of projects + // Project print ''.$langs->trans("ChildOfProjectTask").''; print img_picto('', 'project'); $formother->selectProjectTasks(GETPOST('task_parent'), $projectid ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500'); print ''; + // Assigned to print ''.$langs->trans("AffectedTo").''; $contactsofproject = (!empty($object->id) ? $object->getListContactId('internal') : ''); if (is_array($contactsofproject) && count($contactsofproject)) { print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300'); } else { - print $langs->trans("NoUserAssignedToTheProject"); + print ''.$langs->trans("NoUserAssignedToTheProject").''; } print ''; @@ -900,7 +902,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third } */ if (!empty($arrayfields['c.assigned']['checked'])) { - print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'right ', ''); + print_liste_field_titre($arrayfields['c.assigned']['label'], $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'center ', ''); } // Extra fields $disablesortlink = 1; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 575f949bb75..d9c49001dfc 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -324,7 +324,7 @@ if ($object->id > 0) { $param .= '&withproject=1'; } $modulepart = 'project_task'; - $permission = $user->rights->projet->creer; + $permissiontoadd = $user->rights->projet->creer; $permtoedit = $user->rights->projet->creer; $relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index e842b409eae..d053866fd62 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -39,6 +39,7 @@ $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); +$optioncss = GETPOST('optioncss', 'aZ09'); $id = GETPOST('id', 'int'); @@ -382,12 +383,9 @@ if ($search_projectstatus >= 0) { if ($search_projectstatus == 99) { $sql .= " AND p.fk_statut <> 2"; } else { - $sql .= " AND p.fk_statut = ".$db->escape($search_projectstatus); + $sql .= " AND p.fk_statut = ".((int) $search_projectstatus); } } -if ($search_public != '') { - $sql .= " AND p.public = ".$db->escape($search_public); -} if ($search_project_user > 0) { $sql .= " AND ecp.fk_c_type_contact IN (".$db->sanitize(join(',', array_keys($listofprojectcontacttype))).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user; } @@ -512,9 +510,6 @@ if ($search_projectstatus != '') { if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all', 'none'))) { $param .= '&search_opp_status='.urlencode($search_opp_status); } -if ($search_public != '') { - $param .= '&search_public='.urlencode($search_public); -} if ($search_project_user != '') { $param .= '&search_project_user='.urlencode($search_project_user); } @@ -883,8 +878,8 @@ while ($i < min($num, $limit)) { } // Label if (!empty($arrayfields['t.label']['checked'])) { - print ''; - print $object->label; + print ''; + print dol_escape_htmltag($object->label); print ''; if (!$i) { $totalarray['nbfield']++; @@ -893,7 +888,7 @@ while ($i < min($num, $limit)) { // Description if (!empty($arrayfields['t.description']['checked'])) { print ''; - print $object->description; + print dol_escape_htmltag($object->description); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 4d581afc30a..f1fc0c31524 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -44,6 +44,9 @@ $socid = 0; if (!$user->rights->projet->lire) { accessforbidden(); } + +$hookmanager->initHooks(array('projettasknote')); + //$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification $object = new Task($db); @@ -89,7 +92,13 @@ $permissionnote = ($user->rights->projet->creer || $user->rights->projet->all->c * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 531b9eb7b3a..76c74ba343c 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -45,8 +45,7 @@ if ($user->socid > 0) { } $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -171,7 +170,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

    '; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 8cac9adfd05..0947ae5da1d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -5,7 +5,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018 Frédéric France - * Copyright (C) 2019 Christophe Battarel + * Copyright (C) 2019-2021 Christophe Battarel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formintervention.class.php'; // Load translation files required by the page $langsLoad=array('projects', 'bills', 'orders'); @@ -115,7 +116,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); if (GETPOST('cancel', 'alpha')) { $action = ''; } -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_generateinvoice') { +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_generateinvoice' && $massaction != 'confirm_generateinter') { $massaction = ''; } @@ -192,10 +193,10 @@ if ($action == 'addtimespent' && $user->rights->projet->lire) { $object->timespent_duration = GETPOSTINT("timespent_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT('timespent_durationmin') ? GETPOSTINT('timespent_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) { // If hour was entered - $object->timespent_date = dol_mktime(GETPOST("timehour"), GETPOST("timemin"), 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + $object->timespent_date = dol_mktime(GETPOST("timehour", 'int'), GETPOST("timemin", 'int'), 0, GETPOST("timemonth", 'int'), GETPOST("timeday", 'int'), GETPOST("timeyear", 'int')); $object->timespent_withhour = 1; } else { - $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth"), GETPOST("timeday"), GETPOST("timeyear")); + $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timemonth", 'int'), GETPOST("timeday", 'int'), GETPOST("timeyear", 'int')); } $object->timespent_fk_user = GETPOST("userid", 'int'); $result = $object->addTimeSpent($user); @@ -261,10 +262,10 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered - $object->timespent_date = dol_mktime(GETPOST("timelinehour"), GETPOST("timelinemin"), 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); + $object->timespent_date = dol_mktime(GETPOST("timelinehour", 'int'), GETPOST("timelinemin", 'int'), 0, GETPOST("timelinemonth", 'int'), GETPOST("timelineday", 'int'), GETPOST("timelineyear", 'int')); $object->timespent_withhour = 1; } else { - $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth"), GETPOST("timelineday"), GETPOST("timelineyear")); + $object->timespent_date = dol_mktime(12, 0, 0, GETPOST("timelinemonth", 'int'), GETPOST("timelineday", 'int'), GETPOST("timelineyear", 'int')); } $object->timespent_fk_user = GETPOST("userid_line", 'int'); @@ -353,6 +354,13 @@ if ($action == 'confirm_generateinvoice') { $prodDurationHours = 1.0; if ($idprod > 0) { $tmpproduct->fetch($idprod); + + if (empty($tmpproduct->duration_value)) { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorDurationForServiceNotDefinedCantCalculateHourlyPrice"), null, 'errors'); + } + if ($tmpproduct->duration_unit == 'i') { $prodDurationHours = 1. / 60; } @@ -380,6 +388,8 @@ if ($action == 'confirm_generateinvoice') { $localtax1 = $dataforprice['localtax1']; $localtax2 = $dataforprice['localtax2']; } else { + $prodDurationHours = 1; + $pu_ht = 0; $txtva = get_default_tva($mysoc, $projectstatic->thirdparty); $localtax1 = get_default_localtax($mysoc, $projectstatic->thirdparty, 1); @@ -402,7 +412,7 @@ if ($action == 'confirm_generateinvoice') { if (!$error) { if ($generateinvoicemode == 'onelineperuser') { - $arrayoftasks = array(); + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent $object->fetchTimeSpent($value); @@ -437,22 +447,27 @@ if ($action == 'confirm_generateinvoice') { break; } } - } elseif ($generateinvoicemode == 'onelineperperiod') { - $arrayoftasks = array(); + } elseif ($generateinvoicemode == 'onelineperperiod') { // One line for each time spent line + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent $object->fetchTimeSpent($value); + // $object->id is the task id + $ftask = new Task($db); + $ftask->fetch($object->id); + + $fuser->fetch($object->timespent_fk_user); + $username = $fuser->getFullName($langs); + $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; - $arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note; + $arrayoftasks[$object->timespent_id]['note'] = $ftask->ref.' - '.$ftask->label.' - '.$username.($object->timespent_note ? ' - '.$object->timespent_note : ''); // TODO Add user name in note $arrayoftasks[$object->timespent_id]['user'] = $object->timespent_fk_user; } foreach ($arrayoftasks as $timespent_id => $value) { $userid = $value['user']; - $fuser->fetch($userid); //$pu_ht = $value['timespent'] * $fuser->thm; - $username = $fuser->getFullName($langs); // Define qty per hour $qtyhour = $value['timespent'] / 3600; @@ -465,6 +480,7 @@ if ($action == 'confirm_generateinvoice') { // Add lines $lineid = $tmpinvoice->addline($value['note'], $pu_ht, round($qtyhour / $prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0)); + //var_dump($lineid);exit; // Update lineid into line of timespent $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); @@ -476,14 +492,14 @@ if ($action == 'confirm_generateinvoice') { break; } } - } elseif ($generateinvoicemode == 'onelinepertask') { - $arrayoftasks = array(); + } elseif ($generateinvoicemode == 'onelinepertask') { // One line for each different task + $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent - $object->fetchTimeSpent($value); - // $object->id is the task id + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) + // $object->id is now the task id $arrayoftasks[$object->id]['timespent'] += $object->timespent_duration; - $arrayoftasks[$object->id]['totalvaluetodivideby3600'] += $object->timespent_duration * $object->timespent_thm; + $arrayoftasks[$object->id]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); } foreach ($arrayoftasks as $task_id => $value) { @@ -493,31 +509,56 @@ if ($action == 'confirm_generateinvoice') { $qtyhour = $value['timespent'] / 3600; $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); - // If no unit price known - if (empty($pu_ht)) { - $pu_ht = price2num($value['totalvaluetodivideby3600'] / 3600, 'MU'); + if ($idprod > 0) { + // If a product is defined, we msut use the $prodDurationHours and $pu_ht of product (already set previously). + $pu_ht_for_task = $pu_ht; + // If we want to reuse the value of timespent (so use same price than cost price) + if (!empty($conf->global->PROJECT_TIME_SPENT_INTO_INVOICE_USE_VALUE)) { + $pu_ht_for_task = price2num($value['totalvaluetodivideby3600'] / $value['timespent'], 'MU') * $prodDurationHours; + } + $pa_ht = price2num($value['totalvaluetodivideby3600'] / $value['timespent'], 'MU') * $prodDurationHours; + } else { + // If not product used, we use the hour unit for duration and unit price. + $pu_ht_for_task = 0; + // If we want to reuse the value of timespent (so use same price than cost price) + if (!empty($conf->global->PROJECT_TIME_SPENT_INTO_INVOICE_USE_VALUE)) { + $pu_ht_for_task = price2num($value['totalvaluetodivideby3600'] / $value['timespent'], 'MU'); + } + $pa_ht = price2num($value['totalvaluetodivideby3600'] / $value['timespent'], 'MU'); } // Add lines + $date_start = ''; + $date_end = ''; $lineName = $ftask->ref.' - '.$ftask->label; - $lineid = $tmpinvoice->addline($lineName, $pu_ht, round($qtyhour / $prodDurationHours, 2), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0)); - - // Update lineid into line of timespent - $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); - $sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')'; - $result = $db->query($sql); - if (!$result) { + $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtva, $localtax1, $localtax2, ($idprod > 0 ? $idprod : 0), 0, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); + if ($lineid < 0) { $error++; - setEventMessages($db->lasterror(), null, 'errors'); + setEventMessages($tmpinvoice->error, $tmpinvoice->errors, 'errors'); break; } + + if (!$error) { + // Update lineid into line of timespent + $sql = 'UPDATE '.MAIN_DB_PREFIX.'projet_task_time SET invoice_line_id = '.((int) $lineid).', invoice_id = '.((int) $tmpinvoice->id); + $sql .= ' WHERE rowid IN ('.$db->sanitize(join(',', $toselect)).')'; + $result = $db->query($sql); + if (!$result) { + $error++; + setEventMessages($db->lasterror(), null, 'errors'); + break; + } + } } } } if (!$error) { $urltoinvoice = $tmpinvoice->getNomUrl(0); - setEventMessages($langs->trans("InvoiceGeneratedFromTimeSpent", $urltoinvoice), null, 'mesgs'); + $mesg = $langs->trans("InvoiceGeneratedFromTimeSpent", '{s1}'); + $mesg = str_replace('{s1}', $urltoinvoice, $mesg); + setEventMessages($mesg, null, 'mesgs'); + //var_dump($tmpinvoice); $db->commit(); @@ -527,6 +568,81 @@ if ($action == 'confirm_generateinvoice') { } } +if ($action == 'confirm_generateinter') { + $langs->load('interventions'); + + if (!empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); + + if (!($projectstatic->thirdparty->id > 0)) { + setEventMessages($langs->trans("ThirdPartyRequiredToGenerateIntervention"), null, 'errors'); + } else { + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + + + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + $tmpinter = new Fichinter($db); + $tmptimespent = new Task($db); + $fuser = new User($db); + + $db->begin(); + $interToUse = GETPOST('interid', 'int'); + + + $tmpinter->socid = $projectstatic->thirdparty->id; + $tmpinter->date = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $tmpinter->fk_project = $projectstatic->id; + $tmpinter->description = $projectstatic->title . ( ! empty($projectstatic->description) ? '-' . $projectstatic->label : '' ); + + if ($interToUse) { + $tmpinter->fetch($interToUse); + } else { + $result = $tmpinter->create($user); + if ($result <= 0) { + $error++; + setEventMessages($tmpinter->error, $tmpinter->errors, 'errors'); + } + } + + if (!$error) { + $arrayoftasks = array(); + foreach ($toselect as $key => $value) { + // Get userid, timepent + $object->fetchTimeSpent($value); + // $object->id is the task id + $arrayoftasks[$object->timespent_id]['timespent'] = $object->timespent_duration; + $arrayoftasks[$object->timespent_id]['totalvaluetodivideby3600'] = $object->timespent_duration * $object->timespent_thm; + $arrayoftasks[$object->timespent_id]['note'] = $object->timespent_note; + $arrayoftasks[$object->timespent_id]['date'] = date('Y-m-d H:i:s', $object->timespent_datehour); + } + + foreach ($arrayoftasks as $timespent_id => $value) { + $ftask = new Task($db); + $ftask->fetch($object->id); + // Define qty per hour + $qtyhour = $value['timespent'] / 3600; + $qtyhourtext = convertSecondToTime($value['timespent'], 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); + + // Add lines + $lineid = $tmpinter->addline($user, $tmpinter->id, $ftask->label . ( ! empty($value['note']) ? ' - ' . $value['note'] : '' ), $value['date'], $value['timespent']); + } + } + + if (!$error) { + $urltointer = $tmpinter->getNomUrl(0); + $mesg = $langs->trans("InterventionGeneratedFromTimeSpent", '{s1}'); + $mesg = str_replace('{s1}', $urltointer, $mesg); + setEventMessages($mesg, null, 'mesgs'); + + //var_dump($tmpinvoice); + + $db->commit(); + } else { + $db->rollback(); + } + } +} /* * View @@ -740,12 +856,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { 'generateinvoice'=>$langs->trans("GenerateBill"), //'builddoc'=>$langs->trans("PDFMerge"), ); - //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); - if (in_array($massaction, array('presend', 'predelete', 'generateinvoice'))) { - $arrayofmassactions = array(); - } - $massactionbutton = $form->selectMassAction('', $arrayofmassactions); } + if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { + $langs->load("interventions"); + $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); + } + //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); + if (in_array($massaction, array('presend', 'predelete', 'generateinvoice', 'generateinter'))) { + $arrayofmassactions = array(); + } + $massactionbutton = $form->selectMassAction('', $arrayofmassactions); // Show section with information of task. If id of task is not defined and project id defined, then $projectidforalltimes is not empty. if (empty($projectidforalltimes)) { @@ -935,6 +1055,8 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; } elseif ($massaction == 'generateinvoice' && $user->rights->facture->lire) { print ''; + } elseif ($massaction == 'generateinter' && $user->rights->ficheinter->lire) { + print ''; } else { print ''; } @@ -951,7 +1073,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; if ($projectstatic->thirdparty->id > 0) { - print ''; + print '
    '; print ''; print ''; @@ -1017,6 +1139,36 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print ''; $massaction = ''; } + } elseif ($massaction == 'generateinter') { + // Form to convert time spent into invoice + print ''; + + if ($projectstatic->thirdparty->id > 0) { + print '
    '; print $langs->trans('DateInvoice'); @@ -969,7 +1091,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $tmparray = array( 'onelineperuser'=>'OneLinePerUser', 'onelinepertask'=>'OneLinePerTask', - 'onelineperperiod'=>'OneLinePerPeriod', + 'onelineperperiod'=>'OneLinePerTimeSpentLine', ); print $form->selectarray('generateinvoicemode', $tmparray, 'onelineperuser', 0, 0, 0, '', 1); print '
    '; + print ''; + print ''; + print ''; + print ''; + print '
    '; + print $langs->trans('InterToUse'); + print ''; + $forminter = new FormIntervention($db); + print $forminter->select_interventions($projectstatic->thirdparty->id, '', 'interid', 24, $langs->trans('NewInter'), true); + print '
    '; + + print '
    '; + print '
    '; + print ' '; + print ''; + print '
    '; + print '
    '; + } else { + print '
    '.$langs->trans("ThirdPartyRequiredToGenerateIntervention").'
    '; + print '
    '; + print ''; + print '
    '; + $massaction = ''; + } } /* @@ -1034,7 +1186,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $sql .= " ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid"; if (empty($projectidforalltimes)) { - $sql .= " AND t.fk_task =".$object->id; + $sql .= " AND t.fk_task =".((int) $object->id); } else { $sql .= " AND pt.fk_projet IN (".$db->sanitize($projectidforalltimes).")"; } @@ -1315,7 +1467,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { print_liste_field_titre($arrayfields['value']['label'], $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'right '); } if (!empty($arrayfields['valuebilled']['checked'])) { - print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center '); + print_liste_field_titre($arrayfields['valuebilled']['label'], $_SERVER['PHP_SELF'], 'il.total_ht', '', $param, '', $sortfield, $sortorder, 'center ', $langs->trans("SelectLinesOfTimeSpentToInvoice")); } /* // Extra fields @@ -1343,11 +1495,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { break; } - print ''; - $date1 = $db->jdate($task_time->task_date); $date2 = $db->jdate($task_time->task_datehour); + print ''; + // Date if (!empty($arrayfields['t.task_date']['checked'])) { print ''; @@ -1383,7 +1535,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { $totalarray['nbfield']++; } } - } else { + } elseif ($action !== 'createtime') { print ''; } @@ -1401,7 +1553,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // By User if (!empty($arrayfields['author']['checked'])) { - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { if (empty($object->id)) { $object->fetch($id); @@ -1432,7 +1584,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // Note if (!empty($arrayfields['t.note']['checked'])) { - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; } else { @@ -1471,9 +1623,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // Value spent if (!empty($arrayfields['value']['checked'])) { + $langs->load("salaries"); + print ''; $value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1); + print 'thm).'">'; print price($value, 1, $langs, 1, -1, -1, $conf->currency); + print ''; print ''; if (!$i) { $totalarray['nbfield']++; @@ -1764,7 +1920,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) { // Note if (!empty($arrayfields['t.note']['checked'])) { - print ''; + print ''; if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { print ''; } else { diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index d40d75c0acf..a0e7ea817a7 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -96,9 +96,9 @@ if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) { $format = 'ical'; $type = 'event'; if (GETPOST("format", 'alpha')) { - $format = GETPOST("format", 'apha'); + $format = GETPOST("format", 'alpha'); } -if (GETPOST("type", 'apha')) { +if (GETPOST("type", 'alpha')) { $type = GETPOST("type", 'alpha'); } @@ -115,27 +115,32 @@ if (GETPOST("idfrom", 'int')) { if (GETPOST("idto", 'int')) { $filters['idto'] = GETPOST("idto", 'int'); } -if (GETPOST("project", 'apha')) { - $filters['project'] = GETPOST("project", 'apha'); +if (GETPOST("project", 'alpha')) { + $filters['project'] = GETPOST("project", 'alpha'); } -if (GETPOST("logina", 'apha')) { - $filters['logina'] = GETPOST("logina", 'apha'); +if (GETPOST("logina", 'alpha')) { + $filters['logina'] = GETPOST("logina", 'alpha'); } -if (GETPOST("logint", 'apha')) { - $filters['logint'] = GETPOST("logint", 'apha'); +if (GETPOST("logint", 'alpha')) { + $filters['logint'] = GETPOST("logint", 'alpha'); } -if (GETPOST("notactiontype", 'apha')) { - $filters['notactiontype'] = GETPOST("notactiontype", 'apha'); +if (GETPOST("notactiontype", 'alpha')) { + $filters['notactiontype'] = GETPOST("notactiontype", 'alpha'); } -if (GETPOST("actiontype", 'apha')) { - $filters['actiontype'] = GETPOST("actiontype", 'apha'); +if (GETPOST("actiontype", 'alpha')) { + $filters['actiontype'] = GETPOST("actiontype", 'alpha'); } if (GETPOST("notolderthan", 'int')) { $filters['notolderthan'] = GETPOST("notolderthan", "int"); } else { $filters['notolderthan'] = $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY; } - +if (GETPOST("module", 'alpha')) { + $filters['module'] = GETPOST("module", 'alpha'); +} +if (GETPOST("status", 'int')) { + $filters['status'] = GETPOST("status", 'int'); +} // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { $user->getrights(); @@ -201,6 +206,15 @@ foreach ($filters as $key => $value) { if ($key == 'notactiontype') { $filename .= '-notactiontype'.$value; } + if ($key == 'actiontype') { + $filename .= '-actiontype'.$value; + } + if ($key == 'module') { + $filename .= '-module'.$value; + } + if ($key == 'status') { + $filename .= '-status'.$value; + } } // Add extension if ($format == 'vcal') { @@ -212,9 +226,7 @@ if ($format == 'ical') { if ($format == 'rss') { $shortfilename .= '.rss'; $filename .= '.rss'; } - if ($shortfilename == 'dolibarrcalendar') { - $langs->load("main"); $langs->load("errors"); llxHeaderVierge(); print '
    '.$langs->trans("ErrorWrongValueForParameterX", 'format').'
    '; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index e39a332d3fb..bbb4a85aadf 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -118,7 +118,7 @@ if (empty($reshook)) { 'mailmanspip', 'notification', 'oauth', 'syslog', 'user', 'webservices', 'workflow', // Extended modules 'memcached', 'numberwords', 'zipautofillfr'); - $alwayshiddenuncheckedmodules = array('collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier', + $alwayshiddenuncheckedmodules = array('cashdesk', 'collab', 'dav', 'debugbar', 'emailcollector', 'ftp', 'hrm', 'modulebuilder', 'printing', 'webservicesclient', 'zappier', // Extended modules 'awstats', 'bittorrent', 'bootstrap', 'cabinetmed', 'cmcic', 'concatpdf', 'customfield', 'datapolicy', 'deplacement', 'dolicloud', 'filemanager', 'lightbox', 'mantis', 'monitoring', 'moretemplates', 'multicompany', 'nltechno', 'numberingpack', 'openstreetmap', 'ovh', 'phenix', 'phpsysinfo', 'pibarcode', 'postnuke', 'dynamicprices', 'receiptprinter', 'selectbank', 'skincoloreditor', 'submiteverywhere', 'survey', 'thomsonphonebook', 'topten', 'tvacerfa', 'voyage', 'webcalendar', 'webmail'); @@ -352,13 +352,13 @@ foreach ($demoprofiles as $profilearray) { if (empty($profilearray['url'])) { print '
    '; } -print "\n"; - -print dol_get_fiche_end(); - -// Save -print '
    '; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
    '; - - -print "\n"; -print "
    "; -print '
    '; - - llxFooterVierge(); $db->close(); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 02fb456f7d2..4a81084223d 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +66,7 @@ $object = new stdClass(); // For triggers $error = 0; // Security check -$id = GETPOST("id"); +$id = GETPOST("id", 'int'); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -74,6 +75,12 @@ if ($securekeyreceived != $securekeytocompare) { exit; } +// Security check +if (empty($conf->eventorganization->enabled)) { + accessforbidden('', 0, 0, 1); +} + + /* * Actions */ @@ -146,6 +153,11 @@ if ($urllogo) { print '
    '; } +if (!empty($conf->global->EVENTORGANIZATION_IMAGE_PUBLIC_INTERFACE)) { + print '
    '; + print ''; + print '
    '; +} print '


    '; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 71446b58779..f9cd88a8c38 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -130,18 +130,25 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ } print '
    '; + // Output html code for logo if ($urllogo) { print '
    '; print '
    '; - print ''; + print ''; print '
    '; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; } print '
    '; } + + if (!empty($conf->global->MEMBER_IMAGE_PUBLIC_REGISTRATION)) { + print '
    '; + print ''; + print '
    '; + } + print '
    '; print '
    '; diff --git a/htdocs/public/notice.php b/htdocs/public/notice.php index f85c628e1eb..c41bf81bea4 100644 --- a/htdocs/public/notice.php +++ b/htdocs/public/notice.php @@ -18,7 +18,7 @@ /** * \file htdocs/public/notice.php * \brief Dolibarr page to show a notice. - * Default notice is a message to say network connection is off. + * Default notice is a message to say network connection is off or show another message. * You can also call this page with URL: * /public/notice.php?lang=xx_XX&transkey=translation_key (key must be inside file main.lang, error.lang or other.lang) * /public/notice.php?transphrase=url_encoded_sentence_to_show diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index a4a2de27beb..d034db38be3 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -195,6 +195,11 @@ if ($urllogo) { } print '
    '; } +if (!empty($conf->global->PROPOSAL_IMAGE_PUBLIC_SIGN)) { + print '
    '; + print ''; + print '
    '; +} // Output introduction text $text = ''; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 5f5446ae3f1..8b6da7e0b75 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -609,7 +609,7 @@ if ($ligneamodifier < 0 && (!isset($_SESSION['nom']))) { if (isset($_SESSION['nom'])) { print ''.$_SESSION['nom']."\n"; } else { - print ''."\n"; + print ''."\n"; } print ''."\n"; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 287f9a576db..aeed346ab87 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -5,6 +5,7 @@ * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -142,6 +143,23 @@ if ($source == 'conferencesubscription') { } } } +} elseif ($source == 'boothlocation') { + // Getting the amount to pay, the invoice, finding the thirdparty + $invoiceid = GETPOST('ref'); + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($invoiceid); + if ($resultinvoice <= 0) { + setEventMessages(null, $invoice->errors, "errors"); + } else { + $amount = price2num($invoice->total_ttc); + // Finding the associated thirdparty + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty <= 0) { + setEventMessages(null, $thirdparty->errors, "errors"); + } + $object = $thirdparty; + } } @@ -254,18 +272,27 @@ $parameters = [ $reshook = $hookmanager->executeHooks('doValidatePayment', $parameters, $object, $action); // Check security token +$tmpsource = $source; +if ($tmpsource == 'membersubscription') { + $tmpsource = 'member'; +} $valid = true; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + $token = ''; + $tokenoldcompat = ''; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - if ($source && $REF) { - $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + if ($tmpsource && $REF) { + $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + if ($tmpsource != $source) { + $tokenoldcompat = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) + } } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token) { + if ($SECUREKEY != $token && (empty($tokenoldcompat) || $SECUREKEY != $tokenoldcompat)) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility } else { @@ -758,6 +785,8 @@ if ($action == 'charge' && !empty($conf->stripe->enabled)) { * View */ +$form = new Form($db); + $head = ''; if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { $head = ''."\n"; @@ -770,7 +799,7 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); // Check link validity -if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', ''))) { +if ($source && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'donation_ref', ''))) { $langs->load("errors"); dol_print_error_email('BADREFINPAYMENTFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref)); // End of page @@ -836,6 +865,11 @@ if ($urllogo) { } print '
    '; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} @@ -883,7 +917,6 @@ print ''.$langs->trans("T $found = false; $error = 0; -$var = false; $object = null; @@ -899,17 +932,17 @@ if (!$source) { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -924,8 +957,8 @@ if (!$source) { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -971,14 +1004,14 @@ if ($source == 'order') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$order->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$order->thirdparty->name.''; print ''."\n"; // Object @@ -986,8 +1019,8 @@ if ($source == 'order') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1000,11 +1033,11 @@ if ($source == 'order') { print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1019,8 +1052,8 @@ if ($source == 'order') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1095,14 +1128,14 @@ if ($source == 'invoice') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$invoice->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$invoice->thirdparty->name.''; print ''."\n"; // Object @@ -1110,8 +1143,8 @@ if ($source == 'invoice') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1124,11 +1157,11 @@ if ($source == 'invoice') { print ''."\n"; // Amount - print ''.$langs->trans("PaymentAmount"); + print ''.$langs->trans("PaymentAmount"); if (empty($amount) && empty($object->paye)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if ($object->type == $object::TYPE_CREDIT_NOTE) { print ''.$langs->trans("CreditNote").''; } elseif (empty($object->paye)) { @@ -1150,8 +1183,8 @@ if ($source == 'invoice') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1266,14 +1299,14 @@ if ($source == 'contractline') { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$contract->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$contract->thirdparty->name.''; print ''."\n"; // Object @@ -1295,8 +1328,8 @@ if ($source == 'contractline') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1325,17 +1358,17 @@ if ($source == 'contractline') { $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; } } - print ''.$label.''; - print ''.($duration ? $duration : $qty).''; + print ''.$label.''; + print ''.($duration ? $duration : $qty).''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1350,8 +1383,8 @@ if ($source == 'contractline') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1391,6 +1424,8 @@ if ($source == 'contractline') { // Payment on member subscription if ($source == 'member' || $source == 'membersubscription') { + $newsource = 'member'; + $found = true; $langs->load("members"); @@ -1427,14 +1462,14 @@ if ($source == 'member' || $source == 'membersubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Member"); - print ''; + print ''.$langs->trans("Member"); + print ''; if ($member->morphy == 'mor' && !empty($member->societe)) { print $member->societe; } else { @@ -1448,29 +1483,29 @@ if ($source == 'member' || $source == 'membersubscription') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; - print ''; + print ''.$langs->trans("Designation"); + print ''.$text; + print ''; print ''; print ''."\n"; if ($object->datefin > 0) { - print ''.$langs->trans("DateEndSubscription"); - print ''.dol_print_date($member->datefin, 'day'); + print ''.$langs->trans("DateEndSubscription"); + print ''.dol_print_date($member->datefin, 'day'); print ''."\n"; } if ($member->last_subscription_date || $member->last_subscription_amount) { // Last subscription date - print ''.$langs->trans("LastSubscriptionDate"); - print ''.dol_print_date($member->last_subscription_date, 'day'); + print ''.$langs->trans("LastSubscriptionDate"); + print ''.dol_print_date($member->last_subscription_date, 'day'); print ''."\n"; // Last subscription amount - print ''.$langs->trans("LastSubscriptionAmount"); - print ''.price($member->last_subscription_amount); + print ''.$langs->trans("LastSubscriptionAmount"); + print ''.price($member->last_subscription_amount); print ''."\n"; if (empty($amount) && !GETPOST('newamount', 'alpha')) { @@ -1479,38 +1514,48 @@ if ($source == 'member' || $source == 'membersubscription') { } if ($member->type) { - // Last member type - print ''.$langs->trans("LastMemberType"); - print ''.dol_escape_htmltag($member->type); - print "\n"; + $oldtypeid = $member->typeid; + $newtypeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); - require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; - $adht = new AdherentType($db); - // Amount by member type - $amountbytype = $adht->amountByType(1); - // Set the member type - $member->typeid = (int) (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $member->typeid); - // If we change the type of membership, we set also label of new type - $member->type = dol_getIdFromCode($db, $member->typeid, 'adherent_type', 'rowid', 'libelle'); - // Set amount for the subscription - $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; - // list member type - if ( !$action) { - $form = new Form($db); // so we can call method selectarray - print ''.$langs->trans("NewSubscription"); - print ''; - print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); + if ($oldtypeid != $newtypeid && !empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE)) { + require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; + $adht = new AdherentType($db); + // Amount by member type + $amountbytype = $adht->amountByType(1); + + // Last member type + print ''.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; - } elseif ($action == dopayment) { - print ''.$langs->trans("NewMemberType"); - print ''.dol_escape_htmltag($member->type); - print ''; + + // Set the new member type + $member->typeid = $newtypeid; + $member->type = dol_getIdFromCode($db, $newtypeid, 'adherent_type', 'rowid', 'libelle'); + + // list member type + if (!$action) { + // Set amount for the subscription + $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; + + print ''.$langs->trans("NewSubscription"); + print ''; + print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); + print "\n"; + } elseif ($action == dopayment) { + print ''.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); + print ''; + print "\n"; + } + } else { + print ''.$langs->trans("MemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; } } // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1522,7 +1567,7 @@ if ($source == 'member' || $source == 'membersubscription') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1567,8 +1612,8 @@ if ($source == 'member' || $source == 'membersubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1643,14 +1688,14 @@ if ($source == 'donation') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''; + print ''.$langs->trans("ThirdParty"); + print ''; if ($don->morphy == 'mor' && !empty($don->societe)) { print $don->societe; } else { @@ -1664,14 +1709,14 @@ if ($source == 'donation') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1683,7 +1728,7 @@ if ($source == 'donation') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1723,8 +1768,8 @@ if ($source == 'donation') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1777,32 +1822,29 @@ if ($source == 'conferencesubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Attendee"); - print ''; + print ''.$langs->trans("Attendee"); + print ''; print $thirdparty->name; print ''; print ''."\n"; // Object $text = ''.$langs->trans("PaymentConferenceAttendee").''; - if (GETPOST('desc', 'alpha')) { - $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; - } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; + print ''.$langs->trans("Amount"); + print ''; $valtoshow = $amount; print ''.price($valtoshow).''; print ''; @@ -1814,8 +1856,94 @@ if ($source == 'conferencesubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; + print ''; + print ''; + print ''."\n"; + + // Shipping address + $shipToName = $thirdparty->getFullName($langs); + $shipToStreet = $thirdparty->address; + $shipToCity = $thirdparty->town; + $shipToState = $thirdparty->state_code; + $shipToCountryCode = $thirdparty->country_code; + $shipToZip = $thirdparty->zip; + $shipToStreet2 = ''; + $phoneNum = $thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) { + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + print ''."\n"; + print ''."\n"; + $labeldesc = $langs->trans("PaymentSubscription"); + if (GETPOST('desc', 'alpha')) { + $labeldesc = GETPOST('desc', 'alpha'); + } + print ''."\n"; +} + +if ($source == 'boothlocation') { + $found = true; + $langs->load("members"); + + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'BOO='.GETPOST("booth").'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { + $tag = $TAG; $fulltag .= '.TAG='.$TAG; + } + } + $fulltag = dol_string_unaccent($fulltag); + + // Creditor + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; + print ''; + print ''."\n"; + + // Debitor + print ''.$langs->trans("Attendee"); + print ''; + print $thirdparty->name; + print ''; + print ''."\n"; + + // Object + $text = ''.$langs->trans("PaymentBoothLocation").''; + print ''.$langs->trans("Designation"); + print ''.$text; + print ''; + print ''; + print ''."\n"; + + // Amount + print ''.$langs->trans("Amount"); + print ''; + $valtoshow = $amount; + print ''.price($valtoshow).''; + print ''; + print ''; + + // Currency + print ' '.$langs->trans("Currency".$currency).''; + print ''; + print ''."\n"; + + // Tag + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 6b4b28f66fe..6894e6a18c8 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -266,6 +266,11 @@ if ($urllogo) { } print '
    '; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} print '

    '; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index de9deb7d249..5a7340bbe34 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Maxime Demarest + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +53,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; if (!empty($conf->paypal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; @@ -224,6 +226,11 @@ if ($urllogo) { } print ''; } +if (!empty($conf->global->MAIN_IMAGE_PUBLIC_PAYMENT)) { + print '
    '; + print ''; + print '
    '; +} print '


    '; @@ -806,6 +813,111 @@ if ($ispaymentok) { $postactionmessages[] = 'Invoice paid '.$tmptag['INV'].' was not found'; $ispostactionok = -1; } + } elseif (array_key_exists('ORD', $tmptag) && $tmptag['ORD'] > 0) { + include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; + $object = new Commande($db); + $result = $object->fetch($tmptag['ORD']); + if ($result) { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + if (empty($paymentTypeId)) { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) $paymentType = 'CB'; + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) + if (!empty($conf->facture->enabled)) { + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0 ) { + include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $result = $invoice->createFromOrder($object, $user); + if ($result > 0) { + $object->classifyBilled($user); + $invoice->validate($user); + // Creation of payment line + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment ' . dol_print_date($now, 'standard') . ' from ' . $ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = ''; + + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Payment created'; + $ispostactionok = 1; + } + } + + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + elseif ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error . ' ' . join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module ' . $paymentmethod . ' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } else { + $postactionmessages[] = 'Failed to create invoice form order ' . $tmptag['ORD'] . '.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" (' . $FinalPaymentAmt . ') or "payment type" (' . $paymentType . ') to record the payment of order ' . $tmptag['ORD'] . '. May be payment was already recorded.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Invoice module is not enable'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Order paid ' . $tmptag['ORD'] . ' was not found'; + $ispostactionok = -1; + } } elseif (array_key_exists('DON', $tmptag) && $tmptag['DON'] > 0) { include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; $don = new Don($db); @@ -916,7 +1028,7 @@ if ($ispaymentok) { // TODO send email with acknowledgment for the donation // (need that the donation module can gen a pdf document for the cerfa with pre filled content) } elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) { - // Record payment + // Record payment for attendee include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); $result = $object->fetch($ref); @@ -1024,52 +1136,58 @@ if ($ispaymentok) { if ($resultattendee < 0) { setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - $attendeetovalidate->setStatut(1); + $attendeetovalidate->amount=$FinalPaymentAmt; + $attendeetovalidate->update($user); + $attendeetovalidate->validate($user); // Sending mail $thirdparty = new Societe($db); - $thirdparty->fetch($attendeetovalidate->fk_soc); - - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); + if ($resultthirdparty < 0) { + setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $attendeetovalidate->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } } } } else { @@ -1085,7 +1203,192 @@ if ($ispaymentok) { $ispostactionok = -1; } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { - // @todo BOOTH CASE (to copy and adapt from above) + // Record payment for booth or conference + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $object = new Facture($db); + $result = $object->fetch($ref); + if ($result) { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { + $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + } + if (empty($paymentTypeId)) { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) { + $paymentType = 'CB'; + } + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { + $resultvalidate = $object->validate($user); + if ($resultvalidate < 0) { + $postactionmessages[] = 'Cannot validate invoice'; + $ispostactionok = -1; + $error++; // Not yet supported + } else { + $db->begin(); + + // Creation of payment line + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = $service; + + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error.' '.join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Payment created'; + $ispostactionok = 1; + } + } + + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') { + $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'paypal') { + $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'stripe') { + $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + } + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) { + $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + } + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error.' '.join("
    \n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + // Putting the booth to "suggested" state + $booth = new ConferenceOrBooth($db); + $resultbooth = $booth->fetch($tmptag['BOO']); + if ($resultbooth < 0) { + $error++; + setEventMessages(null, $booth->errors, "errors"); + } else { + $booth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $resultboothupdate = $booth->update($user); + if ($resultboothupdate<0) { + // Finding the thirdparty by getting the invoice + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($ref); + if ($resultinvoice<0) { + $postactionmessages[] = 'Could not find the associated invoice.'; + $ispostactionok = -1; + $error++; + } else { + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty<0) { + $error++; + setEventMessages(null, $thirdparty->errors, "errors"); + } else { + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } + } else { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['ATT'].'. May be payment was already recorded.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Invoice paid '.$tmptag['ATT'].' was not found'; + $ispostactionok = -1; + } } else { // Nothing done } @@ -1107,6 +1410,12 @@ if ($ispaymentok) { $error++; } // End call triggers + } elseif (get_class($object) == 'stdClass') { + //In some case $object is not instanciate (for paiement on custom object) We need to deal with payment + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $result = $paiement->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); + if ($result < 0) $error++; } print $langs->trans("YourPaymentHasBeenRecorded")."
    \n"; diff --git a/htdocs/public/project/index.html b/htdocs/public/project/index.html deleted file mode 100644 index 8b137891791..00000000000 --- a/htdocs/public/project/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..70e546cdbd9 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,10 +1,5 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,7 +67,7 @@ $hookmanager->initHooks(array('newpayment')); global $dolibarr_main_instance_unique_id; // Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data +$langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data // Security check // No check on module enabled. Done later according to $validpaymentmethod @@ -99,10 +94,33 @@ if ($resultproject < 0) { $errmsg .= $project->error; } +// Security check +if (empty($conf->projet->enabled)) { + accessforbidden('', 0, 0, 1); +} + + /* * Actions */ +if (GETPOST('suggestbooth')) { + header("Location: ".dol_buildpath('/public/project/suggestbooth.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('suggestconference')) { + header("Location: ".dol_buildpath('/public/project/suggestconference.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('viewandvote')) { + header("Location: ".dol_buildpath('/public/project/viewandvote.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + + + /* * View @@ -117,17 +135,7 @@ $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; -llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); - - -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); print ''."\n"; print '
    '."\n"; @@ -135,8 +143,9 @@ print '
    '."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; -print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; print ''; print ''; print "\n"; @@ -177,6 +186,12 @@ if ($urllogo) { print '
    '; } +if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) { + print '
    '; + print ''; + print '
    '; +} + print ''."\n"; $text = ''."\n"; @@ -200,15 +215,16 @@ print "\n"; // Show all action buttons print '
    '; // Output introduction text -if ($project->accept_conference_suggestions) { - print ''; +if ($project->accept_booth_suggestions) { + print ''; print '

    '; } -print ''; -print '

    '; -if ($project->accept_booth_suggestions) { - print ''; +if ($project->accept_conference_suggestions) { + print ''; + print '

    '; } +print ''; + diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 048df9c41b3..ca7101a3679 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -60,18 +60,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; // Init vars $errmsg = ''; -$num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); // Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other")); - -// Security check -if (empty($conf->projet->enabled)) { - accessforbidden('', 0, 0, 1); -} +$langs->loadLangs(array("members", "companies", "install", "other")); if (empty($conf->global->PROJECT_ENABLE_PUBLIC)) { print $langs->trans("Form for public lead registration has not been enabled"); @@ -87,6 +81,11 @@ $object = new Project($db); $user->loadDefaultValues(); +// Security check +if (empty($conf->projet->enabled)) { + accessforbidden('', 0, 0, 1); +} + /** * Show header for new member @@ -119,6 +118,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ } print '
    '; + // Output html code for logo if ($urllogo) { print '
    '; @@ -131,6 +131,13 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ } print '
    '; } + + if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_ORGANIZEDEVENT)) { + print '
    '; + print ''; + print '
    '; + } + print '
    '; print '
    '; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php new file mode 100644 index 00000000000..c695ea9cec1 --- /dev/null +++ b/htdocs/public/project/suggestbooth.php @@ -0,0 +1,679 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int')); +$dateend = dol_mktime(23, 59, 59, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int')); +$id = GETPOST('id'); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); + +// Security check +if (empty($conf->eventorganization->enabled)) { + accessforbidden('', 0, 0, 1); +} + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
    '; + + // Output html code for logo + if ($urllogo) { + print '
    '; + print '
    '; + print ''; + print '
    '; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
    '; + } + + if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH)) { + print '
    '; + print ''; + print '
    '; + } + + print '
    '; + + print '
    '; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
    '; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ + +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $project, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
    \n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
    \n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
    \n"; + } + if (empty($datestart)) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
    \n"; + } elseif ($datestart < $project->date_start) { + $error++; + $errmsg .= $langs->trans("DateMustBeAfterThan", $langs->transnoentitiesnoconv("DateStart"), dol_print_date($project->date_start))."
    \n"; + } + if (empty($dateend)) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
    \n"; + } elseif ($dateend > dol_mktime(23, 59, 59, dol_print_date($project->date_end, '%m'), dol_print_date($project->date_end, '%d'), dol_print_date($project->date_end, '%Y'))) { + $error++; + $errmsg .= $langs->trans("DateMustBeBeforeThan", $langs->transnoentitiesnoconv("DateEnd"), dol_print_date($project->date_end))."
    \n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
    \n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
    \n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
    \n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
    \n"; + } + if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
    \n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep = $datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // Adding the contact to the project + $resultaddcontact = $conforbooth->add_contact($contact->id, 'RESPONSIBLE'); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (!empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + $facture->fk_project = $project->id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $db->commit(); + $facture->add_object_linked($conforbooth->element, $conforbooth->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + /*if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + }*/ + } + } else { + // If no price has been set for the booth, we confirm it as suggested and we update + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; + $conforbooth->update($user); + } + } + } + } + } + if (!$error) { + $db->commit(); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
    '; +print '
    '; +print '
    '; + +// Welcome message +$text = '

    '; +$text .= ''."\n"; +$text .= ''."\n";; +print $text; +print ''; + +dol_htmloutput_errors($errmsg); + +// Print form +print ''."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
    '; + +print '
    '.$langs->trans("FieldsWithAreMandatory", '*').'
    '; +//print $langs->trans("FieldsWithIsForPublic",'**').'
    '; + +print dol_get_fiche_head(''); + +print ''; + +print '

    '.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
    '.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
    '.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

    '.$project->note_public.'
    '."\n"; + +// Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + +print "
    lastname).'" autofocus="autofocus">
    '.$langs->trans("Email").'*
    '.$langs->trans("Company").'*'; +print '
    '.$langs->trans("Address").''."\n"; +print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
    '.$langs->trans('Country'); +print '*'; + +print ''; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
    '.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("LabelOfBooth").'*
    '.$langs->trans("Description").'*
    '.$langs->trans("DateStart").'*'; +if (!empty($project->date_start)) { + print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')'; +} +print ''; +print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart'); +print '
    '.$langs->trans("DateEnd").'*'; +if (!empty($project->date_end)) { + print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')'; +} +print ''; +print $form->selectDate(empty($dateend)?$project->date_end:$dateend, 'dateend'); +print '
    \n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
    '; +print '
    '; +print ''; +print '
    '; +print '

    '; + + + +print "\n"; +print "
    "; +print '
    '; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php new file mode 100644 index 00000000000..399969bc80d --- /dev/null +++ b/htdocs/public/project/suggestconference.php @@ -0,0 +1,600 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); + +$id = GETPOST('id'); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); + +// Security check +if (empty($conf->eventorganization->enabled)) { + accessforbidden('', 0, 0, 1); +} + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
    '; + + // Output html code for logo + if ($urllogo) { + print '
    '; + print '
    '; + print ''; + print '
    '; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
    '; + } + + if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_CONFERENCE)) { + print '
    '; + print ''; + print '
    '; + } + + print '
    '; + + print '
    '; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
    '; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ + +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $project, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
    \n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
    \n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
    \n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
    \n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
    \n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
    \n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
    \n"; + } + if (!GETPOST("firstname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
    \n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
    \n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
    \n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $conforbooth->firstname = $contact->firstname; + $conforbooth->lastname = $contact->lastname; + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // Adding the contact to the project + $resultaddcontact = $conforbooth->add_contact($contact->id, 'SPEAKER'); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; + $conforbooth->update($user); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + if (!$error) { + $db->commit(); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
    '; +print '
    '; +print '
    '; + +// Welcome message +$text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
    '; +$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

    '."\n"; +$text .= ''.$project->note_public.''."\n";; +print $text; +print '
    '; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
    '."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
    '; + +print '
    '.$langs->trans("FieldsWithAreMandatory", '*').'
    '; +//print $langs->trans("FieldsWithIsForPublic",'**').'
    '; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Last Name +print ''; +print ''; +print ''; +// First Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; + + +print "
    lastname).'" autofocus="autofocus">
    firstname).'" autofocus="autofocus">
    '.$langs->trans("Email").'*
    '.$langs->trans("Company").'*'; +print '
    '.$langs->trans("Address").''."\n"; +print '
    '.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
    '.$langs->trans('Country').''; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
    '.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
    '.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
    '.$langs->trans("LabelOfconference").'*
    '.$langs->trans("Description").'*
    '.$langs->trans("DateStart").'
    '.$langs->trans("DateEnd").'
    \n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
    '; +print '
    '; +print ''; +print '

    '; + + + + +print "\n"; +print "
    "; +print '
    '; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php new file mode 100644 index 00000000000..e78176a5f56 --- /dev/null +++ b/htdocs/public/project/viewandvote.php @@ -0,0 +1,298 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/payment/newpayment.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr object + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; +// Hook to be used by external payment modules (ie Payzen, ...) +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('newpayment')); + +// For encryption +global $dolibarr_main_instance_unique_id, $dolibarr_main_url_root; + +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data + +// Security check +// No check on module enabled. Done later according to $validpaymentmethod + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id'); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +$listofvotes = explode(',', $_SESSION["savevotes"]); + + +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +if (empty($conf->eventorganization->enabled)) { + accessforbidden('', 0, 0, 1); +} + + +/* + * Actions + */ + +$tmpthirdparty = new Societe($db); + +$listOfConferences = $listOfBooths = ''.$langs->trans('Label').' + '.$langs->trans('Type').' + '.$langs->trans('DateStart').' + '.$langs->trans('DateEnd').' + '.$langs->trans('Thirdparty').' + '.$langs->trans('Note').''; + +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle + FROM ".MAIN_DB_PREFIX."actioncomm as a + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) + WHERE a.status<2"; + +$sqlforconf = $sql." AND ca.module='conference@eventorganization'"; +$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; + +// For conferences +$result = $db->query($sqlforconf); +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + } else { + $thirdpartyname = ''; + } + + $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfConferences .= ''; + $i++; +} + +// For booths +$result = $db->query($sqlforbooth); +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + } else { + $thirdpartyname = ''; + } + + $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfBooths .= ''; + $i++; +} + +// Get vote result +$idvote = GETPOST("vote"); +$hashedvote = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'vote'.$idvote); + +if (strlen($idvote)) { + if (in_array($hashedvote, $listofvotes)) { + // Has already voted + $votestatus = 'ko'; + } else { + // Has not already voted + $conforbooth = new ActionComm($db); + $resultconforbooth = $conforbooth->fetch($idvote); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // Process to vote + $conforbooth->num_vote++; + $resupdate = $conforbooth->update($user); + if ($resupdate) { + $votestatus = 'ok'; + $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter + } else { + //Error during update + $votestatus = 'err'; + } + } + } + if ($votestatus=="ok") { + setEventMessage($langs->trans("VoteOk"), 'mesgs'); + } elseif ($votestatus=="ko") { + setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); + } elseif ($votestatus=="err") { + setEventMessage($langs->trans("VoteError"), 'warnings'); + } + header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); + exit; +} + + +/* + * View + */ + +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} + +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
    ' : '').'
    '; +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); + +print ''."\n"; +print '
    '."\n"; +print '
    '."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''; +print "\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
    '; + print '
    '; + print ''; + print '
    '; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
    '; +} + +if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH)) { + print '
    '; + print ''; + print '
    '; +} + +print ''."\n"; +$text = ''."\n"; +$text .= ''."\n"; +$text .= ''."\n";; +print $text; +print '

    '.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
    '.$langs->trans("EvntOrgVoteHelpMessage").' : "'.$project->title.'".

    '.$project->note_public.'
    '."\n"; + +print dol_get_fiche_head(''); + +print ''."\n"; +print ''; +print $listOfConferences.'
    '; +print '
    '.$langs->trans("ListOfSuggestedConferences").'
    '."\n"; + +print '
    '; + +print ''."\n"; +print ''; +print $listOfBooths.'
    '; +print '
    '.$langs->trans("ListOfSuggestedBooths").'
    '."\n"; + +$object = null; + +htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); + +llxFooter('', 'public'); + +$db->close(); diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 7d4ec0223f1..f3d84ec996f 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -55,7 +55,10 @@ $email = GETPOST('email', 'alpha'); $object = new RecruitmentJobPosition($db); - +// Security check +if (empty($conf->recruitment->enabled)) { + accessforbidden('', 0, 0, 1); +} /* diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 27aaa0fd0f4..cd275d250c4 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -39,6 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class. require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "other", "recruitment")); @@ -74,6 +75,11 @@ if (!$action) { //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. +// Security check +if (empty($conf->recruitment->enabled)) { + accessforbidden('', 0, 0, 1); +} + /* * Actions @@ -184,7 +190,7 @@ print ''."\n"; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; @@ -222,6 +228,12 @@ if ($urllogo) { print ''; } +if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) { + print '
    '; + print ''; + print '
    '; +} + // Output introduction text $text = ''; if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) { diff --git a/htdocs/public/test/badges.php b/htdocs/public/test/badges.php index fd0add00af1..2190b96db7e 100644 --- a/htdocs/public/test/badges.php +++ b/htdocs/public/test/badges.php @@ -20,7 +20,9 @@ if (!defined('NOREQUIREAJAX')) { if (!defined('NOSESSION')) { define('NOSESSION', '1'); } - +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} session_cache_limiter('public'); require_once '../../main.inc.php'; @@ -30,19 +32,9 @@ if ($dolibarr_main_prod) { accessforbidden(); } + +llxHeader('', 'Documentation and examples for theme'); ?> - - - - - - - - - - - -

    Badges

    Documentation and examples for badges, our small count and labeling component.

    @@ -342,5 +334,4 @@ if ($dolibarr_main_prod) {
    - - \ No newline at end of file + +
    +

    Button for action

    +

    Documentation and examples for buttons.

    + +

    Example of simple usage

    + +

    Buttons for user allowed to click.

    + +
    + My default action'; + $actionType = 'default'; + $n++; + $id = 'mybuttonid'.$n; + $url = '#'.$id; + $userRight = 1; + $params = array(); + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + + $html = ' My delete action'; + $actionType = 'delete'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + + $html = ' My danger action'; + $actionType = 'danger'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + ?> +
    + +

    Buttons for user NOT allowed to click.

    + +
    + My default action'; + $actionType = 'default'; + $n++; + $id = 'mybuttonid'.$n; + $url = '#'.$id; + $userRight = 0; + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + + $html = ' My delete action'; + $actionType = 'delete'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + + $html = ' My danger action'; + $actionType = 'danger'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight); + + ?> +
    + + +

    Example of confirm dialog

    + +

    Buttons for user allowed to click.

    + +
    + My default action'; + $actionType = 'default'; + $n++; + $id = 'mybuttonid'.$n; + $url = '#'.$id; + $userRight = 1; + $params = array( + 'confirm' => true + ); + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); + + + $html = ' My delete action'; + $actionType = 'delete'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + + $params = array( + 'confirm' => array( + 'url' => 'your confirm action url', + 'title' => 'Your title to display', + 'action-btn-label' => 'Your confirm label', + 'cancel-btn-label' => 'Your cancel label', + 'content' => 'Content to display with HTML compatible
    • test 01
    • test 02
    • test 03
    ' + ) + ); + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); + + ?> +
    + +

    Buttons for user NOT allowed to click.

    + +
    + My default action'; + $actionType = 'default'; + $n++; + $id = 'mybuttonid'.$n; + $url = '#'.$id; + $userRight = 0; + $params = array( + 'confirm' => true + ); + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); + + + $html = ' My delete action'; + $actionType = 'delete'; + $n++; + $id = 'mybuttonid'.$n; + $url = $_SERVER['PHP_SELF'] . '?token='.newToken().'#'.$id; + + $params = array( + 'confirm' => array( + 'url' => 'your confirm action url', + 'title' => 'Your title to display', + 'action-btn-label' => 'Your confirm label', + 'cancel-btn-label' => 'Your cancel label', + 'content' => 'Content to display with HTML compatible
    • test 01
    • test 02
    • test 03
    ' + ) + ); + + print dolGetButtonAction($label, $html, $actionType, $url, $id, $userRight, $params); + + ?> +
    + + +
    + +global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; + $from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>'; $replyto = $from; $sendtocc = ''; $deliveryreceipt = 0; @@ -298,7 +298,6 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) { } $message_admin .= ''; - $message_admin .= ''; $message_admin .= '

    '.$langs->trans('Message').' :
    '.$object->message.'

    '; $message_admin .= '

    '.$langs->trans('SeeThisTicketIntomanagementInterface').'

    '; @@ -390,7 +389,7 @@ if ($action != "infos_success") { print '
    '; print $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'
    '; print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket")); - print '
    '; + print '
    '; } else { print '
    '.$langs->trans('TicketPublicInfoCreateTicket').'
    '; $formticket->showForm(0, 'edit', 1); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 1e1eb08dd5e..3c5dfffba17 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -561,14 +561,19 @@ if ($action == "view_ticketlist") { // Ref if (!empty($arrayfields['t.ref']['checked'])) { print '
    '; } // Subject if (!empty($arrayfields['t.subject']['checked'])) { print ''; } @@ -602,13 +607,14 @@ if ($action == "view_ticketlist") { // Message author if (!empty($arrayfields['t.fk_user_create']['checked'])) { - print ''; @@ -617,10 +623,11 @@ if ($action == "view_ticketlist") { // Assigned author if (!empty($arrayfields['t.fk_user_assign']['checked'])) { print ''; diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 2f70ded9914..6485f9fcee2 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -234,6 +234,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Ref print ''; @@ -244,7 +245,9 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Subject print ''; // Statut @@ -259,7 +262,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a // Category print ''; // Severity @@ -278,8 +284,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->dao->fk_user_create); + print img_picto('', 'user', 'class="pictofixedwidth"'); print $fuser->getFullName($langs); } else { + print img_picto('', 'email', 'class="pictofixedwidth"'); print dol_escape_htmltag($object->dao->origin_email); } @@ -304,6 +312,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($object->dao->fk_user_assign > 0) { $fuser = new User($db); $fuser->fetch($object->dao->fk_user_assign); + print img_picto('', 'user', 'class="pictofixedwidth"'); print $fuser->getFullName($langs, 1); } print ''; @@ -320,7 +329,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print '
    '; if ($action == 'presend') { - print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticket'); + print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'conversation'); $formticket = new FormTicket($db); @@ -364,7 +373,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a } // Message list - print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'object_conversation'); + print load_fiche_titre($langs->trans('TicketMessagesList'), '', 'conversation'); $object->viewTicketMessages(false, true, $object->dao); } else { print ''; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 75f5401d401..c9a638e7cde 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -72,7 +72,7 @@ if (!empty($conf->productbatch->enabled)) { } $origin = GETPOST('origin', 'alpha') ?GETPOST('origin', 'alpha') : 'reception'; // Example: commande, propal -$origin_id = GETPOST('id', 'int') ?GETPOST('id', 'int') : ''; +$origin_id = GETPOST('id', 'int') ? GETPOST('id', 'int') : ''; $id = $origin_id; if (empty($origin_id)) { $origin_id = GETPOST('origin_id', 'int'); // Id of order or propal @@ -86,12 +86,12 @@ if (empty($origin_id)) { $ref = GETPOST('ref', 'alpha'); $line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : ''; -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); //Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); //PDF @@ -117,7 +117,6 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); -$object = new Reception($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); @@ -725,13 +724,13 @@ if ($action == 'create') { $classname = ucfirst($origin); } - $object = new $classname($db); - if ($object->fetch($origin_id)) { // This include the fetch_lines + $objectsrc = new $classname($db); + if ($objectsrc->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); - $soc->fetch($object->socid); + $soc->fetch($objectsrc->socid); $author = new User($db); - $author->fetch($object->user_author_id); + $author->fetch($objectsrc->user_author_id); if (!empty($conf->stock->enabled)) { $entrepot = new Entrepot($db); @@ -741,8 +740,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; + print ''; if (GETPOST('entrepot_id', 'int')) { print ''; } @@ -754,10 +752,10 @@ if ($action == 'create') { // Ref print ''; print "\n"; @@ -770,7 +768,7 @@ if ($action == 'create') { print $langs->trans('RefSupplier'); } print ''; print ''; @@ -782,8 +780,8 @@ if ($action == 'create') { // Project if (!empty($conf->projet->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; - if (empty($projectid) && !empty($object->fk_project)) { - $projectid = $object->fk_project; + if (empty($projectid) && !empty($objectsrc->fk_project)) { + $projectid = $objectsrc->fk_project; } if ($origin == 'project') { $projectid = ($originid ? $originid : 0); @@ -802,7 +800,7 @@ if ($action == 'create') { // Date delivery planned print ''; print '\n"; print ''; @@ -810,15 +808,15 @@ if ($action == 'create') { // Note Public print ''; print '"; // Note Private - if ($object->note_private && !$user->socid) { + if ($objectsrc->note_private && !$user->socid) { print ''; print '"; } @@ -861,15 +859,15 @@ if ($action == 'create') { // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook print $hookmanager->resPrint; - // Here $object can be of an object Order + // Here $object can be of an object Reception $extrafields->fetch_name_optionals_label($object->table_element); if (empty($reshook) && !empty($extrafields->attributes[$object->table_element]['label'])) { // copy from order - if ($object->fetch_optionals() > 0) { - $recept->array_options = array_merge($recept->array_options, $object->array_options); + if ($objectsrc->fetch_optionals() > 0) { + $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } print $object->showOptionals($extrafields, 'edit', $parameters); } @@ -877,9 +875,9 @@ if ($action == 'create') { // Incoterms if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; } @@ -898,12 +896,14 @@ if ($action == 'create') { print dol_get_fiche_end(); - // Reception lines $numAsked = 0; $dispatchLines = array(); foreach ($_POST as $key => $value) { + // If create form is coming from the button "Create Reception" of previous page + // without batch module enabled + $reg = array(); if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $numAsked++; @@ -934,6 +934,25 @@ if ($action == 'create') { $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } + + // If create form is coming from same page post was sent but an error occured + if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { + $numAsked++; + + // eat-by date dispatch + // $numline=$reg[2] + 1; // line of product + $numline = $numAsked; + $prod = 'productid'.$reg[1]; + $comment = 'comment'.$reg[1]; + $qty = 'qtyl'.$reg[1]; + $ent = 'entl'.$reg[1]; + $pu = 'pul'.$reg[1]; + $lot = 'batch'.$reg[1]; + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); + $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + } } @@ -961,7 +980,7 @@ if ($action == 'create') { print '
    '; + print ''; + print img_picto('', 'ticket', 'class="paddingrightonly"'); print $obj->ref; + print ''; print ''; - print ''.$obj->subject.''; + print ''; + print $obj->subject; + print ''; print ''; + print ''; if ($obj->fk_user_create > 0) { $user_create->firstname = (!empty($obj->user_create_firstname) ? $obj->user_create_firstname : ''); $user_create->name = (!empty($obj->user_create_lastname) ? $obj->user_create_lastname : ''); $user_create->id = (!empty($obj->fk_user_create) ? $obj->fk_user_create : ''); print $user_create->getFullName($langs); } else { + print img_picto('', 'email', 'class="paddingrightonly"'); print $langs->trans('Email'); } print ''; - if ($obj->fk_user_assig > 0) { + if ($obj->fk_user_assign > 0) { $user_assign->firstname = (!empty($obj->user_assign_firstname) ? $obj->user_assign_firstname : ''); $user_assign->lastname = (!empty($obj->user_assign_lastname) ? $obj->user_assign_lastname : ''); $user_assign->id = (!empty($obj->fk_user_assign) ? $obj->fk_user_assign : ''); + print img_picto('', 'user', 'class="paddingrightonly"'); print $user_assign->getFullName($langs); } print '
    '.$langs->trans("Ref").''; + print img_picto('', 'ticket', 'class="pictofixedwidth"'); print dol_escape_htmltag($object->dao->ref); print '
    '.$langs->trans("Subject").''; + print ''; print dol_escape_htmltag($object->dao->subject); + print ''; print '
    '.$langs->trans("Category").''; - print dol_escape_htmltag($object->dao->category_label); + if ($object->dao->category_label) { + print img_picto('', 'category', 'class="pictofixedwidth"'); + print dol_escape_htmltag($object->dao->category_label); + } print '
    '; if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { - print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; + print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$objectsrc->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { - print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$object->ref; + print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$objectsrc->ref; } print '
    '; - print ''; + print ''; print '
    '.$langs->trans("DateDeliveryPlanned").''; - $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "
    '.$langs->trans("NotePublic").''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', $objectsrc->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
    '.$langs->trans("NotePrivate").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', $objectsrc->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
    '; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '')); print '
    '; // Load receptions already done for same order - $object->loadReceptions(); + $objectsrc->loadReceptions(); if ($numAsked) { print ''; @@ -993,14 +1012,13 @@ if ($action == 'create') { $indiceAsked = 1; while ($indiceAsked <= $numAsked) { $product = new Product($db); - foreach ($object->lines as $supplierLine) { + foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; break; } } - // Show product and description $type = $line->product_type ? $line->product_type : $line->fk_product_type; // Try to enhance type detection using date_start and date_end for free lines where type @@ -1012,7 +1030,7 @@ if ($action == 'create') { $type = 1; } - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -1024,12 +1042,10 @@ if ($action == 'create') { print ''; @@ -1075,13 +1091,14 @@ if ($action == 'create') { // Qty print ''; $qtyProdCom = $line->qty; // Qty already received print ''; @@ -1682,10 +1699,10 @@ if ($action == 'create') { //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; - $sql .= " AND obj.fk_commande = ".$origin_id; + $sql .= " AND obj.fk_commande = ".((int) $origin_id); $sql .= " AND obj.rowid = ed.fk_commandefourndet"; $sql .= " AND ed.fk_reception = e.rowid"; - $sql .= " AND ed.fk_reception !=".$object->id; + $sql .= " AND ed.fk_reception !=".((int) $object->id); //if ($filter) $sql.= $filter; $sql .= " ORDER BY obj.fk_product"; diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 9eadc3be41a..7cb26dee0ca 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -94,7 +94,7 @@ if (!$user->rights->societe->client->voir && !$socid) { $sql .= $clause." e.fk_statut = 0"; $sql .= " AND e.entity IN (".getEntity('reception').")"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $resql = $db->query($sql); @@ -160,7 +160,7 @@ if (!$user->rights->societe->client->voir && !$socid) { } $sql .= " AND e.fk_statut = 1"; if ($socid) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } $sql .= " ORDER BY e.date_delivery DESC"; $sql .= $db->plimit($max, 0); @@ -219,7 +219,7 @@ $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('supplier_order').")"; $sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")"; if ($socid > 0) { - $sql .= " AND c.fk_soc = ".$socid; + $sql .= " AND c.fk_soc = ".((int) $socid); } if (!$user->rights->societe->client->voir && !$socid) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 7295b3df75a..a6ecd37cc6d 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -454,10 +454,10 @@ if (!$user->rights->societe->client->voir && !$socid) { // Internal user with no $sql .= " AND sc.fk_user = ".$user->id; } if ($socid) { - $sql .= " AND e.fk_soc = ".$socid; + $sql .= " AND e.fk_soc = ".((int) $socid); } if ($search_status <> '' && $search_status >= 0) { - $sql .= " AND e.fk_statut = ".$search_status; + $sql .= " AND e.fk_statut = ".((int) $search_status); } if ($search_billed != '' && $search_billed >= 0) { $sql .= ' AND e.billed = '.((int) $search_billed); diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index f343e56e14d..2c1eb55d7b3 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -67,6 +67,11 @@ $permissionnote = $user->rights->reception->creer; // Used by the include of act if ($user->socid > 0) { $socid = $user->socid; } + + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('receptionnote')); + if ($origin == 'reception') { $result = restrictedArea($user, $origin, $object->id); } else { @@ -87,7 +92,13 @@ if ($origin == 'reception') { * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index 1fe3397ef66..61098e74322 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -37,8 +37,7 @@ $socid = GETPOST('socid', 'int'); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $langs->loadLangs(array("reception", "other", "companies")); @@ -209,38 +208,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
    '; -//if (empty($socid)) -//{ - // Show filter box - print ''; - print ''; +// Show filter box +print ''; +print ''; - print '
    '; print ''; // ancre pour retourner sur la ligne + print ''; // Show product and description - $product_static->type = $line->fk_product_type; - $product_static->id = $line->fk_product; - $product_static->ref = $line->ref; - $product_static->status_batch = $line->product_tobatch; + $product_static = $product; $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); @@ -1067,7 +1083,7 @@ if ($action == 'create') { // Comment //$defaultcomment = 'Line create from order line id '.$line->id; - $defaultcomment = ''; + $defaultcomment = $dispatchLines[$indiceAsked]['comment']; print ''; print ''; print ''.$line->qty; print ''; + print ''; print ''; print ''; - $quantityDelivered = $object->receptions[$line->id]; + $quantityDelivered = $objectsrc->receptions[$line->id]; print $quantityDelivered; print ''; print '
    '; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
    '.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
    '.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
    '.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
    '.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
    '; - print ''; - print '

    '; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
    '; +print ''; +print '

    '; print ''; print ''; diff --git a/htdocs/recruitment/admin/candidature_extrafields.php b/htdocs/recruitment/admin/candidature_extrafields.php index 1f0ac538d0b..efb68e5ff2c 100644 --- a/htdocs/recruitment/admin/candidature_extrafields.php +++ b/htdocs/recruitment/admin/candidature_extrafields.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->loadLangs(array('recruitement', 'admin')); +$langs->loadLangs(array('recruitment', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/recruitment/admin/jobposition_extrafields.php b/htdocs/recruitment/admin/jobposition_extrafields.php index 3b17322d5eb..d1b0651da64 100644 --- a/htdocs/recruitment/admin/jobposition_extrafields.php +++ b/htdocs/recruitment/admin/jobposition_extrafields.php @@ -26,7 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page -$langs->loadLangs(array('recruitement', 'admin')); +$langs->loadLangs(array('recruitment', 'admin')); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 86cd99e7180..892ba4121e9 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -101,13 +101,13 @@ class RecruitmentJobPosition extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'1', 'autofocusoncreate'=>1), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'css'=>'nowraponall'), + 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1), 'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), - 'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'), + 'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), 'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail', 'picto'=>'email'), - 'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid',), + 'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), 'fk_establishment' => array('type'=>'integer:Establishment:hrm/class/establishment.class.php', 'label'=>'Establishment', 'enabled'=>'$conf->hrm->enabled', 'position'=>56, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'establishment.rowid',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'WorkPlace', 'enabled'=>'1', 'position'=>57, 'notnull'=>-1, 'visible'=>-1, 'css'=>'maxwidth500', 'index'=>1, 'help'=>"IfJobIsLocatedAtAPartner", 'picto'=>'company'), 'date_planned' => array('type'=>'date', 'label'=>'DateExpected', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,), diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index 054443a5be5..06b24ec8b65 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -3,7 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2019 Philippe Grand + * Copyright (C) 2018-2021 Philippe Grand * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -85,18 +85,18 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi $this->marge_haute = 0; $this->marge_basse = 0; - $this->option_logo = 1; // Affiche logo - $this->option_tva = 0; // Gere option tva COMMANDE_TVAOPTION - $this->option_modereg = 0; // Affiche mode reglement - $this->option_condreg = 0; // Affiche conditions reglement - $this->option_codeproduitservice = 0; // Affiche code produit-service - $this->option_multilang = 1; // Dispo en plusieurs langues - $this->option_escompte = 0; // Affiche si il y a eu escompte + $this->option_logo = 1; // Display logo + $this->option_tva = 0; // Manage the vat option COMMANDE_TVAOPTION + $this->option_modereg = 0; // Display payment mode + $this->option_condreg = 0; // Display payment terms + $this->option_codeproduitservice = 0; // Display product-service code + $this->option_multilang = 1; // Available in several languages + $this->option_escompte = 0; // Displays if there has been a discount $this->option_credit_note = 0; // Support credit notes $this->option_freetext = 1; // Support add of a personalised text $this->option_draft_watermark = 0; // Support add of a watermark on drafts - // Recupere emetteur + // Get source company $this->emetteur = $mysoc; if (!$this->emetteur->country_code) { $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined @@ -157,7 +157,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi $texte .= $conf->global->RECRUITMENT_RECRUITMENTJOBPOSITION_ADDON_PDF_ODT_PATH; $texte .= ''; $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= '
    '; // Scan directories diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index fcbbdb76930..4c6cb84783a 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ * \brief File of class to generate document from standard template */ -dol_include_once('/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php'); +require_once DOL_DOCUMENT_ROOT.'/recruitment/core/modules/recruitment/modules_recruitmentjobposition.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; @@ -130,7 +130,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio /** * @var array of document table columns */ - public $cols; + public $cols = array(); /** @@ -253,12 +253,11 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $objphoto->fetch($object->lines[$i]->fk_product); //var_dump($objphoto->ref);exit; - if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - { + if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) { $pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; $pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; } else { - $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; // default + $pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product'); // default $pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product').$objphoto->id."/photos/"; // alternative } @@ -347,7 +346,11 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio // Set path to the background PDF File if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) { - $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); + $logodir = $conf->mycompany->dir_output; + if (!empty($conf->mycompany->multidir_output[$object->entity])) { + $logodir = $conf->mycompany->multidir_output[$object->entity]; + } + $pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND); $tplidx = $pdf->importPage(1); } diff --git a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php index 311eb7e1b36..35f5616da68 100644 --- a/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php +++ b/htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php @@ -79,7 +79,7 @@ class mod_recruitmentjobposition_advanced extends ModeleNumRefRecruitmentJobPosi // Parametrage du prefix $texte .= '
    '; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 4826dc735ef..a1e98ded601 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -305,21 +305,6 @@ $title = $langs->trans("RecruitmentCandidature"); $help_url = ''; llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - // Part to create if ($action == 'create') { diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 24b9f6d4e67..2e8c29cf2fe 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -212,7 +212,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'recruitment'; - $permission = $user->rights->recruitment->recruitmentjobposition->write; + $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; $permtoedit = $user->rights->recruitment->recruitmentjobposition->write; $param = '&id='.$object->id; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 8f8ac25c577..7a5a88bc6c4 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -83,7 +83,7 @@ require_once __DIR__.'/class/recruitmentcandidature.class.php'; //dol_include_once('/othermodule/class/otherobject.class.php'); // Load translation files required by the page -$langs->loadLangs(array("recruitment@recruitment", "other")); +$langs->loadLangs(array("recruitment", "other")); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) @@ -141,7 +141,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -161,18 +161,8 @@ foreach ($object->fields as $key => $val) { } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} +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'); @@ -262,7 +252,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } if ($object->ismultientitymanaged == 1) { @@ -304,7 +294,9 @@ foreach ($object->fields as $key => $val) } // Add fields from extrafields if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); + } } // Add where from hooks $parameters=array(); @@ -356,21 +348,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; @@ -430,7 +407,7 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort $topicmail = "SendRecruitmentCandidatureRef"; $modelmail = "recruitmentcandidature"; $objecttmp = new RecruitmentCandidature($db); -$trackid = 'xxxx'.$object->id; +$trackid = 'recruitmentapplication'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($search_all) { @@ -484,11 +461,11 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } @@ -539,7 +516,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -552,6 +529,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -564,7 +542,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Show here line of result print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif ($key == 'status') { @@ -597,6 +575,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index d4c18155c5d..19808ca1b59 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -94,7 +94,13 @@ $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruit * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/recruitment/recruitmentindex.php b/htdocs/recruitment/recruitmentindex.php index 7e369fe6bb2..6e9ee616327 100644 --- a/htdocs/recruitment/recruitmentindex.php +++ b/htdocs/recruitment/recruitmentindex.php @@ -183,7 +183,7 @@ if ($conf->use_javascript_ajax) { print '
    '; print '
    '.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).'  '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print ''; } print '
    '; - print ''."\n"; + print ''."\n"; $listofstatus = array(0, 1, 3, 5, 8, 9); foreach ($listofstatus as $status) { $dataseries[] = array(dol_html_entity_decode($staticrecruitmentcandidature->LibStatut($status, 1), ENT_QUOTES | ENT_HTML5), (isset($vals[$status]) ? (int) $vals[$status] : 0)); @@ -255,7 +255,7 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->read) $sql.= " AND c.fk_statut = 0"; $sql.= " AND c.entity IN (".getEntity('commande').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql.= " AND c.fk_soc = ".$socid; + if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index e8ede6f0bdd..43d80901f3d 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -211,7 +211,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'recruitment'; - $permission = $user->rights->recruitment->recruitmentjobposition->write; + $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; $permtoedit = $user->rights->recruitment->recruitmentjobposition->write; $param = '&id='.$object->id; diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 99b2e5ade4e..3398a47dca3 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -103,8 +103,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -123,6 +124,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen // Default sort order (if not yet defined by previous GETPOST) if (!$sortfield) { + reset($object->fields); // Reset is required to avoid key() to return null. $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition. } if (!$sortorder) { @@ -141,40 +143,31 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } -// Definition of fields for list +// Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = dol_eval($val['visible'], 1); + $visible = (int) dol_eval($val['visible'], 1); $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), - 'position'=>$val['position'] + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } // Extra fields -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$object->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]) - ); - } - } -} +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + $object->fields = dol_sort_array($object->fields, 'position'); -$arrayfields['nbapplications'] = array('label'=>'Applications', 'checked'=>1, 'enabled'=>1, 'position'=>90); +$arrayfields['nbapplications'] = array('type'=>'integer', 'label'=>'Applications', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right'); $arrayfields = dol_sort_array($arrayfields, 'position'); $permissiontoread = $user->rights->recruitment->recruitmentjobposition->read; @@ -194,7 +187,8 @@ $result = restrictedArea($user, 'recruitment', 0, 'recruitment_recruitmentjobpos */ if (GETPOST('cancel', 'alpha')) { - $action = 'list'; $massaction = ''; + $action = 'list'; + $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; @@ -248,13 +242,11 @@ $title = $langs->trans('ListOfPositionsToBeFilled'); // Build and execute select // -------------------------------------------------------------------- $sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} +$sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : ''); } } // Add fields from hooks @@ -265,27 +257,45 @@ $sql = preg_replace('/,\s*$/', '', $sql); $sql .= ", COUNT(rc.rowid) as nbapplications"; $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc ON rc.fk_recruitmentjobposition = t.rowid"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; } else { $sql .= " WHERE 1 = 1"; } foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if (strpos($object->fields[$key]['type'], 'integer:') === 0) { - if ($search[$key] == '-1') { - $search[$key] = ''; + if (array_key_exists($key, $object->fields)) { + if ($key == 'status' && $search[$key] == -1) { + continue; + } + $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); + if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) { + if ($search[$key] == '-1' || $search[$key] === '0') { + $search[$key] = ''; + } + $mode_search = 2; + } + if ($search[$key] != '') { + $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { + $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { + if (preg_match('/_dtstart$/', $key)) { + $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'"; + } + if (preg_match('/_dtend$/', $key)) { + $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'"; + } + } } - $mode_search = 2; - } - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } if ($search_all) { @@ -359,21 +369,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ llxHeader('', $title, $help_url); -// Example : Adding jquery code -print ''; - $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; @@ -397,6 +392,10 @@ if ($optioncss != '') { } // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +// Add $param from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook +$param .= $hookmanager->resPrint; // List of mass actions available $arrayofmassactions = array( @@ -474,30 +473,38 @@ print '
    '.$langs->trans("Statistics").' - '.$langs->trans("Candidatures").'
    '.$langs->trans("Statistics").' - '.$langs->trans("RecruitmentCandidatures").'
    '; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; } } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + // Fields from hook $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -517,14 +524,14 @@ print ''."\n"; // -------------------------------------------------------------------- print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') { + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } if (!empty($arrayfields['t.'.$key]['checked'])) { @@ -538,7 +545,7 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$ $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['nbapplications']['checked'])) { - print ''; + print ''; } // Action column print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; @@ -547,7 +554,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -560,6 +567,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); if (empty($obj)) { @@ -585,7 +593,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status') { + if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) { $cssforfield .= ($cssforfield ? ' ' : '').'right'; } //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100'; @@ -594,6 +602,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; if ($key == 'status') { print $object->getLibStatut(5); + } elseif ($key == 'rowid') { + print $object->showOutputField($val, $key, $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } @@ -605,6 +615,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $object->$key; } } @@ -620,7 +636,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Action column print ''; } else { - print ''; + print ''; } // Default mode of payment diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index dcb50dac49a..76236bb88aa 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -168,8 +168,8 @@ class PaymentSalary extends CommonObject $sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)"; $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->datepaye)."',"; - $sql .= " ".$totalamount.","; - $sql .= " ".$this->paiementtype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.","; + $sql .= " ".price2num($totalamount).","; + $sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).","; $sql .= " 0)"; $resql = $this->db->query($sql); @@ -477,7 +477,7 @@ class PaymentSalary extends CommonObject * All payment properties must have been set first like after a call to create(). * * @param User $user Object of user making payment - * @param string $mode 'payment_sc' + * @param string $mode 'payment_salary' * @param string $label Label to use in bank record * @param int $accountid Id of bank account to do link with * @param string $emetteur_nom Name of transmitter @@ -516,8 +516,8 @@ class PaymentSalary extends CommonObject $this->datev ); - // Mise a jour fk_bank dans llx_paiement. - // On connait ainsi le paiement qui a genere l'ecriture bancaire + // Update fk_bank into llx_paiement_salary. + // so we know the payment that was used to generated the bank entry. if ($bank_line_id > 0) { $result = $this->update_fk_bank($bank_line_id); if ($result <= 0) { @@ -525,9 +525,12 @@ class PaymentSalary extends CommonObject dol_print_error($this->db); } - // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction + // Add link 'payment_salary' in bank_url between payment and bank transaction $url = ''; - if ($mode == 'payment_salary') $url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='; + if ($mode == 'payment_salary') { + $url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='; + } + if ($url) { $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode); if ($result <= 0) { @@ -536,14 +539,31 @@ class PaymentSalary extends CommonObject } } - // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment) - $linkaddedforthirdparty = array(); + // Add link 'user' in bank_url between user and bank transaction foreach ($this->amounts as $key => $value) { - if ($mode == 'payment_salary') { - $salary = new Salary($this->db); - $salary->fetch($key); - $result = $acc->add_url_line($bank_line_id, $salary->id, DOL_URL_ROOT.'/salaries/card.php?id=', '('.$salary->label.')', 'salary'); - if ($result <= 0) dol_print_error($this->db); + if (!$error) { + if ($mode == 'payment_salary') { + $salary = new Salary($this->db); + $salary->fetch($key); + $salary->fetch_user($salary->fk_user); + + $fuser = $salary->user; + + if ($fuser->id > 0) { + $result = $acc->add_url_line( + $bank_line_id, + $fuser->id, + DOL_URL_ROOT.'/user/card.php?id=', + $fuser->getFullName($langs), + 'user' + ); + } + if ($result <= 0) { + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->error); + $error++; + } + } } } } else { diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index e7f1af66e0c..cc50c57ec84 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -88,6 +88,12 @@ class Salary extends CommonObject */ public $fk_user_modif; + /** + * @var user User + */ + public $user; + + const STATUS_UNPAID = 0; const STATUS_PAID = 1; @@ -132,14 +138,13 @@ class Salary extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."salary SET"; - $sql .= " tms='".$this->db->idate(dol_now())."',"; - $sql .= " fk_user=".$this->fk_user.","; + $sql .= " fk_user=".((int) $this->fk_user).","; /*$sql .= " datep='".$this->db->idate($this->datep)."',"; $sql .= " datev='".$this->db->idate($this->datev)."',";*/ $sql .= " amount=".price2num($this->amount).","; $sql .= " fk_projet=".((int) $this->fk_project).","; - $sql .= " fk_typepayment=".$this->type_payment.","; + $sql .= " fk_typepayment=".((int) $this->type_payment).","; $sql .= " label='".$this->db->escape($this->label)."',"; $sql .= " datesp='".$this->db->idate($this->datesp)."',"; $sql .= " dateep='".$this->db->idate($this->dateep)."',"; @@ -147,7 +152,6 @@ class Salary extends CommonObject $sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").","; $sql .= " fk_user_author=".((int) $this->fk_user_author).","; $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : (int) $user->id); - $sql .= " WHERE rowid=".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); @@ -504,6 +508,9 @@ class Salary extends CommonObject if ($this->datesp && $this->dateep) { $label .= '
    '.$langs->trans('Period').': '.dol_print_date($this->datesp, 'day').' - '.dol_print_date($this->dateep, 'day'); } + if (isset($this->amount)) { + $label .= '
    '.$langs->trans('Amount').': '.price($this->amount); + } $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 4c88cefb8de..ea21b49159c 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -91,7 +91,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $form = new Form($db); -llxHeader("", $langs->trans("SalaryPayment")); +$title = $langs->trans('Salary')." - ".$langs->trans('Documents'); +$help_url = ""; +llxHeader("", $title, $help_url); if ($object->id) { $object->fetch_thirdparty(); @@ -147,7 +149,7 @@ if ($object->id) { print dol_get_fiche_end(); $modulepart = 'salaries'; - $permission = $user->rights->salaries->write; + $permissiontoadd = $user->rights->salaries->write; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index 1b81a80189f..0f94f405fa1 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -53,7 +53,9 @@ restrictedArea($user, 'salaries', $object->id, 'salary', ''); * View */ -llxHeader("", $langs->trans("SalaryPayment")); +$title = $langs->trans('Salary')." - ".$langs->trans('Info'); +$help_url = ""; +llxHeader("", $title, $help_url); $object = new Salary($db); $object->fetch($id); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 382e05e4f0d..7a8b3ebca10 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -124,7 +124,7 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) { + if (!empty($val['searchall'])) { $fieldstosearchall['t.'.$key] = $val['label']; } } @@ -140,7 +140,7 @@ foreach ($object->fields as $key => $val) { 'checked'=>(($visible < 0) ? 0 : 1), 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), 'position'=>$val['position'], - 'help'=>$val['help'] + 'help'=> isset($val['help']) ? $val['help'] : '' ); } } @@ -273,10 +273,10 @@ if ($search_account > 0) { $sql .= " AND s.fk_account=".((int) $search_account); } if ($search_status != '' && $search_status >= 0) { - $sql .= " AND s.paye = ".$db->escape($search_status); + $sql .= " AND s.paye = ".((int) $search_status); } if ($search_type_id) { - $sql .= " AND s.fk_typepayment=".$search_type_id; + $sql .= " AND s.fk_typepayment=".((int) $search_type_id); } $sql .= " GROUP BY u.rowid, u.lastname, u.firstname, u.login, u.email, u.admin, u.salary, u.fk_soc, u.statut,"; $sql .= " s.rowid, s.fk_account, s.paye, s.fk_user, s.amount, s.salary, s.label, s.datesp, s.dateep, s.fk_typepayment, s.fk_bank,"; diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index f0602e88a5c..f129e6304ab 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -28,7 +28,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +if (!empty($conf->accounting->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; +} // Load translation files required by the page $langs->loadLangs(array("compta", "salaries", "bills", "hrm")); @@ -52,8 +54,12 @@ if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST( $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortfield) $sortfield = "s.datep,s.rowid"; -if (!$sortorder) $sortorder = "DESC,DESC"; +if (!$sortfield) { + $sortfield = "s.datep,s.rowid"; +} +if (!$sortorder) { + $sortorder = "DESC,DESC"; +} // Initialize technical objects $object = new PaymentSalary($db); @@ -66,8 +72,12 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); -if (!$sortfield) $sortfield = "s.datep,s.rowid"; -if (!$sortorder) $sortorder = "DESC,DESC"; +if (!$sortfield) { + $sortfield = "s.datep,s.rowid"; +} +if (!$sortorder) { + $sortorder = "DESC,DESC"; +} $search_ref = GETPOST('search_ref', 'int'); $search_ref_salary = GETPOST('search_ref_salary', 'int'); @@ -89,7 +99,9 @@ if (!GETPOST('search_type_id', 'int')) { $filterarray = explode('-', $newfiltre); foreach ($filterarray as $val) { $part = explode(':', $val); - if ($part[0] == 's.fk_typepayment') $search_type_id = $part[1]; + if ($part[0] == 's.fk_typepayment') { + $search_type_id = $part[1]; + } } } else { $search_type_id = GETPOST('search_type_id', 'int'); @@ -107,7 +119,25 @@ foreach ($object->fields as $key => $val) { // List of fields to search into when doing a "search in all" $fieldstosearchall = array(); foreach ($object->fields as $key => $val) { - if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label']; + if (!empty($val['searchall'])) { + $fieldstosearchall['t.'.$key] = $val['label']; + } +} + +// Definition of array of fields for columns +$arrayfields = array(); +foreach ($object->fields as $key => $val) { + // If $val['visible']==0, then we never show the field + if (!empty($val['visible'])) { + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); + } } $permissiontoread = $user->rights->salaries->read; @@ -131,7 +161,9 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} if (empty($reshook)) { // Selection of new fields @@ -201,24 +233,50 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.ro $sql .= " ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = sal.fk_user"; $sql .= " AND s.entity IN (".getEntity('payment_salaries').")"; -if (empty($user->rights->salaries->readall)) $sql .= " AND s.fk_user IN (".$db->sanitize(join(',', $childids)).")"; +if (empty($user->rights->salaries->readall)) { + $sql .= " AND s.fk_user IN (".$db->sanitize(join(',', $childids)).")"; +} // Search criteria -if ($search_ref) $sql .= " AND s.rowid=".((int) $search_ref); -if ($search_ref_salary) $sql .= " AND sal.rowid=".((int) $search_ref_salary); -if ($search_user) $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); -if ($search_label) $sql .= natural_search(array('sal.label'), $search_label); -if ($search_date_start) $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'"; -if ($search_date_end) $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; -if ($search_dateep_start) $sql .= " AND sal.dateep >= '".$db->idate($search_dateep_start)."'"; -if ($search_dateep_end) $sql .= " AND sal.dateep <= '".$db->idate($search_dateep_end)."'"; -if ($search_amount) $sql .= natural_search("s.amount", $search_amount, 1); -if ($search_account > 0) $sql .= " AND b.fk_account=".((int) $search_account); -if ($search_fk_bank) $sql .= " AND s.fk_bank=".((int) $search_fk_bank); -if ($search_chq_number) $sql .= natural_search(array('s.num_payment'), $search_chq_number); +if ($search_ref) { + $sql .= " AND s.rowid=".((int) $search_ref); +} +if ($search_ref_salary) { + $sql .= " AND sal.rowid=".((int) $search_ref_salary); +} +if ($search_user) { + $sql .= natural_search(array('u.login', 'u.lastname', 'u.firstname', 'u.email'), $search_user); +} +if ($search_label) { + $sql .= natural_search(array('sal.label'), $search_label); +} +if ($search_date_start) { + $sql .= " AND s.datep >= '".$db->idate($search_date_start)."'"; +} +if ($search_date_end) { + $sql .= " AND s.datep <= '".$db->idate($search_date_end)."'"; +} +if ($search_dateep_start) { + $sql .= " AND sal.dateep >= '".$db->idate($search_dateep_start)."'"; +} +if ($search_dateep_end) { + $sql .= " AND sal.dateep <= '".$db->idate($search_dateep_end)."'"; +} +if ($search_amount) { + $sql .= natural_search("s.amount", $search_amount, 1); +} +if ($search_account > 0) { + $sql .= " AND b.fk_account=".((int) $search_account); +} +if ($search_fk_bank) { + $sql .= " AND s.fk_bank=".((int) $search_fk_bank); +} +if ($search_chq_number) { + $sql .= natural_search(array('s.num_payment'), $search_chq_number); +} if ($search_type_id > 0) { - $sql .= " AND s.fk_typepayment=".$search_type_id; + $sql .= " AND s.fk_typepayment=".((int) $search_type_id); } $sql .= $db->order($sortfield, $sortorder); @@ -236,7 +294,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { $num = $nbtotalofrecords; } else { - if ($limit) $sql .= $db->plimit($limit + 1, $offset); + if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); + } $resql = $db->query($sql); if (!$resql) { @@ -255,21 +315,51 @@ llxHeader('', $title, $help_url); $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; -if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); -if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); -if ($search_type_id) $param .= '&search_type_id='.urlencode($search_type_id); -if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); -if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); -if ($search_ref_salary) $param .= '&search_ref_salary='.urlencode($search_ref_salary); -if ($search_user) $param .= '&search_user='.urlencode($search_user); -if ($search_label) $param .= '&search_label='.urlencode($search_label); -if ($search_fk_bank) $param .= '&search_fk_bank='.urlencode($search_fk_bank); -if ($search_chq_number) $param .= '&search_chq_number='.urlencode($search_chq_number); -if ($search_account) $param .= '&search_account='.urlencode($search_account); -if ($search_date_start) $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int')); -if ($search_dateep_start) $param .= '&search_dateep_startday='.urlencode(GETPOST('search_dateep_startday', 'int')).'&search_dateep_startmonth='.urlencode(GETPOST('search_dateep_startmonth', 'int')).'&search_dateep_startyear='.urlencode(GETPOST('search_dateep_startyear', 'int')); -if ($search_date_end) $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int')); -if ($search_dateep_end) $param .= '&search_dateep_endday='.urlencode(GETPOST('search_dateep_endday', 'int')).'&search_dateep_endmonth='.urlencode(GETPOST('search_dateep_endmonth', 'int')).'&search_dateep_endyear='.urlencode(GETPOST('search_dateep_endyear', 'int')); +if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); +} +if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); +} +if ($search_type_id) { + $param .= '&search_type_id='.urlencode($search_type_id); +} +if ($optioncss != '') { + $param .= '&optioncss='.urlencode($optioncss); +} +if ($search_ref) { + $param .= '&search_ref='.urlencode($search_ref); +} +if ($search_ref_salary) { + $param .= '&search_ref_salary='.urlencode($search_ref_salary); +} +if ($search_user) { + $param .= '&search_user='.urlencode($search_user); +} +if ($search_label) { + $param .= '&search_label='.urlencode($search_label); +} +if ($search_fk_bank) { + $param .= '&search_fk_bank='.urlencode($search_fk_bank); +} +if ($search_chq_number) { + $param .= '&search_chq_number='.urlencode($search_chq_number); +} +if ($search_account) { + $param .= '&search_account='.urlencode($search_account); +} +if ($search_date_start) { + $param .= '&search_date_startday='.urlencode(GETPOST('search_date_startday', 'int')).'&search_date_startmonth='.urlencode(GETPOST('search_date_startmonth', 'int')).'&search_date_startyear='.urlencode(GETPOST('search_date_startyear', 'int')); +} +if ($search_dateep_start) { + $param .= '&search_dateep_startday='.urlencode(GETPOST('search_dateep_startday', 'int')).'&search_dateep_startmonth='.urlencode(GETPOST('search_dateep_startmonth', 'int')).'&search_dateep_startyear='.urlencode(GETPOST('search_dateep_startyear', 'int')); +} +if ($search_date_end) { + $param .= '&search_date_endday='.urlencode(GETPOST('search_date_endday', 'int')).'&search_date_endmonth='.urlencode(GETPOST('search_date_endmonth', 'int')).'&search_date_endyear='.urlencode(GETPOST('search_date_endyear', 'int')); +} +if ($search_dateep_end) { + $param .= '&search_dateep_endday='.urlencode(GETPOST('search_dateep_endday', 'int')).'&search_dateep_endmonth='.urlencode(GETPOST('search_dateep_endmonth', 'int')).'&search_dateep_endyear='.urlencode(GETPOST('search_dateep_endyear', 'int')); +} // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -279,11 +369,15 @@ $arrayofmassactions = array( //'buildsepa'=>$langs->trans("BuildSepa"), // TODO ); //if ($permissiontodelete) $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + $arrayofmassactions = array(); +} $massactionbutton = $form->selectMassAction('', $arrayofmassactions); print ''; -if ($optioncss != '') print ''; +if ($optioncss != '') { + print ''; +} print ''; print ''; print ''; @@ -292,7 +386,9 @@ print ''; print ''; $url = DOL_URL_ROOT.'/salaries/card.php?action=create'; -if (!empty($socid)) $url .= '&socid='.$socid; +if (!empty($socid)) { + $url .= '&socid='.$socid; +} $newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -411,7 +507,10 @@ print ''."\n"; $needToFetchEachLine = 0; if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) { + $needToFetchEachLine++; + } + // There is at least one compute field that use $object } } @@ -422,7 +521,10 @@ $total = 0; $totalarray = array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); - if (empty($obj)) break; // Should not happen + if (empty($obj)) { + break; + } + // Should not happen // Store properties in $object $object->setVarsFromFetchObj($obj); @@ -447,22 +549,32 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Ref print "\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print "\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Label payment print "\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date end period print '\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date payment print '\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Date value /*print '\n"; @@ -470,15 +582,21 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Employee print "\n"; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Type print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Chq number print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } // Account if (!empty($conf->banque->enabled)) { @@ -487,7 +605,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $accountlinestatic->id = $obj->fk_bank; print $accountlinestatic->getNomUrl(1); print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } } // Amount print ''; - if (!$i) $totalarray['nbfield']++; - if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + if (!$i) { + $totalarray['nbfield']++; + } + if (!$i) { + $totalarray['pos'][$totalarray['nbfield']] = 'totalttcfield'; + } $totalarray['val']['totalttcfield'] += $obj->amount; // Extra fields @@ -533,11 +661,15 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; - if (!$i) $totalarray['nbfield']++; + if (!$i) { + $totalarray['nbfield']++; + } print ''."\n"; @@ -550,8 +682,13 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } + /*$colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + }*/ + $colspan = 12; print ''; } diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1a7f2de6d39..ecc62c2a237 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -52,8 +52,7 @@ $result = restrictedArea($user, 'salaries', '', '', ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; @@ -204,7 +203,8 @@ print '
    '; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { - print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); - } elseif (strpos($val['type'], 'integer:') === 0) { - print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); - } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1); + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { + print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1); + } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print ''; + } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + print '
    '; + print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
    '; + print '
    '; + print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
    '; } print '
    '.$langs->trans("Applications").''.$langs->trans("Applications").'
    '; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($object->id, $arrayofselected)) { $selected = 1; diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index 9dbcd0e1180..dc7cdaef4ae 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -99,7 +99,13 @@ $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruit * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 4979a883d9c..91f68951842 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -200,7 +200,7 @@ class Dolresource extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_resource as ty ON ty.code=t.fk_code_type_resource"; if ($id) { - $sql .= " WHERE t.rowid = ".$this->db->escape($id); + $sql .= " WHERE t.rowid = ".((int) $id); } else { $sql .= " WHERE t.ref = '".$this->db->escape($ref)."'"; } @@ -415,7 +415,7 @@ class Dolresource extends CommonObject dol_syslog(get_class($this), LOG_DEBUG); if ($this->db->query($sql)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_resources"; - $sql .= " WHERE element_type='resource' AND resource_id =".$this->db->escape($rowid); + $sql .= " WHERE element_type='resource' AND resource_id = ".((int) $rowid); dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { @@ -831,7 +831,7 @@ class Dolresource extends CommonObject // Links beetween objects are stored in this table $sql = 'SELECT rowid, resource_id, resource_type, busy, mandatory'; $sql .= ' FROM '.MAIN_DB_PREFIX.'element_resources'; - $sql .= " WHERE element_id=".$element_id." AND element_type='".$this->db->escape($element)."'"; + $sql .= " WHERE element_id=".((int) $element_id)." AND element_type='".$this->db->escape($element)."'"; if ($resource_type) { $sql .= " AND resource_type LIKE '%".$this->db->escape($resource_type)."%'"; } diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 6f4c714fac4..fec869d5620 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -139,7 +139,7 @@ if ($object->id > 0) { print dol_get_fiche_end(); $modulepart = 'dolresource'; - $permission = $user->rights->resource->write; + $permissiontoadd = $user->rights->resource->write; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php index 07819b1d0b4..b43c9f8cb37 100644 --- a/htdocs/resource/note.php +++ b/htdocs/resource/note.php @@ -40,6 +40,9 @@ $action = GETPOST('action', 'aZ09'); if ($user->socid) { $socid = $user->socid; } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('resourcenote')); + $result = restrictedArea($user, 'resource', $id, 'resource'); $object = new DolResource($db); @@ -52,7 +55,13 @@ $permissionnote = $user->rights->resource->write; // Used by the include of acti * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once +$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} +if (empty($reshook)) { + include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once +} /* diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 8e2188123db..d3c7ba504cb 100755 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -359,7 +359,9 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries- * View */ -llxHeader("", $langs->trans("Salary")); +$title = $langs->trans('Salary')." - ".$langs->trans('Card'); +$help_url = ""; +llxHeader("", $title, $help_url); $form = new Form($db); if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); @@ -727,7 +729,7 @@ if ($id) { if ($action == 'edit') { print '
    ' . $langs->trans("Amount") . '
    ' . $langs->trans("Amount") . '' . price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency) . '
    ' . $langs->trans("Amount") . '' . price($object->amount, 0, $langs, 1, -1, -1, $conf->currency) . '
    ".$paymentsalstatic->getNomUrl(1)."".$salstatic->getNomUrl(1)."".dol_trunc($obj->label, 40)."'.dol_print_date($db->jdate($obj->dateep), 'day')."'.dol_print_date($db->jdate($obj->datep), 'day')."'.dol_print_date($db->jdate($obj->datev), 'day')."".$userstatic->getNomUrl(1)."'.$langs->trans("PaymentTypeShort".$obj->payment_code).''.$obj->num_payment.''; if ($obj->fk_bank > 0) { @@ -512,15 +632,23 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($accountstatic->id > 0) { print $accountstatic->getNomUrl(1); } - } else print ' '; + } else { + print ' '; + } print ''.price($obj->amount).''; if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; - if (in_array($object->id, $arrayofselected)) $selected = 1; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } print ''; } print '
    '.$langs->trans("NoRecordFound").'
    '; print ''; // User print ''; // Year print ''; -print ''; +print ''; print '
    '.$langs->trans("Filter").'
    '.$langs->trans("Employee").''; -print $form->select_dolusers(($userid ? $userid : -1), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers(($userid ? $userid : -1), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print '
    '.$langs->trans("Year").''; @@ -214,7 +214,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
    '; print ''; print '

    '; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index d0edd54f946..c87289da390 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -675,7 +675,7 @@ foreach ($profid as $key => $val) { print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 8789427c64b..ec59482b345 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -166,12 +166,12 @@ if ($socid > 0) { if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { print '
    '; - $param = '&socid='.$socid; + $param = '&socid='.urlencode($socid); if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.$contextpage; + $param .= '&contextpage='.urlencode($contextpage); } if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.$limit; + $param .= '&limit='.urlencode($limit); } print load_fiche_titre($langs->trans("ActionsOnCompany"), $newcardbutton, ''); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3493ccc3f00..b62c277cdf2 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -48,15 +48,19 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (!empty($conf->adherent->enabled)) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; } -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } +if (! empty($conf->eventorganization->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +} + $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (!empty($conf->adherent->enabled)) { @@ -272,6 +276,7 @@ if (empty($reshook)) { 'Ticket' => '/ticket/class/ticket.class.php', 'User' => '/user/class/user.class.php', 'Account' => '/compta/bank/class/account.class.php', + 'ConferenceOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); //First, all core objects must update their tables @@ -398,12 +403,12 @@ if (empty($reshook)) { $error++; } - if (!empty($conf->mailing->enabled) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty($conf->mailing->enabled) && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } - if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors'); } @@ -490,10 +495,22 @@ if (empty($reshook)) { $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); if (GETPOSTISSET('accountancy_code_sell')) { - $object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + + if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { + $object->accountancy_code_sell = ''; + } else { + $object->accountancy_code_sell = $accountancy_code_sell; + } } if (GETPOSTISSET('accountancy_code_buy')) { - $object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + + if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { + $object->accountancy_code_buy = ''; + } else { + $object->accountancy_code_buy = $accountancy_code_buy; + } } // Incoterms @@ -549,7 +566,7 @@ if (empty($reshook)) { } // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id') != '' ?GETPOST('country_id') : $mysoc->country_id; + $object->country_id = GETPOST('country_id', 'int') != '' ? GETPOST('country_id', 'int') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -610,7 +627,7 @@ if (empty($reshook)) { } // Logo/Photo save - $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; + $dir = $conf->societe->multidir_output[$conf->entity]."/".$object->id."/logos/"; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) { if (image_format_supported($_FILES['photo']['name'])) { @@ -852,7 +869,7 @@ if (empty($reshook)) { // Set parent company if ($action == 'set_thirdparty' && $user->rights->societe->creer) { $object->fetch($socid); - $result = $object->set_parent(GETPOST('parent_id', 'int')); + $result = $object->setParent(GETPOST('parent_id', 'int')); } // Set sales representatives @@ -861,6 +878,11 @@ if (empty($reshook)) { $result = $object->setSalesRep(GETPOST('commercial', 'array')); } + // warehouse + if ($action == 'setwarehouse' && $user->rights->societe->creer) { + $result = $object->setWarehouse(GETPOST('fk_warehouse', 'int')); + } + $id = $socid; $object->fetch($socid); @@ -892,7 +914,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formadmin = new FormAdmin($db); $formcompany = new FormCompany($db); -if (! empty($conf->accounting->enabled)) { +if (!empty($conf->accounting->enabled)) { $formaccounting = new FormAccounting($db); } @@ -1048,10 +1070,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->default_lang = GETPOST('default_lang'); if (GETPOSTISSET('accountancy_code_sell')) { - $object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + + if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { + $object->accountancy_code_sell = ''; + } else { + $object->accountancy_code_sell = $accountancy_code_sell; + } } if (GETPOSTISSET('accountancy_code_buy')) { - $object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + + if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { + $object->accountancy_code_buy = ''; + } else { + $object->accountancy_code_buy = $accountancy_code_buy; + } } $object->logo = (isset($_FILES['photo']) ?dol_sanitizeFileName($_FILES['photo']['name']) : ''); @@ -1375,6 +1409,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } if ($object->country_id) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code); } else { print $countrynotdefined; @@ -1399,7 +1434,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } print ''.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).''; - print 'browser->layout == 'phone') || empty($conf->mailing->enabled) ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ?GETPOST("contact_no_email", 'alpha') : $object->no_email), 1, false, 1).''; + print 'browser->layout == 'phone') || empty($conf->mailing->enabled) ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).''; } print ''; print ''.$form->editfieldkey('Web', 'url', '', $object, 0).''; @@ -1649,8 +1684,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, ''); print ''; - } else // For external software - { + } else { // For external software // Accountancy_code_sell print ''.$langs->trans("ProductAccountancySellCode").''; print ''; @@ -1775,10 +1809,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->webservices_key = GETPOST('webservices_key', 'san_alpha'); if (GETPOSTISSET('accountancy_code_sell')) { - $object->accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + $accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha'); + + if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') { + $object->accountancy_code_sell = ''; + } else { + $object->accountancy_code_sell = $accountancy_code_sell; + } } if (GETPOSTISSET('accountancy_code_buy')) { - $object->accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + $accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha'); + + if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') { + $object->accountancy_code_buy = ''; + } else { + $object->accountancy_code_buy = $accountancy_code_buy; + } } //Incoterms @@ -1813,7 +1859,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $sub2 = 1; } - if ($conf->use_javascript_ajax) { + if (!empty($conf->use_javascript_ajax)) { print "\n".''; } } @@ -866,7 +904,7 @@ var selectedline=0; var selectedtext=""; var placeid= 0 ? $placeid : 0); ?>; $(document).ready(function() { - var idoflineadded = ; + var idoflineadded = ; $('.posinvoiceline').click(function(){ console.log("Click done on "+this.id); @@ -992,7 +1030,7 @@ function TakeposPrinting(id){ receipt=data.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, ''); $.ajax({ type: "POST", - url: 'http://global->TAKEPOS_PRINT_SERVER; ?>:8111/print', + url: 'http://:8111/print', data: receipt }); }); @@ -1000,10 +1038,10 @@ function TakeposPrinting(id){ function TakeposConnector(id){ console.log("TakeposConnector" + id); - $.get("ajax/ajax.php?action=printinvoiceticket&term=&id="+id, function(data, status){ + $.get("/takepos/ajax/ajax.php?action=printinvoiceticket&term=&id="+id+"&token=", function(data, status) { $.ajax({ type: "POST", - url: 'global->TAKEPOS_PRINT_SERVER; ?>/printer/index.php', + url: '/printer/index.php', data: 'invoice='+data }); }); @@ -1013,7 +1051,8 @@ function DolibarrTakeposPrinting(id) { console.log("DolibarrTakeposPrinting Printing invoice ticket " + id) $.ajax({ type: "GET", - url: "" + id, + data: { token: '' }, + url: "" + id, }); } @@ -1057,9 +1096,10 @@ $( document ).ready(function() { $sql .= $db->order('datec', 'ASC'); $resql = $db->query($sql); if ($resql) { + $max_sale = 0; while ($obj = $db->fetch_object($resql)) { echo '$("#customerandsales").append(\''; - echo 'jdate($obj->datec), '%H:%M', 'tzuser'))).'" onclick="place=\\\''; + echo 'jdate($obj->datec), '%H:%M', 'tzuser')).' - '.$obj->ref).'" onclick="place=\\\''; $num_sale = str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $obj->ref)); echo $num_sale; if (str_replace("-", "", $num_sale) > $max_sale) { @@ -1140,6 +1180,23 @@ $( document ).ready(function() { }); + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "function CustomerDisplay(){"; + echo "var line1='".$CUSTOMER_DISPLAY_line1."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".$CUSTOMER_DISPLAY_line2."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; + echo "}"; +} +?> + use_javascript_ajax)) { print "\n".''."\n"; - print ''."\n"; + print ''."\n"; } -print ''."\n"; +print ''."\n"; print '
    '; print ''; if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) { @@ -1163,10 +1220,10 @@ if ($sectionwithinvoicelink && ($mobilepage == "invoice" || $mobilepage == "")) print ''; print ''; -if ($_SESSION["basiclayout"] != 1) { +if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { print ''; print ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { print '\n"; -if ($_SESSION["basiclayout"] == 1) { +if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { if ($mobilepage == "cats") { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categorie = new Categorie($db); @@ -1310,13 +1367,14 @@ if ($_SESSION["basiclayout"] == 1) { if ($placeid > 0) { //In Phone basic layout hide some content depends situation - if ($_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1 && $mobilepage != "invoice" && $action != "order") { return; } if (is_array($invoice->lines) && count($invoice->lines)) { print ''."\n"; $tmplines = array_reverse($invoice->lines); + $htmlsupplements = array(); foreach ($tmplines as $line) { if ($line->fk_parent_line != false) { $htmlsupplements[$line->fk_parent_line] .= 'fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; $htmlsupplements[$line->fk_parent_line] .= ''; @@ -1357,7 +1415,7 @@ if ($placeid > 0) { } $htmlforlines .= '" id="'.$line->id.'">'; $htmlforlines .= ''; - if ($conf->global->TAKEPOS_SHOW_HT) { + if (getDolGlobalString('TAKEPOS_SHOW_HT')) { $htmlforlines .= ''; } $htmlforlines .= ''."\n"; - $htmlforlines .= $htmlsupplements[$line->id]; + $htmlforlines .= empty($htmlsupplements[$line->id]) ? '' : empty($htmlsupplements[$line->id]); print $htmlforlines; } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index d4b6c023186..773118e670f 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -236,7 +236,10 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { window.open('sumupmerchant://pay/1.0?affiliate-key=global->TAKEPOS_SUMUP_AFFILIATE ?>&app-id=global->TAKEPOS_SUMUP_APPID ?>&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php'); var loop = window.setInterval(function () { - $.ajax('/takepos/smpcb.php?status').done(function (data) { + $.ajax({ + method: 'POST', + data: { token: '' }, + url: '/takepos/smpcb.php?status' }).done(function (data) { console.log(data); if (data === "SUCCESS") { parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () { @@ -252,6 +255,20 @@ if ($conf->global->TAKEPOS_NUMPAD == 0) { }); }, 2500); } + +global->TAKEPOS_CUSTOMER_DISPLAY)) { + echo "var line1='".$langs->trans('TotalTTC')."'.substring(0,20);"; + echo "line1=line1.padEnd(20);"; + echo "var line2='".price($invoice->total_ttc, 1, '', 1, -1, -1)."'.substring(0,20);"; + echo "line2=line2.padEnd(20);"; + echo "$.ajax({ + type: 'GET', + data: { text: line1+line2 }, + url: '".getDolGlobalString('TAKEPOS_PRINT_SERVER')."/display/index.php', + });"; +} +?>
    diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 9f98d5fbd7d..af606a65209 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -97,7 +97,8 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); function SendMail() { $.ajax({ type: "GET", - url: "" + $("#email"). val(), + data: { token: '' }, + url: "" + $("#email"). val(), }); parent.$.colorbox.close(); } diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php index dcb61499b63..58317deba15 100644 --- a/htdocs/theme/eldy/badges.inc.php +++ b/htdocs/theme/eldy/badges.inc.php @@ -258,9 +258,9 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL print $cssPrefix.".badge-status".$statusName." {\n"; print " color: ".$thisBadgeTextColor." !important;\n"; if (in_array((string) $statusName, $TBadgeBorderOnly)) { - print " border-color: ".$thisBadgeBorderColor.";\n"; + print " border-color: ".$thisBadgeBorderColor." !important;\n"; } - print " background-color: ".$thisBadgeBackgroundColor.";\n"; + print " background-color: ".$thisBadgeBackgroundColor." !important;\n"; print "}\n"; print $cssPrefix.".font-status".$statusName." {\n"; @@ -269,14 +269,14 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL print $cssPrefix.".badge-status".$statusName.".focus, ".$cssPrefix.".badge-status".$statusName.":focus {\n"; print " outline: 0;\n"; - print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).";\n"; + print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5)." !important;\n"; print "}\n"; print $cssPrefix.".badge-status".$statusName.":focus, ".$cssPrefix.".badge-status".$statusName.":hover {\n"; print " color: ".$thisBadgeTextColor." !important;\n"; //print " background-color: " . colorDarker($thisBadgeBackgroundColor, 10) . ";\n"; if (in_array((string) $statusName, $TBadgeBorderOnly)) { - print " border-color: ".colorDarker($thisBadgeBorderColor, 10).";\n"; + print " border-color: ".colorDarker($thisBadgeBorderColor, 10)." !important;\n"; } print "}\n"; } diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index 6f05daba22f..7122c252cbe 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -50,7 +50,13 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) { margin-bottom: 1.4em; }*/ div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete, -div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete { +div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete, +div.tabsAction > div.divButAction > span.butAction, +div.tabsAction > div.divButAction > span.butActionDelete, +div.tabsAction > div.divButAction > span.butActionRefused, +div.tabsAction > div.divButAction > a.butAction, +div.tabsAction > div.divButAction > a.butActionDelete, +div.tabsAction > div.divButAction > a.butActionRefused { margin-bottom: 1.4em !important; margin-right: 0px !important; } @@ -302,6 +308,23 @@ div.pagination li:first-child a.btnTitle{ } } +/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.9em; + } +} + +/* smartphone */ +@media only screen and (max-width: 767px) +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.85em; + } +} + + global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?> .butActionRefused, .butActionNewRefused, .btnTitle.refused { display: none !important; diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index e0976e0e1db..cfd5415a90c 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -392,7 +392,7 @@ a.top-menu-dropdown-link { background-repeat: no-repeat; background-size: 16px 16px; background-position: 95% center; - border-radius: 10px; + border-radius: 20px; border: 1px solid #c4c4c2 !important; transition: all 250ms ease-in-out; backface-visibility: hidden; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 3518518a5ef..0f4ac71fd54 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -209,7 +209,7 @@ input, select { margin-bottom: 1px; margin-top: 1px; } -#mainbody input.button:not(.buttongen):not(.bordertransp) { +#mainbody input.button:not(.buttongen):not(.bordertransp), #mainbody a.button:not(.buttongen):not(.bordertransp) { background: var(--butactionbg); color: #FFF !important; border-radius: 3px; @@ -348,7 +348,7 @@ a.butStatus { padding-right: 5px; background-color: transparent; color: var(--colortext) !important; - border: 2px solid var( --butactionbg); + border: 2px solid var( --butactionbg) !important; margin: 0 0.45em !important; } @@ -425,7 +425,9 @@ input.pageplusone { .colorblack { color: #000; } - +.fontsizeunset { + font-size: unset !important; +} .vmirror { transform: scale(1, -1); } @@ -633,12 +635,21 @@ th .button { .quatrevingtquinzepercent { width: 95%; } +.quatrevingtpercentminusx { + width: calc(80% - 52px); +} textarea.centpercent { width: 96%; } .small, small { font-size: 85%; } +.large { + font-size: 125%; +} +.double { + font-size: 2em; +} .h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small { font-size: 65%; @@ -728,6 +739,9 @@ textarea.centpercent { .paddingleft2 { padding-: 2px; } +.paddingleft2imp { + padding-: 2px !important; +} .paddingright { padding-: 4px; } @@ -902,8 +916,8 @@ span.fa.fa-plus-circle.paddingleft { height: 28px; vertical-align: middle; } -.divsocialnetwork:not(:first-child) { - padding-left: 20px; +.divsocialnetwork:not(:last-child) { + padding-: 20px; } div.divsearchfield { float: ; @@ -1027,6 +1041,7 @@ ul.attendees li { list-style-type: none; padding-top:1px; padding-bottom:1px; + line-height: 1.6em; } .googlerefreshcal { padding-top: 4px; @@ -1132,6 +1147,12 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.tdoverflowmax250 { /* For tdoverflow, the max-midth become a minimum ! */ + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 300px; overflow: hidden; @@ -1472,6 +1493,14 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select width: calc(100% - 40px) !important; display: inline-block; } + select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx { + width: calc(100% - 70px) !important; + display: inline-block; + } + + input.maxwidthinputfileonsmartphone { + width: 175px; + } .logopublicpayment #dolpaymentlogo { max-width: 260px; @@ -1491,6 +1520,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select input.buttonpayment, button.buttonpayment, div.buttonpayment { min-width: 270px; } + + .smallonsmartphone { + font-size: 0.8em; + } } /* Force values for small screen 570 */ @@ -1636,7 +1669,7 @@ table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tab } -.hideonprint { display: none; } +.hideonprint { display: none !important; } @@ -2616,7 +2649,7 @@ table.login_table_securitycode tr td { } div.backgroundsemitransparent { - background:rgba(255,255,255,0.68); + background:rgba(255, 255, 255, 0.7); padding-left: 10px; padding-right: 10px; } @@ -3882,7 +3915,7 @@ table.noborder.paymenttable { } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; @@ -3898,6 +3931,11 @@ table.noborder.paymenttable { box-shadow: 1px 1px 7px #CCC !important; } +.boxshadow { + -webkit-box-shadow: 0px 0px 5px #888; + box-shadow: 0px 0px 5px #888; +} + div.tabBar .noborder { -webkit-box-shadow: 0px 0px 0px #DDD !important; box-shadow: 0px 0px 0px #DDD !important; @@ -4501,6 +4539,9 @@ div#card-errors { .ui-dialog-content { } +.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable { + z-index: 1002 !important; /* Default 101 with jquery, top menu have a z-index of 1000 */ +} /* ============================================================================== */ /* For content of image preview */ @@ -4684,7 +4725,9 @@ div.visible { div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { display: none; } - +.unvisible { + visibility: hidden; +} tr.visible { display: block; } @@ -4929,8 +4972,8 @@ td.cal_other_month { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 4px !important; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 26px; } +.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } +.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } .treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } .treeview .hitarea { margin-top: 3px; } @@ -6048,6 +6091,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.maxwidthsearch .dropdown dt a span, .multiSel span { + padding: 0 3px 2px 3px; +} .dropdown span.value { display:none; } @@ -6766,10 +6812,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* For copy-paste feature */ /* ============================================================================== */ +span.clipboardCPValueToPrint { + display: inline-block; +} span.clipboardCPValue.hidewithsize { width: 0 !important; display: inline-block; color: transparent; + white-space: nowrap; } .clipboardCPShowOnHover .clipboardCPButton { @@ -6806,6 +6856,8 @@ span.clipboardCPValue.hidewithsize { border-right: none; border-left: none; } + + td.widthpictotitle { width: 30px; } } @media only screen and (max-width: 1024px) diff --git a/htdocs/theme/md/badges.inc.php b/htdocs/theme/md/badges.inc.php index fd1b1122a17..4a36177e852 100644 --- a/htdocs/theme/md/badges.inc.php +++ b/htdocs/theme/md/badges.inc.php @@ -261,9 +261,9 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL print $cssPrefix.".badge-status".$statusName." {\n"; print " color: ".$thisBadgeTextColor." !important;\n"; if (in_array((string) $statusName, $TBadgeBorderOnly)) { - print " border-color: ".$thisBadgeBorderColor.";\n"; + print " border-color: ".$thisBadgeBorderColor." !important;\n"; } - print " background-color: ".$thisBadgeBackgroundColor.";\n"; + print " background-color: ".$thisBadgeBackgroundColor." !important;\n"; print "}\n"; print $cssPrefix.".font-status".$statusName." {\n"; @@ -272,14 +272,14 @@ function _createStatusBadgeCss($statusName, $statusVarNamePrefix = '', $commentL print $cssPrefix.".badge-status".$statusName.".focus, ".$cssPrefix.".badge-status".$statusName.":focus {\n"; print " outline: 0;\n"; - print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5).";\n"; + print " box-shadow: 0 0 0 0.2rem ".colorHexToRgb($thisBadgeBackgroundColor, 0.5)." !important;\n"; print "}\n"; print $cssPrefix.".badge-status".$statusName.":focus, ".$cssPrefix.".badge-status".$statusName.":hover {\n"; print " color: ".$thisBadgeTextColor." !important;\n"; //print " background-color: ".colorDarker($thisBadgeBackgroundColor, 10).";\n"; if (in_array((string) $statusName, $TBadgeBorderOnly)) { - print " border-color: ".colorDarker($thisBadgeBorderColor, 10).";\n"; + print " border-color: ".colorDarker($thisBadgeBorderColor, 10)." !important;\n"; } print "}\n"; } diff --git a/htdocs/theme/md/btn.inc.php b/htdocs/theme/md/btn.inc.php index c0d6e2c9cd7..2517415a96f 100644 --- a/htdocs/theme/md/btn.inc.php +++ b/htdocs/theme/md/btn.inc.php @@ -379,6 +379,23 @@ div.pagination .btnTitle:hover .btnTitle-label{ } } +/* rule to reduce top menu - 3rd reduction: The menu for user is on left */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.9em; + } +} + +/* smartphone */ +@media only screen and (max-width: 767px) +{ + .butAction, .butActionRefused, .butActionDelete { + font-size: 0.85em; + } +} + + global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?> .butActionRefused, .butActionNewRefused, .btnTitle.refused { display: none !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 70a2ce1303e..dfa8b00f9eb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -599,6 +599,9 @@ input.pageplusone { .colorblack { color: #000; } +.fontsizeunset { + font-size: unset !important; +} .vmirror { transform: scale(1, -1); @@ -780,9 +783,15 @@ th .button { textarea.centpercent { width: 96%; } +.quatrevingtpercentminusx { + width: calc(80% - 52px); +} .small, small { font-size: 85%; } +.large { + font-size: 125%; +} .h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small { font-size: 65%; @@ -869,12 +878,18 @@ textarea.centpercent { .paddingleft2 { padding-: 2px; } +.paddingleft2imp { + padding-: 2px !important; +} .paddingright { padding-: 4px; } .paddingright2 { padding-: 2px; } +.paddingright2imp { + padding-: 2px !important; +} .marginleft2 { margin-: 2px; } @@ -1002,8 +1017,8 @@ body[class*="colorblind-"] .text-success{ height: 28px; vertical-align: middle; } -.divsocialnetwork:not(:first-child) { - padding-left: 20px; +.divsocialnetwork:not(:last-child) { + padding-: 20px; } div.divsearchfield { float: ; @@ -1208,6 +1223,12 @@ select.flat.selectlimit { text-overflow: ellipsis; white-space: nowrap; } +.tdoverflowmax250 { /* For tdoverflow, the max-midth become a minimum ! */ + max-width: 250px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .tdoverflowmax300 { /* For tdoverflow, the max-midth become a minimum ! */ max-width: 300px; overflow: hidden; @@ -1495,6 +1516,33 @@ table[summary="list_of_modules"] .fa-cog { div.divphotoref { padding-right: 10px !important; } + + .hideonsmartphone { display: none; } + .hideonsmartphoneimp { display: none !important; } + + select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 { + width: calc(100% - 40px) !important; + display: inline-block; + } + select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx { + width: calc(100% - 70px) !important; + display: inline-block; + } + + input.maxwidthinputfileonsmartphone { + width: 175px; + } + + .poweredbyimg { + width: 48px; + } + input.buttonpayment, button.buttonpayment, div.buttonpayment { + min-width: 270px; + } + + .smallonsmartphone { + font-size: 0.8em; + } } /* Force values for small screen 570 */ @@ -1569,8 +1617,6 @@ table[summary="list_of_modules"] .fa-cog { line-height: 1.4em; } - .hideonsmartphone { display: none; } - .hideonsmartphoneimp { display: none !important; } .noenlargeonsmartphone { width : 50px !important; display: inline !important; } .maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; } .maxwidth50onsmartphone { max-width: 40px; } @@ -1640,7 +1686,7 @@ table.tableforfield tr>td:first-of-type, tr.trforfield>td:first-of-type, div.tab } -.hideonprint { display: none; } +.hideonprint { display: none !important; } @@ -1825,7 +1871,7 @@ div.login_block { div.backgroundsemitransparent { - background:rgba(255,255,255,0.6); + background:rgba(255, 255, 255, 0.7); padding-left: 10px; padding-right: 10px; } @@ -3053,11 +3099,11 @@ div.tabsElem a { } div.tabBar { color: #; - padding-top: 16px; - padding-left: 16px; - padding-right: 16px; - padding-bottom: 16px; - margin: 0px 0px 16px 0px; + padding-top: 21px; + padding-left: 24px; + padding-right: 24px; + padding-bottom: 18px; + margin: 0px 0px 18px 0px; -webkit-border-radius: 3px; border-radius: 3px; border-right: 1px solid #BBB; @@ -3402,9 +3448,9 @@ tr.liste_titre_filter td.liste_titre { } .liste_titre_create td, .liste_titre_create th, .liste_titre_create .tagtd { - /*border-top-width: 1px; + border-top-width: 1px; border-top-color: rgb(); - border-top-style: solid;*/ + border-top-style: solid; } .liste_titre_add td, .liste_titre_add th, .liste_titre_add .tagtd { @@ -3793,7 +3839,7 @@ div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_se { background: rgb(); font-weight: ; - border-bottom: 1px solid #FDFFFF; + /* border-bottom: 1px solid #FDFFFF; */ color: rgb(); font-family: ; @@ -3878,14 +3924,19 @@ tr.liste_sub_total, tr.liste_sub_total td { } .paymenttable, .margintable { + margin: 0px 0px 0px 0px !important; +} +.paymenttable, .margintable:not(.margintablenotop) { border-top-width: px !important; border-top-color: rgb() !important; border-top-style: solid !important; - margin: 0px 0px 0px 0px !important; +} +.margintable.margintablenotop { + border-top-width: 0; } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; @@ -3901,6 +3952,11 @@ tr.liste_sub_total, tr.liste_sub_total td { box-shadow: 2px 2px 5px #CCC !important; } +.boxshadow { + -webkit-box-shadow: 0px 0px 5px #888; + box-shadow: 0px 0px 5px #888; +} + div.tabBar .noborder { -webkit-box-shadow: 0px 0px 0px #f4f4f4 !important; box-shadow: 0px 0px 0px #f4f4f4 !important; @@ -4427,6 +4483,9 @@ div#card-errors { font-size: px !important; } +.ui-dialog.ui-corner-all.ui-widget.ui-widget-content.ui-front.ui-dialog-buttons.ui-draggable { + z-index: 1002 !important; /* Default 101 with jquery, top menu have a z-index of 1000 */ +} /* ============================================================================== */ /* For content of image preview */ @@ -4606,6 +4665,10 @@ div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore { display: none; } +.unvisible { + visibility: hidden; +} + tr.visible { display: block; } @@ -4849,9 +4912,10 @@ td.gtaskname { /* ============================================================================== */ /* CSS for treeview */ -.treeview ul { background-color: transparent !important; margin-top: 0; } -.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 20px; } -.treeview .hover { color: rgb() !important; text-decoration: underline !important; } +.treeview ul { background-color: transparent !important; margin-bottom: 4px !important; margin-top: 0 !important; padding-top: 8px !important; } +.treeview li { background-color: transparent !important; padding: 0 0 0 16px !important; min-height: 30px; } +.treeview .hover { color: var(--colortextlink) !important; text-decoration: underline !important; } +.treeview .hitarea { margin-top: 3px; } @@ -5897,6 +5961,9 @@ dl.dropdown { display:inline-block; padding: 0 3px 2px 0; } +.maxwidthsearch .dropdown dt a span, .multiSel span { + padding: 0 3px 2px 3px; +} .dropdown span.value { display:none; } @@ -6622,10 +6689,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before /* For copy-paste feature */ /* ============================================================================== */ +span.clipboardCPValueToPrint { + display: inline-block; +} span.clipboardCPValue.hidewithsize { width: 0 !important; display: inline-block; color: transparent; + white-space: nowrap; } .clipboardCPShowOnHover .clipboardCPButton { diff --git a/htdocs/theme/md/theme_vars.inc.php b/htdocs/theme/md/theme_vars.inc.php index 9e98a863737..fd37b6376dd 100644 --- a/htdocs/theme/md/theme_vars.inc.php +++ b/htdocs/theme/md/theme_vars.inc.php @@ -65,6 +65,9 @@ $colortext = '0,0,0'; $colortextlink = '0,0,120'; $fontsize = '14'; $fontsizesmaller = '11'; +$topMenuFontSize = '1.1em'; +$toolTipBgColor = 'rgba(255, 255, 255, 0.96)'; +$toolTipFontColor = '#333'; // text color $textSuccess = '#28a745'; @@ -83,9 +86,15 @@ $badgeInfo = '#17a2b8'; $badgeDark = '#343a40'; $badgeLight = '#f8f9fa'; +// badge color ajustement for color blind +$colorblind_deuteranopes_badgeSuccess = '#37de5d'; //! text color black +$colorblind_deuteranopes_badgeSuccess_textColor7 = '#000'; +$colorblind_deuteranopes_badgeWarning = '#e4e411'; +$colorblind_deuteranopes_badgeDanger = $badgeDanger; // currently not tested with a color blind people so use default color + /* default color for status : After a quick check, somme status can have oposite function according to objects * So this badges status uses default value according to theme eldy status img -* TODO: use color definition vars above for define badges color status X -> expemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive .... +* TODO: use color definition vars above for define badges color status X -> exemple $badgeStatusValidate, $badgeStatusClosed, $badgeStatusActive .... */ $badgeStatus0 = '#cbd3d3'; $badgeStatus1 = '#bc9526'; @@ -99,3 +108,9 @@ $badgeStatus8 = '#993013'; $badgeStatus9 = '#e7f0f0'; $badgeStatus10 = '#993013'; $badgeStatus11 = '#15a540'; + +// status color ajustement for color blind +$colorblind_deuteranopes_badgeStatus4 = $colorblind_deuteranopes_badgeStatus7 = $colorblind_deuteranopes_badgeSuccess; //! text color black +$colorblind_deuteranopes_badgeStatus_textColor4 = $colorblind_deuteranopes_badgeStatus_textColor7 = '#000'; +$colorblind_deuteranopes_badgeStatus1 = $colorblind_deuteranopes_badgeWarning; +$colorblind_deuteranopes_badgeStatus_textColor1 = '#000'; diff --git a/htdocs/ticket/README.md b/htdocs/ticket/README.md index e4c9b49f6b3..ee91036a0be 100644 --- a/htdocs/ticket/README.md +++ b/htdocs/ticket/README.md @@ -6,5 +6,5 @@ An issue tracker that provides a delicate balance between simplicity and power a Offer your customers an easy to use interface to report and follow status of their issue. Manage your issues from your backoffice. +By enabling the Email Collector module, you can also having your ticket created automatically from input emails. -(c) The development of this module has been initiated by the company Libr&thic and is now part of Dolibarr ERP CRM core. diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9bf6cbc13c4..fee91e959aa 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -81,12 +81,9 @@ if (!$action) { // Security check $id = GETPOST("id", 'int'); $socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. +if ($user->socid > 0) $socid = $user->socid; $result = restrictedArea($user, 'ticket', $id, ''); -if (!$user->rights->ticket->read) { - accessforbidden(); -} // restrict access for externals users if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { accessforbidden(); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index e04e3c51ce3..8a11ac23e23 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -31,6 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (!empty($conf->projet->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -53,6 +54,7 @@ $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); +$backtopage = GETPOST('$backtopage', 'alpha'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -112,8 +114,8 @@ if ($id || $track_id || $ref) { $url_page_current = DOL_URL_ROOT.'/ticket/card.php'; // Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; +$socid = 0; +if ($user->socid > 0) $socid = $user->socid; $result = restrictedArea($user, 'ticket', $object->id); $triggermodname = 'TICKET_MODIFY'; @@ -152,7 +154,7 @@ if (empty($reshook)) { } // Action to add an action (not a message) - if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { + if (GETPOST('add', 'alpha') && !empty($user->rights->ticket->write)) { $error = 0; if (!GETPOST("subject", 'alphanohtml')) { @@ -186,6 +188,11 @@ if (empty($reshook)) { $object->email_from = $user->email; $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; + $fk_user_assign = GETPOST("fk_user_assign", 'int'); + if ($fk_user_assign > 0) { + $object->fk_user_assign = $fk_user_assign; + $object->fk_statut = $object::STATUS_ASSIGNED; + } $object->fk_project = $projectid; @@ -201,6 +208,10 @@ if (empty($reshook)) { $contactid = GETPOST('contactid', 'int'); $type_contact = GETPOST("type", 'alpha'); + // Category association + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + if ($contactid > 0 && $type_contact) { $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, 'external'); @@ -311,7 +322,11 @@ if (empty($reshook)) { $object->severity_code = GETPOST('severity_code', 'alpha'); $ret = $object->update($user); - if ($ret <= 0) { + if ($ret > 0) { + // Category association + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + } else { $error++; } @@ -425,10 +440,10 @@ if (empty($reshook)) { } } - if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) { + if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) { $object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); - if ($object->close($user)) { + if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) { setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha'); @@ -472,7 +487,7 @@ if (empty($reshook)) { } // Set parent company - if ($action == 'set_thirdparty' && $user->rights->societe->creer) { + if ($action == 'set_thirdparty' && $user->rights->ticket->write) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $result = $object->setCustomer(GETPOST('editcustomer', 'int')); $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha'); @@ -725,7 +740,7 @@ if ($action == 'create' || $action == 'presend') { // Subject print '
    '; // Other attributes @@ -748,7 +763,7 @@ if ($action == 'create' || $action == 'presend') { print ''; print ''; */ -} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' +} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { if ($res > 0) { // or for unauthorized internals users @@ -763,6 +778,13 @@ if ($action == 'create' || $action == 'presend') { print '
    '; } } + // Confirmation abandon + if ($action == 'abandon') { + print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("AbandonTicket"), $langs->trans("ConfirmAbandonTicket"), "confirm_abandon", '', '', 1); + if ($ret == 'html') { + print '
    '; + } + } // Confirmation delete if ($action == 'delete') { print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("Delete"), $langs->trans("ConfirmDeleteTicket"), "confirm_delete_ticket", '', '', 1); @@ -873,11 +895,12 @@ if ($action == 'create' || $action == 'presend') { $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); - $morehtmlref .= $fuser->getNomUrl(0); + $morehtmlref .= $fuser->getNomUrl(-1); } if (!empty($object->origin_email)) { $morehtmlref .= '
    '.$langs->trans("CreatedBy").' : '; - $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("TicketEmailOriginIssuer").')'; } // Thirdparty @@ -967,8 +990,8 @@ if ($action == 'create' || $action == 'presend') { print ''; @@ -990,7 +1013,7 @@ if ($action == 'create' || $action == 'presend') { print ''; } + // Categories + if ($conf->categorie->enabled) { + print '"; + } + // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -1117,15 +1147,21 @@ if ($action == 'create' || $action == 'presend') { } else { // Type print ''; // Group print ''; // Severity print ''; } print '
    '; // In phone version only show when it is invoice page -if ($mobilepage == "invoice" || $mobilepage == "") { +if (empty($mobilepage) || $mobilepage == "invoice") { print ''; } -if ($conf->global->TAKEPOS_BAR_RESTAURANT) { +if (getDolGlobalString('TAKEPOS_BAR_RESTAURANT')) { $sql = "SELECT floor, label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) $place); $resql = $db->query($sql); $obj = $db->fetch_object($resql); @@ -1189,14 +1246,14 @@ if ($conf->global->TAKEPOS_BAR_RESTAURANT) { print $langs->trans("Products"); } print ''.$langs->trans('ReductionShort').''.$langs->trans('Qty').''; print '' . $langs->trans('TotalHTShort') . '
    '; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print '' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . ''; if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency @@ -1212,9 +1269,9 @@ if ($_SESSION["basiclayout"] != 1) { print '
    '; print ''.$langs->trans('TotalTTCShort').'
    '; // In phone version only show when it is invoice page - if ($mobilepage == "invoice" || $mobilepage == "") { + if (empty($mobilepage) || $mobilepage == "invoice") { print ''.price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency).''; - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1230,7 +1287,7 @@ if ($_SESSION["basiclayout"] != 1) { print "
    '.vatrate($line->remise_percent, true).''.$line->qty.''.price($line->total_ttc).''; - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= ''.$line->qty." x "; } if (isset($line->product_type)) { @@ -1399,10 +1457,10 @@ if ($placeid > 0) { if (!empty($line->array_options['options_order_notes'])) { $htmlforlines .= "
    (".$line->array_options['options_order_notes'].")"; } - if ($_SESSION["basiclayout"] == 1) { + if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) { $htmlforlines .= '
      '; } - if ($_SESSION["basiclayout"] != 1) { + if (empty($_SESSION["basiclayout"]) || $_SESSION["basiclayout"] != 1) { $moreinfo = ''; $moreinfo .= $langs->transcountry("TotalHT", $mysoc->country_code).': '.price($line->total_ht); if ($line->vat_src_code) { @@ -1453,10 +1511,10 @@ if ($placeid > 0) { } $htmlforlines .= ''; $htmlforlines .= price($line->total_ht, 1, '', 1, -1, -1, $conf->currency); - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1467,7 +1525,7 @@ if ($placeid > 0) { } $htmlforlines .= ''; $htmlforlines .= price($line->total_ttc, 1, '', 1, -1, -1, $conf->currency); - if (!empty($conf->multicurrency->enabled) && $_SESSION["takeposcustomercurrency"] != "" && $conf->currency != $_SESSION["takeposcustomercurrency"]) { + if (!empty($conf->multicurrency->enabled) && !empty($_SESSION["takeposcustomercurrency"]) && $conf->currency != $_SESSION["takeposcustomercurrency"]) { //Only show customer currency if multicurrency module is enabled, if currency selected and if this currency selected is not the same as main currency include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; $multicurrency = new MultiCurrency($db); @@ -1477,7 +1535,7 @@ if ($placeid > 0) { $htmlforlines .= '
    '; - print ''; + print ''; print '
    '.$langs->trans("TicketReadOn").''; if (!empty($object->date_read)) { print dol_print_date($object->date_read, 'dayhour', 'tzuser'); - print ' - '.$langs->trans("TicketTimeToRead").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; - print ' - '.$langs->trans("TimeElapsedSince").': '.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; + print ' - '.$langs->trans("TicketTimeElapsedBeforeSince").': '.convertSecondToTime(roundUpToNextMultiple($object->date_read - $object->datec, 60)).''; + print ' / '.convertSecondToTime(roundUpToNextMultiple($now - $object->date_read, 60)).''; } print '
    '; if ($object->fk_user_assign > 0) { $userstat->fetch($object->fk_user_assign); - print $userstat->getNomUrl(1); + print $userstat->getNomUrl(-1); } // Show user list to assignate one if status is "read" @@ -1052,6 +1075,13 @@ if ($action == 'create' || $action == 'presend') { print '
    '.$langs->trans("Categories").''; + print $form->showCategories($object->id, Categorie::TYPE_TICKET, 1); + print "
    '.$langs->trans("Type").''; - print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code); + if (!empty($object->type_code)) { + print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code); + } print '
    '.$langs->trans("TicketCategory").''; - print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code); + if (!empty($object->category_code)) { + print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code); + } print '
    '.$langs->trans("TicketSeverity").''; - print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code); + if (!empty($object->severity_code)) { + print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code); + } print '
    '; // End table actions @@ -1182,7 +1218,7 @@ if ($action == 'create' || $action == 'presend') { if ($tab[$i]['socid'] > 0) { $companystatic->fetch($tab[$i]['socid']); - echo $companystatic->getNomUrl(1); + echo $companystatic->getNomUrl(-1); } if ($tab[$i]['socid'] < 0) { echo $conf->global->MAIN_INFO_SOCIETE_NOM; @@ -1195,12 +1231,12 @@ if ($action == 'create' || $action == 'presend') { print '
    '; if ($tab[$i]['source'] == 'internal') { if ($userstatic->fetch($tab[$i]['id'])) { - print $userstatic->getNomUrl(1); + print $userstatic->getNomUrl(-1); } } if ($tab[$i]['source'] == 'external') { if ($contactstatic->fetch($tab[$i]['id'])) { - print $contactstatic->getNomUrl(1); + print $contactstatic->getNomUrl(-1); } } print '
    @@ -1294,8 +1330,13 @@ if ($action == 'create' || $action == 'presend') { print ''; } + // Abadon ticket if statut is read + if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) { + print ''; + } + // Re-open ticket - if (!$user->socid && $object->fk_statut == Ticket::STATUS_CLOSED && !$user->socid) { + if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) { print ''; } @@ -1320,15 +1361,32 @@ if ($action == 'create' || $action == 'presend') { // add a message if ($action == 'presend' || $action == 'presend_addmessage') { + if ($object->fk_soc > 0) { + $object->fetch_thirdparty(); + } + + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { + $newlang = GETPOST('lang_id', 'aZ09'); + } elseif ($conf->global->MAIN_MULTILANGS && empty($newlang) && is_object($object->thirdparty)) { + $newlang = $object->thirdparty->default_lang; + } + if (!empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + + $arrayoffamiliestoexclude = array('objectamount'); + $action = 'add_message'; // action to use to post the message $modelmail = 'ticket_send'; // Substitution array $morehtmlright = ''; $help = ""; - $substitutionarray = array(); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); if ($object->fk_soc > 0) { - $object->fetch_thirdparty(); $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; } $substitutionarray['__USER_SIGNATURE__'] = $user->signature; @@ -1361,16 +1419,6 @@ if ($action == 'create' || $action == 'presend') { print '
    '; - // Define output language - $outputlangs = $langs; - $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { - $newlang = GETPOST('lang_id', 'aZ09'); - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { - $newlang = $object->default_lang; - } - $formticket = new FormTicket($db); $formticket->action = $action; @@ -1452,9 +1500,11 @@ if ($action == 'create' || $action == 'presend') { $MAXEVENT = 10; - $morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id); + $morehtmlcenter = '
    '; + $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/ticket/messaging.php?id='.$object->id); $morehtmlcenter .= ' '; $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id); + $morehtmlcenter .= '
    '; // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index eb6193d58f1..d7d971b4edc 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -192,7 +192,7 @@ class ActionsTicket // Initial message print '
    '; print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
    '; print '
    '; print $langs->trans("InitialMessage"); print ''; @@ -391,7 +391,7 @@ class ActionsTicket { global $langs; - print '
    '; + print '

    '; + print ''; + print ''; + print '
    '; } /** diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 7f2d2cf1be0..e104d425bf4 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -262,7 +262,7 @@ class Tickets extends DolibarrApi $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($socid > 0) { - $sql .= " AND t.fk_soc = ".$socid; + $sql .= " AND t.fk_soc = ".((int) $socid); } if ($search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -270,7 +270,7 @@ class Tickets extends DolibarrApi // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".$search_sale; + $sql .= " AND sc.fk_user = ".((int) $search_sale); } // Add sql filters if ($sqlfilters) { diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php new file mode 100644 index 00000000000..4e3e6311354 --- /dev/null +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -0,0 +1,819 @@ + + * Copyright (C) ---Put here your own copyright and developer email--- + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/modulebuilder/template/class/myobject.class.php + * \ingroup mymodule + * \brief This file is a CRUD class file for MyObject (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; +//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; + +/** + * Class for MyObject + */ +class CTicketCategory extends CommonObject +{ + /** + * @var string ID of module. + */ + public $module = 'ticket'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'cticketcategory'; + + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'c_ticket_category'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 0; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 0; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'ticket'; + + + const STATUS_DISABLED = 0; + const STATUS_ENABLED = 1; + + + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'maxwidth200', 'wordbreak', 'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + // BEGIN MODULEBUILDER PROPERTIES + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), + 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'position'=>15, 'index'=>1), + 'code' =>array('type'=>'varchar(32)', 'label'=>'Code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20), + 'pos' =>array('type'=>'integer', 'label'=>'Pos', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), + 'label' =>array('type'=>'varchar(128)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30, 'showoncombobox'=>1), + 'active' =>array('type'=>'integer', 'label'=>'Active', 'enabled'=>1, 'visible'=>-1, 'position'=>35), + 'use_default' =>array('type'=>'integer', 'label'=>'Usedefault', 'enabled'=>1, 'visible'=>-1, 'position'=>40), + 'description' =>array('type'=>'varchar(255)', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>45), + 'fk_parent' =>array('type'=>'integer', 'label'=>'Fkparent', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50), + 'force_severity' =>array('type'=>'varchar(32)', 'label'=>'Forceseverity', 'enabled'=>1, 'visible'=>-1, 'position'=>55), + 'public' =>array('type'=>'integer', 'label'=>'Public', 'enabled'=>1, 'visible'=>-1, 'position'=>60), + ); + + /** + * @var int ID + */ + public $rowid; + + /** + * @var string Ref + */ + public $ref; + + /** + * @var int Entity + */ + public $entity; + + /** + * @var string label + */ + public $label; + + /** + * @var string amount + */ + public $amount; + + /** + * @var int Status + */ + public $status; + + /** + * @var integer|string date_creation + */ + public $date_creation; + + /** + * @var integer tms + */ + public $tms; + + /** + * @var int ID + */ + public $fk_user_creat; + + /** + * @var int ID + */ + public $fk_user_modif; + + /** + * @var string public $last_main_doc + */ + public $last_main_doc; + + /** + * @var string import_key + */ + public $import_key; + // END MODULEBUILDER PROPERTIES + + + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible'] = 0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } + + // Example to show how to set values of fields definition dynamically + /*if ($user->rights->mymodule->myobject->read) { + $this->fields['myfield']['visible'] = 1; + $this->fields['myfield']['noteditable'] = 0; + }*/ + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + $resultcreate = $this->createCommon($user, $notrigger); + + //$resultvalidate = $this->validate($user, $notrigger); + + return $resultcreate; + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @return mixed New object created, <0 if KO + */ + public function createFromClone(User $user, $fromid) + { + global $langs, $extrafields; + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $result = $object->fetchCommon($fromid); + if ($result > 0 && !empty($object->table_element_line)) { + $object->fetchLines(); + } + + // get lines so they will be clone + //foreach($this->lines as $line) + // $line->fetch_optionals(); + + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + + // Clear fields + if (property_exists($object, 'ref')) { + $object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default']; + } + if (property_exists($object, 'label')) { + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default']; + } + if (property_exists($object, 'status')) { + $object->status = self::STATUS_DRAFT; + } + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'date_modification')) { + $object->date_modification = null; + } + // ... + // Clear extrafields that are unique + if (is_array($object->array_options) && count($object->array_options) > 0) { + $extrafields->fetch_name_optionals_label($this->table_element); + foreach ($object->array_options as $key => $option) { + $shortkey = preg_replace('/options_/', '', $key); + if (!empty($extrafields->attributes[$this->table_element]['unique'][$shortkey])) { + //var_dump($key); var_dump($clonedObj->array_options[$key]); exit; + unset($object->array_options[$key]); + } + } + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + if ($result < 0) { + $error++; + $this->error = $object->error; + $this->errors = $object->errors; + } + + if (!$error) { + // copy internal contacts + if ($this->copy_linked_contact($object, 'internal') < 0) { + $error++; + } + } + + if (!$error) { + // copy external contacts if same company + if (property_exists($this, 'fk_soc') && $this->fk_soc == $object->socid) { + if ($this->copy_linked_contact($object, 'external') < 0) { + $error++; + } + } + } + + unset($object->context['createfromclone']); + + // End + if (!$error) { + $this->db->commit(); + return $object; + } else { + $this->db->rollback(); + return -1; + } + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) + { + $result = $this->fetchCommon($id, $ref); + if ($result > 0 && !empty($this->table_element_line)) { + $this->fetchLines(); + } + return $result; + } + + /** + * Load object lines in memory from the database + * + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetchLines() + { + $this->lines = array(); + + $result = $this->fetchLinesCommon(); + return $result; + } + + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') + { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = 'SELECT '; + $sql .= $this->getFieldList('t'); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { + $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; + } else { + $sql .= ' WHERE 1 = 1'; + } + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key.'='.$value; + } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + } elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + } else { + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')'; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= ' '.$this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < ($limit ? min($limit, $num) : $num)) { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error '.$this->db->lasterror(); + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + //return $this->deleteCommon($user, $notrigger, 1); + } + + /** + * Delete a line of object in database + * + * @param User $user User that delete + * @param int $idline Id of line to delete + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int >0 if OK, <0 if KO + */ + public function deleteLine(User $user, $idline, $notrigger = false) + { + if ($this->status < 0) { + $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; + return -2; + } + + return $this->deleteLineCommon($user, $idline, $notrigger); + } + + + /** + * Validate object + * + * @param User $user User making status change + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <=0 if OK, 0=Nothing done, >0 if KO + */ + public function validate($user, $notrigger = 0) + { + global $conf, $langs; + + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + + $error = 0; + + // Protection + if ($this->status == self::STATUS_VALIDATED) { + dol_syslog(get_class($this)."::validate action abandonned: already validated", LOG_WARNING); + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->myobject->myobject_advance->validate)))) + { + $this->error='NotEnoughPermissions'; + dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR); + return -1; + }*/ + + $now = dol_now(); + + $this->db->begin(); + + // Define new ref + if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life + $num = $this->getNextNumRef(); + } else { + $num = $this->ref; + } + $this->newref = $num; + + if (!empty($num)) { + // Validate + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; + $sql .= " SET ref = '".$this->db->escape($num)."',"; + $sql .= " status = ".self::STATUS_VALIDATED; + if (!empty($this->fields['date_validation'])) { + $sql .= ", date_validation = '".$this->db->idate($now)."'"; + } + if (!empty($this->fields['fk_user_valid'])) { + $sql .= ", fk_user_valid = ".((int) $user->id); + } + $sql .= " WHERE rowid = ".((int) $this->id); + + dol_syslog(get_class($this)."::validate()", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) { + dol_print_error($this->db); + $this->error = $this->db->lasterror(); + $error++; + } + + if (!$error && !$notrigger) { + // Call trigger + $result = $this->call_trigger('MYOBJECT_VALIDATE', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } + } + + if (!$error) { + $this->oldref = $this->ref; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) { + // Now we rename also files into index + $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'myobject/".$this->db->escape($this->newref)."'"; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'myobject/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $resql = $this->db->query($sql); + if (!$resql) { + $error++; $this->error = $this->db->lasterror(); + } + + // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments + $oldref = dol_sanitizeFileName($this->ref); + $newref = dol_sanitizeFileName($num); + $dirsource = $conf->mymodule->dir_output.'/myobject/'.$oldref; + $dirdest = $conf->mymodule->dir_output.'/myobject/'.$newref; + if (!$error && file_exists($dirsource)) { + dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) { + dol_syslog("Rename ok"); + // Rename docs starting with $oldref with $newref + $listoffiles = dol_dir_list($conf->mymodule->dir_output.'/myobject/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/')); + foreach ($listoffiles as $fileentry) { + $dirsource = $fileentry['name']; + $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource); + $dirsource = $fileentry['path'].'/'.$dirsource; + $dirdest = $fileentry['path'].'/'.$dirdest; + @rename($dirsource, $dirdest); + } + } + } + } + } + + // Set new ref and current status + if (!$error) { + $this->ref = $num; + $this->status = self::STATUS_VALIDATED; + } + + if (!$error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } + } + + + /** + * Set cancel status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function cancel($user, $notrigger = 0) + { + // Protection + if ($this->status != self::STATUS_VALIDATED) { + return 0; + } + + /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->write)) + || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->mymodule->mymodule_advance->validate)))) + { + $this->error='Permission denied'; + return -1; + }*/ + + return $this->setStatusCommon($user, self::STATUS_DISABLED, $notrigger, 'CTICKETCATEGORY_CANCEL'); + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) + { + global $conf, $langs, $hookmanager; + + if (!empty($conf->dol_no_mouse_hover)) { + $notooltip = 1; // Force disable tooltips + } + + $result = ''; + + /*$label = img_picto('', $this->picto).' '.$langs->trans("MyObject").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } + $label .= '
    '; + $label .= ''.$langs->trans('Ref').': '.$this->ref; + */ + $label = ''; + + //$url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id; + $url = ''; + + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } + } + + $linkclose = ''; + if (empty($notooltip)) { + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $label = $langs->trans("ShowMyObject"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + } else { + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } + + if ($option == 'nolink') { + $linkstart = ''; + if ($option == 'nolink') { + $linkend = ''; + } else { + $linkend = '
    '; + } + + //$result .= $linkstart; + $result .= $this->label; + //$result .= $linkend; + + global $action, $hookmanager; + $hookmanager->initHooks(array('cticketcategorydao')); + $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + + return $result; + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + // phpcs:enable + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + //$langs->load("mymodule@mymodule"); + $this->labelStatus[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatus[self::STATUS_DISABLED] = $langs->trans('Disabled'); + $this->labelStatusShort[self::STATUS_ENABLED] = $langs->trans('Enabled'); + $this->labelStatusShort[self::STATUS_DISABLED] = $langs->trans('Disabled'); + } + + $statusType = 'status'.$status; + //if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; + if ($status == self::STATUS_DISABLED) { + $statusType = 'status6'; + } + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } + + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; + $sql .= ' fk_user_creat, fk_user_modif'; + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + $sql .= ' WHERE t.rowid = '.((int) $id); + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_valid) { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + + if ($obj->fk_user_cloture) { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + $this->initAsSpecimenCommon(); + } +} diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5180abe6140..e8a1b53ed82 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -218,8 +218,8 @@ class Ticket extends CommonObject const STATUS_IN_PROGRESS = 3; const STATUS_NEED_MORE_INFO = 5; const STATUS_WAITING = 7; // on hold - const STATUS_CLOSED = 8; - const STATUS_CANCELED = 9; + const STATUS_CLOSED = 8; // Closed - Solved + const STATUS_CANCELED = 9; // Closed - Not solved /** @@ -272,8 +272,8 @@ class Ticket extends CommonObject 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>1), - 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>1, 'position'=>550, 'notnull'=>1), - 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')), + 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1), + 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), ); // END MODULEBUILDER PROPERTIES @@ -286,6 +286,8 @@ class Ticket extends CommonObject */ public function __construct($db) { + global $conf; + $this->db = $db; $this->statuts_short = array( @@ -294,8 +296,8 @@ class Ticket extends CommonObject self::STATUS_ASSIGNED => 'Assigned', self::STATUS_IN_PROGRESS => 'InProgress', self::STATUS_WAITING => 'OnHold', - self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation', - self::STATUS_CLOSED => 'Closed', + self::STATUS_NEED_MORE_INFO => 'NeedMoreInformationShort', + self::STATUS_CLOSED => 'SolvedClosed', self::STATUS_CANCELED => 'Canceled' ); $this->statuts = array( @@ -305,7 +307,7 @@ class Ticket extends CommonObject self::STATUS_IN_PROGRESS => 'InProgress', self::STATUS_WAITING => 'OnHold', self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation', - self::STATUS_CLOSED => 'Closed', + self::STATUS_CLOSED => 'SolvedClosed', self::STATUS_CANCELED => 'Canceled' ); } @@ -459,7 +461,7 @@ class Ticket extends CommonObject $sql .= " ".(!isset($this->progress) ? '0' : "'".$this->db->escape($this->progress)."'").","; $sql .= " ".(!isset($this->timing) ? 'NULL' : "'".$this->db->escape($this->timing)."'").","; $sql .= " ".(!isset($this->type_code) ? 'NULL' : "'".$this->db->escape($this->type_code)."'").","; - $sql .= " ".(!isset($this->category_code) ? 'NULL' : "'".$this->db->escape($this->category_code)."'").","; + $sql .= " ".(empty($this->category_code) || $this->category_code == '-1' ? 'NULL' : "'".$this->db->escape($this->category_code)."'").","; $sql .= " ".(!isset($this->severity_code) ? 'NULL' : "'".$this->db->escape($this->severity_code)."'").","; $sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").","; $sql .= " ".(!isset($this->date_read) || dol_strlen($this->date_read) == 0 ? 'NULL' : "'".$this->db->idate($this->date_read)."'").","; @@ -531,7 +533,7 @@ class Ticket extends CommonObject global $langs; // Check parameters - if (!$id && !$track_id && !$ref && !$email_msgid) { + if (empty($id) && empty($ref) && empty($track_id) && empty($email_msgid)) { $this->error = 'ErrorWrongParameters'; dol_print_error(get_class($this)."::fetch ".$this->error); return -1; @@ -1112,10 +1114,10 @@ class Ticket extends CommonObject } /** - * print selected status + * Print selected status * - * @param string $selected selected status - * @return void + * @param string $selected Selected status + * @return void */ public function printSelectStatus($selected = "") { @@ -1124,9 +1126,9 @@ class Ticket extends CommonObject /** - * Charge dans cache la liste des types de tickets (paramétrable dans dictionnaire) + * Load into a cache the types of tickets (setup done into dictionaries) * - * @return int Number of lines loaded, 0 if already loaded, <0 if KO + * @return int Number of lines loaded, 0 if already loaded, <0 if KO */ public function loadCacheTypesTickets() { @@ -1177,7 +1179,7 @@ class Ticket extends CommonObject } // Cache deja charge - $sql = "SELECT rowid, code, label, use_default, pos, description, public, active"; + $sql = "SELECT rowid, code, label, use_default, pos, description, public, active, force_severity, fk_parent"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category"; $sql .= " WHERE active > 0"; $sql .= " ORDER BY pos"; @@ -1196,6 +1198,8 @@ class Ticket extends CommonObject $this->cache_category_tickets[$obj->rowid]['pos'] = $obj->pos; $this->cache_category_tickets[$obj->rowid]['public'] = $obj->public; $this->cache_category_tickets[$obj->rowid]['active'] = $obj->active; + $this->cache_category_tickets[$obj->rowid]['force_severity'] = $obj->force_severity; + $this->cache_category_tickets[$obj->rowid]['fk_parent'] = $obj->fk_parent; $i++; } return $num; @@ -1747,21 +1751,22 @@ class Ticket extends CommonObject /** * Close a ticket * - * @param User $user User that close - * @return int <0 if KO, >0 if OK + * @param User $user User that close + * @param int $mode 0=Close solved, 1=Close abandonned + * @return int <0 if KO, >0 if OK */ - public function close(User $user) + public function close(User $user, $mode = 0) { global $conf, $langs; - if ($this->fk_statut != Ticket::STATUS_CLOSED) { // not closed + if ($this->fk_statut != Ticket::STATUS_CLOSED && $this->fk_statut != Ticket::STATUS_CANCELED) { // not closed $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."ticket"; - $sql .= " SET fk_statut=".Ticket::STATUS_CLOSED.", progress=100, date_close='".$this->db->idate(dol_now())."'"; - $sql .= " WHERE rowid = ".$this->id; + $sql .= " SET fk_statut=".($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED).", progress=100, date_close='".$this->db->idate(dol_now())."'"; + $sql .= " WHERE rowid = ".((int) $this->id); - dol_syslog(get_class($this)."::close sql=".$sql); + dol_syslog(get_class($this)."::close mode=".$mode); $resql = $this->db->query($sql); if ($resql) { $error = 0; @@ -1829,19 +1834,21 @@ class Ticket extends CommonObject public function searchSocidByEmail($email, $type = '0', $filters = array(), $clause = 'AND') { $thirdparties = array(); + $exact = 0; // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; $sql .= " WHERE entity IN (".getEntity('ticket', 1).")"; if (!empty($type)) { if ($type == 1 || $type == 2) { - $sql .= " AND client = ".$type; + $sql .= " AND client = ".((int) $type); } elseif ($type == 3) { $sql .= " AND fournisseur = 1"; } } if (!empty($email)) { - if (!$exact) { + if (empty($exact)) { + $regs = array(); if (preg_match('/^([\*])?[^*]+([\*])?$/', $email, $regs) && count($regs) > 1) { $email = str_replace('*', '%', $email); } else { @@ -1853,15 +1860,11 @@ class Ticket extends CommonObject $sql .= "("; } - if (!$case) { - $sql .= "email LIKE '".$this->db->escape($email)."'"; - } else { - $sql .= "email LIKE BINARY '".$this->db->escape($email)."'"; - } + $sql .= "email LIKE '".$this->db->escape($email)."'"; } if (is_array($filters) && !empty($filters)) { foreach ($filters as $field => $value) { - $sql .= " ".$clause." ".$field." LIKE BINARY '".$this->db->escape($value)."'"; + $sql .= " ".$clause." ".$field." LIKE '".$this->db->escape($value)."'"; } if (!empty($email)) { $sql .= ")"; @@ -2499,6 +2502,51 @@ class Ticket extends CommonObject return array('listofpaths'=>$listofpaths, 'listofnames'=>$listofnames, 'listofmimes'=>$mimetype); } + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return void + */ + public function setCategories($categories) + { + // Handle single category + if (!is_array($categories)) { + $categories = array($categories); + } + + // Get current categories + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $c = new Categorie($this->db); + $existing = $c->containing($this->id, Categorie::TYPE_TICKET, 'id'); + + // Diff + if (is_array($existing)) { + $to_del = array_diff($existing, $categories); + $to_add = array_diff($categories, $existing); + } else { + $to_del = array(); // Nothing to delete + $to_add = $categories; + } + + // Process + foreach ($to_del as $del) { + if ($c->fetch($del) > 0) { + $c->del_type($this, Categorie::TYPE_TICKET); + } + } + foreach ($to_add as $add) { + if ($c->fetch($add) > 0) { + $c->add_type($this, Categorie::TYPE_TICKET); + } + } + + return; + } /** * Add new message on a ticket (private/public area). Can also send it be email if GETPOST('send_email', 'int') is set. diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 7e04dd12104..8d450ffb44b 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -50,11 +50,6 @@ $source = GETPOST('source', 'alpha'); $ligne = GETPOST('ligne', 'int'); $lineid = GETPOST('lineid', 'int'); -// Protection if external user -if ($user->socid > 0) { - $socid = $user->socid; - accessforbidden(); -} // Store current page url $url_page_current = dol_buildpath('/ticket/contact.php', 1); @@ -62,6 +57,24 @@ $url_page_current = dol_buildpath('/ticket/contact.php', 1); $object = new Ticket($db); +$permissiontoadd = $user->rights->ticket->write; + +// Security check +$id = GETPOST("id", 'int'); +$socid = 0; +if ($user->socid > 0) $socid = $user->socid; +$result = restrictedArea($user, 'ticket', $object->id, ''); + +// restrict access for externals users +if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { + accessforbidden(); +} +// or for unauthorized internals users +if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { + accessforbidden(); +} + + /* * Actions */ diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index 5e4d80cd8be..d534e8a1123 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -43,11 +43,6 @@ $track_id = GETPOST('track_id', 'alpha'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -// Security check -if (!$user->rights->ticket->read) { - accessforbidden(); -} - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -75,6 +70,21 @@ if ($result < 0) { $upload_dir = $conf->ticket->dir_output."/".dol_sanitizeFileName($object->ref); } +$permissiontoadd = $user->rights->ticket->write; + +// Security check - Protection if external user +$result = restrictedArea($user, 'ticket', $object->id); + +// restrict access for externals users +if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { + accessforbidden(); +} +// or for unauthorized internals users +if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) { + accessforbidden(); +} + + /* * Actions @@ -193,7 +203,7 @@ if ($object->id) { //$object->ref = $object->track_id; // For compatibility we use track ID for directory $modulepart = 'ticket'; - $permission = $user->rights->ticket->write; + $permissiontoadd = $user->rights->ticket->write; $permtoedit = $user->rights->ticket->write; $param = '&id='.$object->id; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 6bebe358af3..c3027e5044b 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -56,8 +56,7 @@ $result = restrictedArea($user, 'ticket', 0, '', '', '', ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $object = new Ticket($db); @@ -113,8 +112,14 @@ if (empty($endyear)) { } $startyear = $endyear - 1; + +// Change default WIDHT and HEIGHT (we need a smaller than default for both desktop and smartphone) $WIDTH = (($shownb && $showtot) || !empty($conf->dol_optimize_smallscreen)) ? '100%' : '80%'; -$HEIGHT = '200'; +if (empty($conf->dol_optimize_smallscreen)) { + $HEIGHT = '200'; +} else { + $HEIGHT = '160'; +} print '
    '; print '
    '; @@ -299,7 +304,7 @@ print '
    '."\n"; print '
    '; /* - * Latest tickets + * Latest unread tickets */ $max = 10; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 45a11a9daef..5a55a1ab324 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -45,9 +45,9 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'ticketlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id', 'int'); $msg_id = GETPOST('msg_id', 'int'); @@ -73,8 +73,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 or if we click on clear filters +} $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -107,12 +108,16 @@ if (GETPOST('search_fk_status', 'alpha') == 'non_closed') { } // Initialize array of search criterias -$search_all = trim(GETPOSTISSET("search_all") ?GETPOSTISSET("search_all", 'alpha') : GETPOST('sall')); +$search_all = (GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { + if (GETPOST('search_'.$key, 'alpha') !== '') { $search[$key] = GETPOST('search_'.$key, 'alpha'); } + if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + } } // List of fields to search into when doing a "search in all" @@ -126,12 +131,19 @@ $fieldstosearchall['s.name_alias'] = "AliasNameShort"; $fieldstosearchall['s.zip'] = "Zip"; $fieldstosearchall['s.town'] = "Town"; -// Definition of fields for list +// Definition of array of fields for columns $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); + $visible = (int) dol_eval($val['visible'], 1); + $arrayfields['t.'.$key] = array( + 'label'=>$val['label'], + 'checked'=>(($visible < 0) ? 0 : 1), + 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)), + 'position'=>$val['position'], + 'help'=> isset($val['help']) ? $val['help'] : '' + ); } } // Extra fields @@ -139,8 +151,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'); -//if ($socid > 0) $arrayfields['t.fk_soc']['enabled']=0; -//if ($projectid > 0) $arrayfields['t.fk_project']['enabled']=0; // Security check @@ -314,8 +324,7 @@ $formTicket = new FormTicket($db); $now = dol_now(); -$user_assign = new User($db); -$user_create = new User($db); +$user_temp = new User($db); $socstatic = new Societe($db); $help_url = ''; @@ -490,6 +499,11 @@ if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) { print '
    '; print ''; + // Type Prospect/Customer/Supplier + print ''; + // Customer code if ($socstat->client && !empty($socstat->code_client)) { print ''; } elseif ($key == 'category_code') { print ''; } elseif ($key == 'severity_code') { print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; } elseif ($key == 'fk_statut') { $arrayofstatus = array(); @@ -791,10 +805,10 @@ foreach ($object->fields as $key => $val) { print ''; } elseif ($key == "fk_soc") { print ''; @@ -832,7 +846,7 @@ foreach ($object->fields as $key => $val) { } elseif (strpos($val['type'], 'integer:') === 0) { print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) { - print ''; + print ''; } print ''; } @@ -946,30 +960,47 @@ while ($i < min($num, $limit)) { print $object->getLibStatut(5); } elseif ($key == 'subject') { $s = $obj->subject; - print ''; + print ''; print $s; print ''; } elseif ($key == 'type_code') { $s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code); - print ''; + print ''; print $s; print ''; } elseif ($key == 'category_code') { $s = $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code); - print ''; + print ''; print $s; print ''; } elseif ($key == 'severity_code') { $s = $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code); - print ''; + print ''; print $s; print ''; } elseif ($key == 'tms') { print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser'); } elseif ($key == 'fk_user_create') { if ($object->fk_user_create > 0) { - $user_create->fetch($object->fk_user_create); - print $user_create->getNomUrl(-1); + if (isset($conf->cache['user'][$object->fk_user_create])) { + $user_temp = $conf->cache['user'][$object->fk_user_create]; + } else { + $user_temp = new User($db); + $user_temp->fetch($object->fk_user_create); + $conf->cache['user'][$object->fk_user_create] = $user_temp; + } + print $user_temp->getNomUrl(-1); + } + } elseif ($key == 'fk_user_assign') { + if ($object->fk_user_assign > 0) { + if (isset($conf->cache['user'][$object->fk_user_assign])) { + $user_temp = $conf->cache['user'][$object->fk_user_assign]; + } else { + $user_temp = new User($db); + $user_temp->fetch($object->fk_user_assign); + $conf->cache['user'][$object->fk_user_assign] = $user_temp; + } + print $user_temp->getNomUrl(-1); } } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); @@ -998,6 +1029,12 @@ while ($i < min($num, $limit)) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; } + if (!isset($totalarray['val'])) { + $totalarray['val'] = array(); + } + if (!isset($totalarray['val']['t.'.$key])) { + $totalarray['val']['t.'.$key] = 0; + } $totalarray['val']['t.'.$key] += $obj->$key; } } diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index c3e70def7da..68615424abf 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -76,16 +76,14 @@ if (!$action) { $action = 'view'; } +$permissiontoadd = $user->rights->ticket->write; // Security check $id = GETPOST("id", 'int'); $socid = 0; -//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. -$result = restrictedArea($user, 'ticket', $id, ''); +if ($user->socid > 0) $socid = $user->socid; +$result = restrictedArea($user, 'ticket', $object->id, ''); -if (!$user->rights->ticket->read) { - accessforbidden(); -} // restrict access for externals users if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { accessforbidden(); @@ -96,7 +94,6 @@ if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && } - /* * Actions */ diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 9f6e1cc5471..6e87cd42854 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -46,8 +46,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -223,11 +222,13 @@ print '
    '.$langs->trans('NatureOfThirdParty').''; + print $socstat->getTypeUrl(1); + print '
    '; @@ -765,19 +779,19 @@ foreach ($object->fields as $key => $val) { if (!empty($arrayfields['t.'.$key]['checked'])) { if ($key == 'type_code') { print ''; - $formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectTypesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); print ''; - $formTicket->selectGroupTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); print ''; - $formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); + $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key.'', '', 2, 1, 1, 0, ($val['css'] ? $val['css'] : 'maxwidth150')); print ''; - print $form->select_dolusers($search[$key], 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth125')); + print $form->select_dolusers((empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, 1, null, 0, '', '', '0', 0, 0, '', 0, '', ($val['css'] ? $val['css'] : 'maxwidth125')); print ''; //var_dump($arrayofstatus);var_dump($search['fk_statut']);var_dump(array_values($search[$key])); $selectedarray = null; - if ($search[$key]) { + if (!empty($search[$key])) { $selectedarray = array_values($search[$key]); } - print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'minwidth100 maxwidth150', 1, 0, '', '', ''); + print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'minwidth100imp maxwidth150', 1, 0, '', '', ''); print '
    '; print ''; // Company print ''; // User print ''; -print ''; +print ''; print '
    '.$langs->trans("Filter").'
    '.$langs->trans("ThirdParty").''; -print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print '
    '.$langs->trans("CreatedBy").''; -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); // Status print '
    '.$langs->trans("Status").''; $liststatus = $object->fields['fk_statut']['arrayofkeyval']; @@ -244,7 +245,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
    '; print ''; print '

    '; diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 3faf6dc770c..928db5449d8 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -188,7 +188,7 @@ print ''; print ""; print ""; print ""; -print "'; +print "'; print "'; print ''; print ""; @@ -206,15 +206,15 @@ while ($i <= $MAXAGENDA) { print '"; // Name $name_value = (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) : (empty($object->conf->$name) ? '' : $object->conf->$name)); - print ''; + print ''; // URL $src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src)); - print ''; + print ''; // Offset TZ $offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz)); print ''; // Color (Possible colors are limited by Google) - print '
    ".$langs->trans("Parameter")."".$langs->trans("Name")."".$langs->trans("ExtSiteUrlAgenda").'
    '." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)
    ".$langs->trans("ExtSiteUrlAgenda").'
    '." (".$langs->trans("Example").': https://externalcalendar/agenda/agenda.ics)
    ".$form->textwithpicto($langs->trans("FixTZ"), $langs->trans("FillFixTZOnlyIfRequired"), 1).''.$langs->trans("Color").'
    '.$langs->trans("AgendaExtNb", $key)."'; + print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); $color_value = (GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : (empty($object->conf->$color) ? 'ffffff' : $object->conf->$color)); print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset'); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 356e23a5de0..0eaf3d533a9 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -59,6 +59,29 @@ if ($user->socid > 0) { $socid = $user->socid; } $feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user'); + +$object = new User($db); +if ($id > 0 || !empty($ref)) { + $result = $object->fetch($id, $ref, '', 1); + $object->getrights(); +} + +$account = new UserBankAccount($db); +if (!$bankid) { + $account->fetch(0, '', $id); +} else { + $account->fetch($bankid); +} +if (empty($account->userid)) { + $account->userid = $object->id; +} + + +// Define value to know what current user can do on users +$canadduser = (!empty($user->admin) || $user->rights->user->user->creer); +$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire); +$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer)); + // Ok if user->rights->salaries->read or user->rights->hrm->read //$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2); $ok = false; @@ -78,30 +101,12 @@ if (!$ok) { accessforbidden(); } -$object = new User($db); -if ($id > 0 || !empty($ref)) { - $result = $object->fetch($id, $ref, '', 1); - $object->getrights(); -} - -$account = new UserBankAccount($db); -if (!$bankid) { - $account->fetch(0, '', $id); -} else { - $account->fetch($bankid); -} -if (empty($account->userid)) { - $account->userid = $object->id; -} - -$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer)); - /* * Actions */ -if ($action == 'add' && !$cancel) { +if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) { $account->userid = $object->id; $account->bank = GETPOST('bank', 'alpha'); @@ -128,7 +133,7 @@ if ($action == 'add' && !$cancel) { } } -if ($action == 'update' && !$cancel) { +if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) { $account->userid = $object->id; /* @@ -199,7 +204,7 @@ if ($action == 'update' && !$cancel) { } // update personal email -if ($action == 'setpersonal_email') { +if ($action == 'setpersonal_email' && $canadduser) { $object->personal_email = (string) GETPOST('personal_email', 'alphanohtml'); $result = $object->update($user); if ($result < 0) { @@ -208,7 +213,7 @@ if ($action == 'setpersonal_email') { } // update personal mobile -if ($action == 'setpersonal_mobile') { +if ($action == 'setpersonal_mobile' && $canadduser) { $object->personal_mobile = (string) GETPOST('personal_mobile', 'alphanohtml'); $result = $object->update($user); if ($result < 0) { @@ -216,25 +221,26 @@ if ($action == 'setpersonal_mobile') { } } -// update default_c_exp_tax_cat -if ($action == 'setdefault_c_exp_tax_cat') { - $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int'); - $result = $object->update($user); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); +if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { + // update default_c_exp_tax_cat + if ($action == 'setdefault_c_exp_tax_cat' && $canadduser) { + $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int'); + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + // update default range + if ($action == 'setdefault_range' && $canadduser) { + $object->default_range = GETPOST('default_range', 'int'); + $result = $object->update($user); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } } } -// update default range -if ($action == 'setdefault_range') { - $object->default_range = GETPOST('default_range', 'int'); - $result = $object->update($user); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } -} - - /* * View @@ -360,12 +366,12 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $payment_salary = new PaymentSalary($db); $salary = new Salary($db); - $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, SUM(ps.amount) as alreadypaid"; + $sql = "SELECT s.rowid as sid, s.ref as sref, s.label, s.datesp, s.dateep, s.paye, s.amount, SUM(ps.amount) as alreadypaid"; $sql .= " FROM ".MAIN_DB_PREFIX."salary as s"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."payment_salary as ps ON (s.rowid = ps.fk_salary)"; $sql .= " WHERE s.fk_user = ".$object->id; $sql .= " AND s.entity IN (".getEntity('salary').")"; - $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye"; + $sql .= " GROUP BY s.rowid, s.ref, s.label, s.datesp, s.dateep, s.paye, s.amount"; $sql .= " ORDER BY s.dateep DESC"; $resql = $db->query($sql); @@ -375,7 +381,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''; print ''; - print ''; print '\n"; - print ''; + print ''; print ''; $i++; } @@ -554,7 +556,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print_liste_field_titre("RIB"); print_liste_field_titre("IBAN"); print_liste_field_titre("BIC"); - print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', '', '', 'maxwidthsearch '); print "\n"; if ($account->id > 0) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 332c98f56da..cb7aa69949c 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -87,6 +87,8 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $caneditgroup = (!empty($user->admin) || $user->rights->user->group_advance->write); } +$childids = $user->getAllChildIds(1); // For later, test on salary visibility + // Define value to know what current user can do on properties of edited user if ($id) { // $user is the current logged user, $id is the user we want to edit @@ -109,7 +111,7 @@ if ($user->id <> $id && !$canreaduser) { } // Load translation files required by page -$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm', 'stocks')); +$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm', 'stocks', 'other')); $object = new User($db); $extrafields = new ExtraFields($db); @@ -137,7 +139,7 @@ if ($reshook < 0) { if (empty($reshook)) { if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) { - if ($id <> $user->id) { // A user can't disable itself + if ($id != $user->id) { // A user can't disable itself $object->fetch($id); if ($object->admin && empty($user->admin)) { // If user to delete is an admin user and if logged user is not admin, we deny the operation. @@ -150,10 +152,11 @@ if (empty($reshook)) { } } } + if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) { $error = 0; - if ($id <> $user->id) { + if ($id != $user->id) { $object->fetch($id); if (!empty($conf->file->main_limit_users)) { @@ -173,7 +176,7 @@ if (empty($reshook)) { } if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) { - if ($id <> $user->id) { + if ($id != $user->id) { if (!GETPOSTISSET('token')) { print 'Error, token required for this critical operation'; exit; @@ -311,8 +314,8 @@ if (empty($reshook)) { $id = $object->create($user); if ($id > 0) { - if (GETPOST('password')) { - $object->setPassword($user, GETPOST('password')); + if (GETPOST('password', 'none')) { + $object->setPassword($user, GETPOST('password', 'none')); } if (!empty($conf->categorie->enabled)) { // Categories association @@ -444,16 +447,22 @@ if (empty($reshook)) { $object->lang = GETPOST('default_lang', 'aZ09'); - if (!empty($conf->multicompany->enabled)) { - if (GETPOST("superadmin")) { - $object->entity = 0; - } elseif (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - $object->entity = 1; // all users in master entity + // Do we update also ->entity ? + if (!empty($conf->multicompany->enabled)) { // If multicompany is not enabled, we never update the entity of a user. + if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { + $object->entity = 1; // all users are in master entity } else { - $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); + // A user should not be able to move a user into another entity. Only superadmin should be able to do this. + if ($user->entity == 0 && $user->admin) { + if (GETPOST("superadmin")) { + // We try to set the user as superadmin. + $object->entity = 0; + } else { + // We try to change the entity of user + $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $object->entity); + } + } } - } else { - $object->entity = (!GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int')); } // Fill array 'array_options' with data from add form @@ -615,8 +624,8 @@ if (empty($reshook)) { } // Action initialisation donnees depuis record LDAP - if ($action == 'adduserldap') { - $selecteduser = $_POST['users']; + if ($action == 'adduserldap' && $canadduser) { + $selecteduser = GETPOST('users'); $required_fields = array( $conf->global->LDAP_KEY_USERS, @@ -1031,6 +1040,7 @@ if ($action == 'create' || $action == 'adduserldap') { // State if (empty($conf->global->USER_DISABLE_STATE)) { print ''; } @@ -1110,7 +1120,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Accountancy code - if ($conf->accounting->enabled) { + if (!empty($conf->accounting->enabled)) { print ''; print ''; + print ''; print ''; @@ -1163,7 +1174,7 @@ if ($action == 'create' || $action == 'adduserldap') { print $langs->trans("Note"); print '\n"; @@ -1194,7 +1205,8 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print ''; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) + if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { $langs->load("salaries"); @@ -1385,7 +1397,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (!empty($object->ldap_sid) && $object->statut == 0) { print ''; } else { - print ''; + print ''; } print ''."\n"; @@ -1409,10 +1421,12 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->socid > 0) { $type = $langs->trans("External"); } + print ''; print $type; if ($object->ldap_sid) { print ' ('.$langs->trans("DomainUser").')'; } + print ''; print ''."\n"; // Ldap sid @@ -1423,7 +1437,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Employee - print ''."\n"; @@ -1437,8 +1451,12 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("None").''; } else { $huser = new User($db); - $huser->fetch($object->fk_user); - print $huser->getNomUrl(1); + if ($object->fk_user > 0) { + $huser->fetch($object->fk_user); + print $huser->getNomUrl(1); + } else { + print ''.$langs->trans("None").''; + } } print ''; print "\n"; @@ -1492,9 +1510,8 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print ''."\n"; - //$childids = $user->getAllChildIds(1); - - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) + if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { // Even a superior can't see this info of its subordinates wihtout $user->rights->salaries->read and $user->rights->hrm->employee->read (setting/viewing is reserverd to HR people). // However, he can see the valuation of timesheet of its subordinates even without these permissions. @@ -1523,7 +1540,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Salary print ''; print ''; print "\n"; } @@ -1557,7 +1574,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "\n"; // Accountancy code - if ($conf->accounting->enabled) { + if (!empty($conf->accounting->enabled)) { print ''; print ''; } @@ -1590,13 +1607,15 @@ if ($action == 'create' || $action == 'adduserldap') { // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { + $langs->load("languages"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''; } @@ -1767,17 +1786,14 @@ if ($action == 'create' || $action == 'adduserldap') { print ''."\n"; // API key - if (!empty($conf->api->enabled) && $user->admin) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) { print ''; print ''; } @@ -1786,7 +1802,9 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->datepreviouslogin) { print dol_print_date($object->datepreviouslogin, "dayhour").' ('.$langs->trans("Previous").'), '; } - print dol_print_date($object->datelastlogin, "dayhour").' ('.$langs->trans("Current").')'; + if ($object->datelastlogin) { + print dol_print_date($object->datelastlogin, "dayhour").' ('.$langs->trans("Currently").')'; + } print ''; print "\n"; @@ -2147,7 +2165,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print ''; print ''; print '\n"; // API key - if (!empty($conf->api->enabled) && $user->admin) { + if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) { print ''; print '".''; print '".''; print '".''; print '".'global->USER_MAIL_REQUIRED) ? ' class="fieldrequired"' : '').'>'.$langs->trans("EMail").''; print ''; print '
    '; + print ''; print ''; @@ -383,16 +389,17 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - $payment_salary->id = $objp->rowid; - $payment_salary->ref = $objp->ref; - $payment_salary->datep = $db->jdate($objp->datep); - $salary->id = $objp->sid; $salary->ref = $objp->sref ? $objp->sref : $objp->sid; $salary->label = $objp->label; $salary->datesp = $db->jdate($objp->datesp); $salary->dateep = $db->jdate($objp->dateep); $salary->paye = $objp->paye; + $salary->amount = $objp->amount; + + $payment_salary->id = $objp->rowid; + $payment_salary->ref = $objp->ref; + $payment_salary->datep = $db->jdate($objp->datep); print ''; print '\n"; print '\n"; - //print ''; + print ''; print ''; print ''; @@ -410,7 +417,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $db->free($resql); if ($num <= 0) { - print '
    '.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.''; print '
    '.$langs->trans("LastSalaries", ($num <= $MAXLIST ? "" : $MAXLIST)).''.$langs->trans("AllSalaries").''.$num.'
    '; @@ -401,7 +408,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac print ''.dol_print_date($db->jdate($objp->datesp), 'day')."'.dol_print_date($db->jdate($objp->dateep), 'day')."'.price($objp->amount).''.price($objp->amount).''.$salary->getLibStatut(5, $objp->alreadypaid).'
    '.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
    "; } else { @@ -418,9 +425,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last holidays - */ + // Latest leave requests if (!empty($conf->holiday->enabled) && ($user->rights->holiday->readall || ($user->rights->holiday->read && $object->id == $user->id)) ) { @@ -472,9 +477,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac } } - /* - * Last expense report - */ + // Latest expense report if (!empty($conf->expensereport->enabled) && ($user->rights->expensereport->readall || ($user->rights->expensereport->lire && $object->id == $user->id)) ) { @@ -503,14 +506,13 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac $exp->id = $objp->rowid; $exp->ref = $objp->ref; - $exp->fk_type = $objp->fk_type; $exp->status = $objp->status; print '
    '; print $exp->getNomUrl(1); print ''.dol_print_date($db->jdate($objp->date_debut), 'day')."'.price($objp->total_ttc).''.price($objp->total_ttc).''.$exp->LibStatut($objp->status, 5).'
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); print '
    '.$langs->trans("AccountancyCode").''; print ''; @@ -1134,7 +1144,8 @@ if ($action == 'create' || $action == 'adduserldap') { } if (!empty($conf->global->MAIN_MULTILANGS)) { - print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; + print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; print img_picto('', 'language').$formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->lang ? $object->lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone'); print '
    '; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); + $doleditor = new DolEditor('note', GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : '', '', 120, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print "
    '.$langs->trans("LoginAccountDisableInDolibarr").''.$object->login.''.showValueWithClipboardCPButton($object->login).'
    '.$langs->trans("Employee").''; + print '
    '.$langs->trans("Employee").''; print 'employee ? ' checked="checked"' : '').'>'; //print yn($object->employee); print '
    '.dol_escape_htmltag($object->job).'
    '.$langs->trans("Salary").''; - print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : ''); + print ($object->salary != '' ? img_picto('', 'salary', 'class="pictofixedwidth paddingright"').''.price($object->salary, '', $langs, 1, -1, -1, $conf->currency) : '').''; print '
    '.$langs->trans("AccountancyCode").''.$object->accountancy_code.'
    '.$langs->trans("DefaultLang").''; + print '
    '; + print $form->textwithpicto($langs->trans("DefaultLang"), $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))); + print ''; //$s=picto_from_langcode($object->default_lang); //print ($s?$s.' ':''); - $langs->load("languages"); $labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : ''); - print $form->textwithpicto($labellang, $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))); + print $labellang; print '
    '.$langs->trans("ApiKey").''; if (!empty($object->api_key)) { print ''; - print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); + print showValueWithClipboardCPButton($object->api_key, 1, $langs->trans("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste print ''; } - if ($user->admin || $user->id == $object->id) { - // TODO Add a feature to reveal the hash - } print '
    '.$langs->trans("HierarchicalResponsible").''; if ($caneditfield) { - print img_picto('', 'user').$form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); + print img_picto('', 'user').$form->select_dolusers($object->fk_user, 'fk_user', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); } else { print ''; $huser = new User($db); @@ -2165,7 +2183,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; if ($caneditfield) { - print img_picto('', 'user').$form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); + print img_picto('', 'user').$form->select_dolusers($object->fk_user_expense_validator, 'fk_user_expense_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); } else { print ''; $evuser = new User($db); @@ -2184,7 +2202,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; if ($caneditfield) { - print img_picto('', 'user').$form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'maxwidth300'); + print img_picto('', 'user').$form->select_dolusers($object->fk_user_holiday_validator, 'fk_user_holiday_validator', 1, array($object->id), 0, '', 0, $object->entity, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); } else { print ''; $hvuser = new User($db); @@ -2291,7 +2309,7 @@ if ($action == 'create' || $action == 'adduserldap') { print "
    '.$langs->trans("ApiKey").''; print ''; @@ -2352,6 +2370,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (empty($conf->global->USER_DISABLE_STATE)) { print '
    '.$form->editfieldkey('State', 'state_id', '', $object, 0).''; if ($caneditfield) { + print img_picto('', 'state', 'class="pictofixedwidth"'); print $formcompany->select_state($object->state_id, $object->country_code, 'state_id'); } else { print $object->state_label; @@ -2362,7 +2381,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Tel pro print "
    '.$langs->trans("PhonePro").''; - print img_picto('', 'object_phoning'); + print img_picto('', 'phoning', 'class="pictofixedwidth"'); if ($caneditfield && empty($object->ldap_sid)) { print ''; } else { @@ -2374,7 +2393,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Tel mobile print "
    '.$langs->trans("PhoneMobile").''; - print img_picto('', 'object_phoning_mobile'); + print img_picto('', 'phoning_mobile', 'class="pictofixedwidth"'); if ($caneditfield && empty($object->ldap_sid)) { print ''; } else { @@ -2386,7 +2405,7 @@ if ($action == 'create' || $action == 'adduserldap') { // Fax print "
    '.$langs->trans("Fax").''; - print img_picto('', 'object_phoning_fax'); + print img_picto('', 'phoning_fax', 'class="pictofixedwidth"'); if ($caneditfield && empty($object->ldap_sid)) { print ''; } else { @@ -2398,7 +2417,7 @@ if ($action == 'create' || $action == 'adduserldap') { // EMail print "
    '; - print img_picto('', 'object_email'); + print img_picto('', 'object_email', 'class="pictofixedwidth"'); if ($caneditfield && empty($object->ldap_sid)) { print ''; } else { @@ -2413,10 +2432,10 @@ if ($action == 'create' || $action == 'adduserldap') { print '
    '.$langs->trans($value['label']).''; if (!empty($value['icon'])) { - print ''; + print ''; } if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { print ''; print $object->socialnetworks[$key]; @@ -2445,12 +2464,12 @@ if ($action == 'create' || $action == 'adduserldap') { print '

    '; // Accountancy code - if ($conf->accounting->enabled) { + if (!empty($conf->accounting->enabled)) { print ""; print ''; print ''; print ''; print ''; } @@ -2613,14 +2632,15 @@ if ($action == 'create' || $action == 'adduserldap') { print ''; print ''; - if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) + if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($id, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { $langs->load("salaries"); @@ -2718,16 +2738,15 @@ if ($action == 'create' || $action == 'adduserldap') { if ($action != 'edit' && $action != 'presend') { print '
    '; - /* - * Generated documents - */ + + // Generated documents $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->user->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $user->rights->user->user->lire; $delallowed = $user->rights->user->user->creer; - print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('user', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', empty($soc->default_lang) ? '' : $soc->default_lang); $somethingshown = $formfile->numoffiles; // Show links to link elements @@ -2741,7 +2760,6 @@ if ($action == 'create' || $action == 'adduserldap') { $formactions = new FormActions($db); $somethingshown = $formactions->showactions($object, 'user', $socid, 1); - print '
    '; } diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 6081c3d294f..e0cbd849092 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -21,6 +21,7 @@ use Luracast\Restler\RestException; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; + /** * API class for users * @@ -47,6 +48,7 @@ class Users extends DolibarrApi public function __construct() { global $db, $conf; + $this->db = $db; $this->useraccount = new User($this->db); } @@ -68,9 +70,9 @@ class Users extends DolibarrApi */ public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $category = 0, $sqlfilters = '') { - global $db, $conf; + global $conf; - if (!DolibarrApiAccess::$user->rights->user->user->lire && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, "You are not allowed to read list of users"); } @@ -91,7 +93,7 @@ class Users extends DolibarrApi // Select products of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$this->db->escape($category); + $sql .= " AND c.fk_categorie = ".((int) $category); $sql .= " AND c.fk_user = t.rowid"; } @@ -246,8 +248,8 @@ class Users extends DolibarrApi * * @url GET /info * - * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) - * @return array|mixed Data without useless information + * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) + * @return array|mixed Data without useless information * * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found @@ -369,11 +371,9 @@ class Users extends DolibarrApi if ($field == 'pass') { if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) { throw new RestException(401, 'You are not allowed to modify password of other users'); - continue; } if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) { throw new RestException(401, 'You are not allowed to modify your own password'); - continue; } } if (DolibarrApiAccess::$user->admin) { // If user for API is admin @@ -423,12 +423,12 @@ class Users extends DolibarrApi */ public function getGroups($id) { - $obj_ret = array(); - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(403); } + $obj_ret = array(); + $user = new User($this->db); $result = $user->fetch($id); if (!$result) { @@ -512,13 +512,13 @@ class Users extends DolibarrApi */ public function listGroups($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $group_ids = 0, $sqlfilters = '') { - global $db, $conf; + global $conf; $obj_ret = array(); if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) || !empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) { - throw new RestException(401, "You are not allowed to read groups"); + throw new RestException(401, "You are not allowed to read groups"); } // case of external user, $societe param is ignored and replaced by user's socid diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 981374996cf..816d3dc3e27 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -299,6 +299,11 @@ class User extends CommonObject */ public $nb_rights; + /** + * @var array To store list of groups of user (used by API /info for example) + */ + public $user_group_list; + /** * @var array Cache array of already loaded permissions */ @@ -437,7 +442,7 @@ class User extends CommonObject if ($entity < 0) { if ((empty($conf->multicompany->enabled) || empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) && (!empty($user->entity))) { - $sql .= " WHERE u.entity IN (0,".$conf->entity.")"; + $sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")"; } else { $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database } @@ -446,7 +451,7 @@ class User extends CommonObject if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { $sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database } else { - $sql .= " WHERE u.entity IN (0, ".(($entity != '' && $entity >= 0) ? $entity : $conf->entity).")"; // search in entity provided in parameter + $sql .= " WHERE u.entity IN (0, ".((int) (($entity != '' && $entity >= 0) ? $entity : $conf->entity)).")"; // search in entity provided in parameter } } @@ -956,9 +961,9 @@ class User extends CommonObject if (!empty($conf->global->MULTICOMPANY_BACKWARD_COMPATIBILITY)) { $sql .= " AND r.entity IN (0,".(!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? "1," : "").$conf->entity.")"; } else { - $sql .= " AND ur.entity = ".$conf->entity; + $sql .= " AND ur.entity = ".((int) $conf->entity); } - $sql .= " AND ur.fk_user= ".$this->id; + $sql .= " AND ur.fk_user= ".((int) $this->id); $sql .= " AND r.perms IS NOT NULL"; if ($moduletag) { $sql .= " AND r.module = '".$this->db->escape($moduletag)."'"; @@ -1275,6 +1280,10 @@ class User extends CommonObject $langs->load("errors"); $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Login")); return -1; + } elseif (preg_match('/[,@<>"\']/', $this->login)) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorBadCharIntoLoginName"); + return -1; } $this->datec = dol_now(); @@ -1282,86 +1291,97 @@ class User extends CommonObject $error = 0; $this->db->begin(); - $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user"; - $sql .= " WHERE login ='".$this->db->escape($this->login)."'"; - $sql .= " AND entity IN (0,".$this->db->escape($conf->entity).")"; + // Check if login already exists in same entity or into entity 0. + if ($this->login) { + $sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND login = '".$this->db->escape($this->login)."'"; + $resqltochecklogin = $this->db->query($sqltochecklogin); + if ($resqltochecklogin) { + $objtochecklogin = $this->db->fetch_object($resqltochecklogin); + if ($objtochecklogin && $objtochecklogin->nb > 0) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorLoginAlreadyExists", $this->login); + dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG); + $this->db->rollback(); + return -6; + } + $this->db->free($resqltochecklogin); + } + } + if ($this->email !== '') { + $sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND email = '".$this->db->escape($this->email)."'"; + $resqltochecklogin = $this->db->query($sqltochecklogin); + if ($resqltochecklogin) { + $objtochecklogin = $this->db->fetch_object($resqltochecklogin); + if ($objtochecklogin && $objtochecklogin->nb > 0) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorEmailAlreadyExists", $this->email); + dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG); + $this->db->rollback(); + return -6; + } + $this->db->free($resqltochecklogin); + } + } + + // Insert into database + $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec, login, ldap_sid, entity)"; + $sql .= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; + $result = $this->db->query($sql); dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - $this->db->free($resql); + if ($result) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user"); - if ($num) { - $this->error = 'ErrorLoginAlreadyExists'; - dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); + // Set default rights + if ($this->set_default_rights() < 0) { + $this->error = 'ErrorFailedToSetDefaultRightOfUser'; $this->db->rollback(); - return -6; - } else { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login,ldap_sid,entity)"; - $sql .= " VALUES('".$this->db->idate($this->datec)."','".$this->db->escape($this->login)."','".$this->db->escape($this->ldap_sid)."',".$this->db->escape($this->entity).")"; - $result = $this->db->query($sql); + return -5; + } - dol_syslog(get_class($this)."::create", LOG_DEBUG); - if ($result) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."user"); + if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER) && !empty($conf->global->STOCK_USERSTOCK_AUTOCREATE)) { + require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; + $langs->load("stocks"); + $entrepot = new Entrepot($this->db); + $entrepot->label = $langs->trans("PersonalStock", $this->getFullName($langs)); + $entrepot->libelle = $entrepot->label; // For backward compatibility + $entrepot->description = $langs->trans("ThisWarehouseIsPersonalStock", $this->getFullName($langs)); + $entrepot->statut = 1; + $entrepot->country_id = $mysoc->country_id; + $warehouseid = $entrepot->create($user); - // Set default rights - if ($this->set_default_rights() < 0) { - $this->error = 'ErrorFailedToSetDefaultRightOfUser'; - $this->db->rollback(); - return -5; - } + $this->fk_warehouse = $warehouseid; + } - if (!empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER) && !empty($conf->global->STOCK_USERSTOCK_AUTOCREATE)) { - require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; - $langs->load("stocks"); - $entrepot = new Entrepot($this->db); - $entrepot->label = $langs->trans("PersonalStock", $this->getFullName($langs)); - $entrepot->libelle = $entrepot->label; // For backward compatibility - $entrepot->description = $langs->trans("ThisWarehouseIsPersonalStock", $this->getFullName($langs)); - $entrepot->statut = 1; - $entrepot->country_id = $mysoc->country_id; - $warehouseid = $entrepot->create($user); + // Update minor fields + $result = $this->update($user, 1, 1); + if ($result < 0) { + $this->db->rollback(); + return -4; + } - $this->fk_warehouse = $warehouseid; - } - - // Update minor fields - $result = $this->update($user, 1, 1); - if ($result < 0) { - $this->db->rollback(); - return -4; - } - - if (!$notrigger) { - // Call trigger - $result = $this->call_trigger('USER_CREATE', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } - - if (!$error) { - $this->db->commit(); - return $this->id; - } else { - //$this->error=$interface->error; - dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); - $this->db->rollback(); - return -3; - } - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return -2; + if (!$notrigger) { + // Call trigger + $result = $this->call_trigger('USER_CREATE', $user); + if ($result < 0) { + $error++; } + // End call triggers + } + + if (!$error) { + $this->db->commit(); + return $this->id; + } else { + //$this->error=$interface->error; + dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); + $this->db->rollback(); + return -3; } } else { $this->error = $this->db->lasterror(); $this->db->rollback(); - return -1; + return -2; } } @@ -1413,10 +1433,10 @@ class User extends CommonObject $result = $this->create($user, 1); if ($result > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_socpeople=".$contact->id; + $sql .= " SET fk_socpeople=".((int) $contact->id); $sql .= ", civility='".$this->db->escape($contact->civility_code)."'"; if ($contact->socid > 0) { - $sql .= ", fk_soc=".$contact->socid; + $sql .= ", fk_soc=".((int) $contact->socid); } $sql .= " WHERE rowid=".((int) $this->id); @@ -1512,7 +1532,7 @@ class User extends CommonObject if ($result > 0 && $member->fk_soc) { // If member is linked to a thirdparty $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_soc=".$member->fk_soc; + $sql .= " SET fk_soc=".((int) $member->fk_soc); $sql .= " WHERE rowid=".((int) $this->id); dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); @@ -1586,12 +1606,12 @@ class User extends CommonObject /** * Update a user into database (and also password if this->pass is defined) * - * @param User $user User qui fait la mise a jour - * @param int $notrigger 1 ne declenche pas les triggers, 0 sinon + * @param User $user User making update + * @param int $notrigger 1=do not execute triggers, 0 by default * @param int $nosyncmember 0=Synchronize linked member (standard info), 1=Do not synchronize linked member * @param int $nosyncmemberpass 0=Synchronize linked member (password), 1=Do not synchronize linked member * @param int $nosynccontact 0=Synchronize linked contact, 1=Do not synchronize linked contact - * @return int <0 si KO, >=0 si OK + * @return int <0 if KO, >=0 if OK */ public function update($user, $notrigger = 0, $nosyncmember = 0, $nosyncmemberpass = 0, $nosynccontact = 0) { @@ -1653,10 +1673,44 @@ class User extends CommonObject $langs->load("errors"); $this->error = $langs->trans("ErrorFieldRequired", 'Login'); return -1; + } elseif (preg_match('/[,@<>"\']/', $this->login)) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorBadCharIntoLoginName"); + return -1; } $this->db->begin(); + // Check if login already exists in same entity or into entity 0. + if (!empty($this->oldcopy) && $this->oldcopy->login != $this->login) { + $sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND login = '".$this->db->escape($this->login)."'"; + $resqltochecklogin = $this->db->query($sqltochecklogin); + if ($resqltochecklogin) { + $objtochecklogin = $this->db->fetch_object($resqltochecklogin); + if ($objtochecklogin && $objtochecklogin->nb > 0) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorLoginAlreadyExists", $this->login); + dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG); + $this->db->rollback(); + return -1; + } + } + } + if (!empty($this->oldcopy) && $this->email !== '' && $this->oldcopy->email != $this->email) { + $sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND email = '".$this->db->escape($this->email)."'"; + $resqltochecklogin = $this->db->query($sqltochecklogin); + if ($resqltochecklogin) { + $objtochecklogin = $this->db->fetch_object($resqltochecklogin); + if ($objtochecklogin && $objtochecklogin->nb > 0) { + $langs->load("errors"); + $this->error = $langs->trans("ErrorEmailAlreadyExists", $this->email); + dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG); + $this->db->rollback(); + return -1; + } + } + } + // Update datas $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; $sql .= " civility = '".$this->db->escape($this->civility_code)."'"; @@ -1710,7 +1764,7 @@ class User extends CommonObject $sql .= ", salaryextra= ".($this->salaryextra != '' ? "'".$this->db->escape($this->salaryextra)."'" : "null"); } $sql .= ", weeklyhours= ".($this->weeklyhours != '' ? "'".$this->db->escape($this->weeklyhours)."'" : "null"); - $sql .= ", entity = '".$this->db->escape($this->entity)."'"; + $sql .= ", entity = ".((int) $this->entity); $sql .= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); $sql .= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); $sql .= ", fk_warehouse = ".($this->fk_warehouse > 0 ? $this->fk_warehouse : "null"); @@ -2063,8 +2117,8 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) - $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); + && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) + $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } if ($this->conf->MAIN_LANG_DEFAULT) { @@ -2138,7 +2192,7 @@ class User extends CommonObject '', '', $trackid - ); + ); if ($mailfile->sendfile()) { return 1; @@ -2558,11 +2612,13 @@ class User extends CommonObject /** * Return clickable link of login (eventualy with picto) * - * @param int $withpicto Include picto into link - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpictoimg Include picto into link + * @param string $option On what the link point to ('leave', 'accountancy', 'nolink', ) + * @param integer $notooltip 1=Disable tooltip on picto and name + * @param string $morecss Add more css on link + * @return string String with URL */ - public function getLoginUrl($withpicto = 0, $option = '') + public function getLoginUrl($withpictoimg = 0, $option = '', $notooltip = 0, $morecss = '') { global $langs, $user; @@ -2587,11 +2643,23 @@ class User extends CommonObject } $result .= $linkstart; - if ($withpicto) { - $result .= img_object($langs->trans("ShowUser"), 'user', 'class="paddingright"'); + if ($withpictoimg) { + $paddafterimage = ''; + if (abs($withpictoimg) == 1) { + $paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"'; + } + // Only picto + if ($withpictoimg > 0) { + $picto = ''.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="paddingright classfortooltip"'), 0, 0, $notooltip ? 0 : 1).''; + } else { + // Picto must be a photo + $picto = ''.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1).''; + } + $result .= $picto; } $result .= $this->login; $result .= $linkend; + return $result; } @@ -3162,7 +3230,7 @@ class User extends CommonObject foreach ($this->users as $key => $val) { if (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])) { - unset($this->users[$key]); + unset($this->users[$key]); } } } @@ -3238,7 +3306,7 @@ class User extends CommonObject $i = 0; $cursor_user = $id_user; $useridfound = array($id_user); - while (!empty($this->parentof[$cursor_user])) { + while (!empty($this->parentof[$cursor_user]) && !empty($this->users[$this->parentof[$cursor_user]])) { if (in_array($this->parentof[$cursor_user], $useridfound)) { dol_syslog("The hierarchy of user has a recursive loop", LOG_WARNING); return -1; // Should not happen. Protection against looping hierarchy diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index cacaeb54fc1..1f0bb2891c6 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -194,7 +194,7 @@ class UserGroup extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g,"; $sql .= " ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql .= " WHERE ug.fk_usergroup = g.rowid"; - $sql .= " AND ug.fk_user = ".$userid; + $sql .= " AND ug.fk_user = ".((int) $userid); if (!empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && !$user->entity) { $sql .= " AND g.entity IS NOT NULL"; } else { @@ -359,7 +359,7 @@ class UserGroup extends CommonObject //print "$module-$perms-$subperms"; $sql = "SELECT id"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; - $sql .= " WHERE entity = ".$entity; + $sql .= " WHERE entity = ".((int) $entity); if (!empty($whereforadd) && $whereforadd != 'allmodules') { $sql .= " AND ".$whereforadd; } @@ -438,8 +438,8 @@ class UserGroup extends CommonObject // les caracteristiques module, perms et subperms de ce droit. $sql = "SELECT module, perms, subperms"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def"; - $sql .= " WHERE id = '".$this->db->escape($rid)."'"; - $sql .= " AND entity = ".$entity; + $sql .= " WHERE id = ".((int) $rid); + $sql .= " AND entity = ".((int) $entity); $result = $this->db->query($sql); if ($result) { @@ -454,8 +454,8 @@ class UserGroup extends CommonObject dol_print_error($this->db); } - // Where pour la liste des droits a supprimer - $wherefordel = "id=".$this->db->escape($rid); + // Where for the list of permissions to delete + $wherefordel = "id = ".((int) $rid); // Suppression des droits induits if ($subperms == 'lire' || $subperms == 'read') { $wherefordel .= " OR (module='".$this->db->escape($module)."' AND perms='".$this->db->escape($perms)."' AND subperms IS NOT NULL)"; @@ -711,7 +711,7 @@ class UserGroup extends CommonObject * Use this->id,this->lastname, this->firstname * * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) - * @param string $option On what the link point to ('nolink', ) + * @param string $option On what the link point to ('nolink', 'permissions') * @param integer $notooltip 1=Disable tooltip on picto and name * @param string $morecss Add more css on link * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking @@ -730,12 +730,16 @@ class UserGroup extends CommonObject $result = ''; $label = ''; $label .= '
    '; - $label .= ''.$langs->trans("Group").'
    '; + $label .= img_picto('', 'group').' '.$langs->trans("Group").'
    '; $label .= ''.$langs->trans('Name').': '.$this->name; $label .= '
    '.$langs->trans("Description").': '.$this->note; $label .= '
    '; - $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + if ($option == 'permissions') { + $url = DOL_URL_ROOT.'/user/group/perms.php?id='.$this->id; + } else { + $url = DOL_URL_ROOT.'/user/group/card.php?id='.$this->id; + } if ($option != 'nolink') { // Add param to save lastsearch_values or not diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 0a9a65a2852..79450f2d811 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -150,7 +150,9 @@ if ($id > 0) { if (!empty($user->admin)) { print ''; print '\n"; @@ -221,8 +223,11 @@ if ($resql) { print ''; } print ''; - print ''; + print ''; print ''; + print ''; print ''; print "\n"; $i++; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 618d705bfcf..e2c419b0543 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -22,9 +22,13 @@ /** * \file htdocs/user/group/perms.php - * \brief Onglet user et permissions de la fiche utilisateur + * \brief Page to set permissions of a user group record */ +if (!defined('CSRFCHECK_WITH_TOKEN')) { + define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET +} + require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; @@ -41,6 +45,10 @@ $module = GETPOST('module', 'alpha'); $rights = GETPOST('rights', 'int'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'groupperms'; // To manage different context of search +if (!isset($id) || empty($id)) { + accessforbidden(); +} + // Define if user can read permissions $canreadperms = ($user->admin || $user->rights->user->user->lire); // Define if user can modify group permissions @@ -53,12 +61,15 @@ if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $caneditperms = ($user->admin || $user->rights->user->group_advance->write); } +// Security check +//$result = restrictedArea($user, 'user', $id, 'usergroup', ''); if (!$canreadperms) { accessforbidden(); } $object = new Usergroup($db); $object->fetch($id); +$object->getrights(); $entity = $conf->entity; @@ -79,7 +90,7 @@ if ($reshook < 0) { if (empty($reshook)) { if ($action == 'addrights' && $caneditperms) { $editgroup = new Usergroup($db); - $result = $editgroup->fetch($id); + $result = $editgroup->fetch($object->id); if ($result > 0) { $result = $editgroup->addrights($rights, $module, '', $entity); if ($result < 0) { @@ -88,6 +99,9 @@ if (empty($reshook)) { } else { dol_print_error($db); } + + $user->clearrights(); + $user->getrights(); } if ($action == 'delrights' && $caneditperms) { @@ -101,11 +115,14 @@ if (empty($reshook)) { } else { dol_print_error($db); } + + $user->clearrights(); + $user->getrights(); } } -/** +/* * View */ @@ -114,11 +131,6 @@ $form = new Form($db); llxHeader('', $langs->trans("Permissions")); if ($object->id > 0) { - /* - * Affichage onglets - */ - $object->getrights(); // Reload permission - $head = group_prepare_head($object); $title = $langs->trans("Group"); print dol_get_fiche_head($head, 'rights', $title, -1, 'group'); @@ -165,8 +177,8 @@ if ($object->id > 0) { $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r,"; $sql .= " ".MAIN_DB_PREFIX."usergroup_rights as gr"; $sql .= " WHERE gr.fk_id = r.id"; - $sql .= " AND gr.entity = ".$entity; - $sql .= " AND gr.fk_usergroup = ".$object->id; + $sql .= " AND gr.entity = ".((int) $entity); + $sql .= " AND gr.fk_usergroup = ".((int) $object->id); dol_syslog("get user perms", LOG_DEBUG); $result = $db->query($sql); @@ -186,6 +198,10 @@ if ($object->id > 0) { dol_print_error($db); } + /* + * Part to add/remove permissions + */ + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); @@ -193,9 +209,6 @@ if ($object->id > 0) { print '
    '; print '
    '; - /* - * Ecran ajout/suppression permission - */ print '
    '.$langs->trans("AccountancyCode").''; if ($caneditfield) { - print ''; + print ''; } else { print ''; print $object->accountancy_code; @@ -2483,7 +2502,7 @@ if ($action == 'create' || $action == 'adduserldap') { if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) { print '
    '.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; - print img_picto('', 'category'); + print img_picto('', 'category', 'class="pictofixedwidth"'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_USER, null, null, null, null, 1); $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_USER); @@ -2500,8 +2519,8 @@ if ($action == 'create' || $action == 'adduserldap') { // Default language if (!empty($conf->global->MAIN_MULTILANGS)) { - print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).''."\n"; - print img_picto('', 'language').$formadmin->select_language($object->lang, 'default_lang', 0, 0, 1); + print '
    '.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0, 'string', '', 0, 0, 'id', $langs->trans("WarningNotLangOfInterface", $langs->transnoentitiesnoconv("UserGUISetup"))).''."\n"; + print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($object->lang, 'default_lang', 0, null, '1', 0, 0, 'widthcentpercentminusx maxwidth300'); print '
    '.$langs->trans("PostOrFunction").''; if ($caneditfield) { - print ''; + print ''; } else { print ''; print dol_escape_htmltag($object->job); } print '
    ClickToDial URL'; - $url = $conf->global->CLICKTODIAL_URL; + if (!empty($conf->global->CLICKTODIAL_URL)) { + $url = $conf->global->CLICKTODIAL_URL; + } if (!empty($object->clicktodial_url)) { $url = $object->clicktodial_url; } diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 297243f36ef..a5d88d04c5d 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -60,6 +60,9 @@ if ($id) { || (($user->id != $id) && $user->rights->user->user->password)); } +$permissiontoadd = $caneditfield; +$permtoedit = $caneditfield; + // Security check $socid = 0; if ($user->socid > 0) { @@ -174,10 +177,7 @@ if ($object->id) { print dol_get_fiche_end(); - $modulepart = 'user'; - $permission = $user->rights->user->user->creer; - $permtoedit = $user->rights->user->user->creer; $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php index 19b78cf06e9..5c1e16e4a0c 100644 --- a/htdocs/user/group/card.php +++ b/htdocs/user/group/card.php @@ -1,10 +1,10 @@ - * Copyright (C) 2005-2015 Laurent Destailleur - * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2011 Herve Prot - * Copyright (C) 2012 Florian Henry - * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2005-2021 Laurent Destailleur + * Copyright (C) 2005-2017 Regis Houssin + * Copyright (C) 2011 Herve Prot + * Copyright (C) 2012 Florian Henry + * Copyright (C) 2018 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ /** * \file htdocs/user/group/card.php - * \brief Onglet groupes utilisateurs + * \brief Tab of a user group */ require '../../main.inc.php'; @@ -428,6 +428,7 @@ if ($action == 'create') { * Group members */ + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; print ''; @@ -440,7 +441,7 @@ if ($action == 'create') { if (!empty($object->members)) { foreach ($object->members as $useringroup) { print ''; - print ''; } print "
    '.$langs->trans("Login").'
    '; + print ''; print $useringroup->getNomUrl(-1, '', 0, 0, 24, 0, 'login'); if ($useringroup->admin && !$useringroup->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); @@ -465,6 +466,7 @@ if ($action == 'create') { print '
    '.$langs->trans("None").'
    "; + print '
    '; } print "
    "; diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index edd34dfe9b8..04fa0035418 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2011 Herve Prot - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2021 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,8 @@ $langs->load("users"); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_group = GETPOST('search_group'); $optioncss = GETPOST('optioncss', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$contextpage = GETPOST('optioncss', 'aZ09'); // Defini si peux lire/modifier utilisateurs et permisssions $caneditperms = ($user->admin || $user->rights->user->user->creer); @@ -121,7 +123,7 @@ if (empty($reshook)) { llxHeader(); -$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; +$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec, g.tms as datem, COUNT(DISTINCT ugu.fk_user) as nb, COUNT(DISTINCT ugr.fk_id) as nbpermissions"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_rights as ugr ON ugr.fk_usergroup = g.rowid"; @@ -136,7 +138,7 @@ if (!empty($search_group)) { if ($sall) { $sql .= natural_search(array("g.nom", "g.note"), $sall); } -$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec"; +$sql .= " GROUP BY g.rowid, g.nom, g.note, g.entity, g.datec, g.tms"; $sql .= $db->order($sortfield, $sortorder); $resql = $db->query($sql); @@ -167,7 +169,6 @@ if ($resql) { print ''; print ''; print ''; - print ''; print ''; print_barre_liste($text, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, "", $num, $nbtotalofrecords, 'object_group', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -196,6 +197,7 @@ if ($resql) { print_liste_field_titre("NbOfUsers", $_SERVER["PHP_SELF"], "nb", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("NbOfPermissions", $_SERVER["PHP_SELF"], "nbpermissions", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("DateCreationShort", $_SERVER["PHP_SELF"], "g.datec", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "g.tms", $param, "", '', $sortfield, $sortorder, 'center '); print_liste_field_titre("", $_SERVER["PHP_SELF"]); print "
    '.$mc->label.''.$obj->nb.''.$obj->nbpermissions.''; + print ''.$obj->nbpermissions.''; + print ''.dol_print_date($db->jdate($obj->datec), "dayhour").''.dol_print_date($db->jdate($obj->datem), "dayhour").'
    '; @@ -235,26 +248,26 @@ if ($object->id > 0) { print ''; if ($caneditperms) { print ''; } print ''; print ''; if ($user->admin) { - print ''; + print ''; } print ''."\n"; - $sql = "SELECT r.id, r.libelle as label, r.module"; + $sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault"; $sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" - $sql .= " AND r.entity = ".$entity; + $sql .= " AND r.entity = ".((int) $entity); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { $sql .= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable } - $sql .= " ORDER BY r.module, r.id"; + $sql .= " ORDER BY r.family_position, r.module_position, r.module, r.id"; $result = $db->query($sql); if ($result) { @@ -265,13 +278,16 @@ if ($object->id > 0) { while ($i < $num) { $obj = $db->fetch_object($result); - // If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it + // If line is for a module that does not exist anymore (absent of includes/module), we ignore it if (empty($modules[$obj->module])) { $i++; continue; } - if ($oldmod <> $obj->module) { + $objMod = $modules[$obj->module]; + + // Break found, it's a new module to catch + if (isset($obj->module) && ($oldmod <> $obj->module)) { $oldmod = $obj->module; // Break detected, we get objMod @@ -286,21 +302,22 @@ if ($object->id > 0) { print ''; if ($caneditperms) { print ''; } else { print ''; } - print ''; + print ''; + print ''; // Permission id if ($user->admin) { print ''; } - print ''; + print ''."\n"; } print ''."\n"; @@ -315,7 +332,7 @@ if ($object->id > 0) { if (in_array($obj->id, $permsgroupbyentity[$entity])) { // Own permission by group if ($caneditperms) { - print ''; @@ -326,7 +343,7 @@ if ($object->id > 0) { } else { // Do not own permission if ($caneditperms) { - print ''; @@ -336,7 +353,7 @@ if ($object->id > 0) { } else { // Do not own permission if ($caneditperms) { - print ''; @@ -344,12 +361,25 @@ if ($object->id > 0) { print ''; } - $permlabel = ($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); - print ''; + // Description of permission + $permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); + print ''; // Permission id if ($user->admin) { - print ''; + print ''; } print ''."\n"; diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php index 6073ca4c88f..0413fda69b0 100644 --- a/htdocs/user/hierarchy.php +++ b/htdocs/user/hierarchy.php @@ -42,9 +42,11 @@ if ($user->socid > 0) { $socid = $user->socid; } -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_user = GETPOST('search_user', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); +$contextpage = GETPOST('optioncss', 'aZ09'); +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); // Load mode employee $mode = GETPOST("mode", 'alpha'); @@ -94,7 +96,7 @@ if (!is_array($user_arbo) && $user_arbo < 0) { $data[] = array('rowid'=>0, 'fk_menu'=>-1, 'title'=>"racine", 'mainmenu'=>'', 'leftmenu'=>'', 'fk_mainmenu'=>'', 'fk_leftmenu'=>''); foreach ($fulltree as $key => $val) { $userstatic->id = $val['id']; - $userstatic->ref = $val['label']; + $userstatic->ref = $val['id']; $userstatic->login = $val['login']; $userstatic->firstname = $val['firstname']; $userstatic->lastname = $val['lastname']; @@ -146,6 +148,8 @@ if (!is_array($user_arbo) && $user_arbo < 0) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu=', '', $canadduser); + $morehtmlright = ''; + $morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : '')); $param = array('morecss'=>'marginleftonly btnTitleSelected'); $morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $param); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 4a41b3fd899..fbfe4638bd5 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -62,7 +62,7 @@ $resultboxes = FormOther::getBoxesArea($user, "1"); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'aZ09'); + $zone = GETPOST('areacode', 'int'); $userid = GETPOST('userid', 'int'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index a697fdf96c0..a3b69d1dff8 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -68,7 +68,7 @@ $pagenext = $page + 1; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $object = new User($db); $extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->user->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('userlist')); // Fetch optionals attributes and labels @@ -124,9 +124,9 @@ $arrayfields = array( 'u.office_phone'=>array('label'=>"PhonePro", 'checked'=>1, 'position'=>31), 'u.user_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1, 'position'=>32), 'u.email'=>array('label'=>"EMail", 'checked'=>1, 'position'=>35), - 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>($conf->api->enabled && $user->admin)), + 'u.api_key'=>array('label'=>"ApiKey", 'checked'=>0, 'position'=>40, "enabled"=>(!empty($conf->api->enabled) && $user->admin)), 'u.fk_soc'=>array('label'=>"Company", 'checked'=>($contextpage == 'employeelist' ? 0 : 1), 'position'=>45), - 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>($conf->salaries->enabled && !empty($user->rights->salaries->readall))), + 'u.salary'=>array('label'=>"Salary", 'checked'=>1, 'position'=>80, 'enabled'=>(!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))), 'u.datelastlogin'=>array('label'=>"LastConnexion", 'checked'=>1, 'position'=>100), 'u.datepreviouslogin'=>array('label'=>"PreviousConnexion", 'checked'=>0, 'position'=>110), 'u.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), @@ -188,7 +188,7 @@ if ($mode == 'employee') { accessforbidden(); } } else { - if (!$user->rights->user->user->lire && !$user->admin) { + if (empty($user->rights->user->user->lire) && empty($user->admin)) { accessforbidden(); } } @@ -345,7 +345,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N $sql .= preg_replace('/^,/', '', $hookmanager->resPrint); $sql = preg_replace('/,\s*$/', '', $sql); $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { +if (key_exists('label', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (u.rowid = ef.fk_object)"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; @@ -423,7 +423,7 @@ if ($search_categ == -2) { $sql .= " AND cu.fk_categorie IS NULL"; } if ($search_warehouse > 0) { - $sql .= " AND u.fk_warehouse = ".$db->escape($search_warehouse); + $sql .= " AND u.fk_warehouse = ".((int) $search_warehouse); } if ($mode == 'employee' && empty($user->rights->salaries->readall)) { $sql .= " AND u.rowid IN (".$db->sanitize(join(',', $childids)).")"; @@ -571,13 +571,13 @@ print ''; $url = DOL_URL_ROOT.'/user/card.php?action=create'.($mode == 'employee' ? '&employee=1' : '').'&leftmenu='; if (!empty($socid)) { - $url .= '&socid='.$socid; + $url .= '&socid='.urlencode($socid); } $newcardbutton = dolGetButtonTitle($langs->trans('NewUser'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd); $moreparam = array('morecss'=>'btnTitleSelected'); -$morehtmlright .= dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); +$morehtmlright = dolGetButtonTitle($langs->trans("List"), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/user/list.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); $moreparam = array('morecss'=>'marginleftonly'); $morehtmlright .= dolGetButtonTitle($langs->trans("HierarchicView"), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/user/hierarchy.php'.(($search_statut != '' && $search_statut >= 0) ? '?search_statut='.$search_statut : ''), '', 1, $moreparam); @@ -681,10 +681,10 @@ if (!empty($arrayfields['u.accountancy_code']['checked'])) { print ''; } if (!empty($arrayfields['u.office_phone']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['u.user_mobile']['checked'])) { - print ''; + print ''; } if (!empty($arrayfields['u.email']['checked'])) { print ''; @@ -808,7 +808,7 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { +if (key_exists('computed', $extrafields->attributes[$object->table_element]) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object @@ -821,6 +821,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co // -------------------------------------------------------------------- $i = 0; $totalarray = array(); +$totalarray['nbfield'] = 0; $arrayofselected = is_array($toselect) ? $toselect : array(); while ($i < ($limit ? min($num, $limit) : $num)) { $obj = $db->fetch_object($resql); @@ -828,12 +829,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) { break; // Should not happen } + if (empty($obj->country_code)) $obj->country_code = ''; // TODO Add join in select with country table to get country_code + // Store properties in $object $object->setVarsFromFetchObj($obj); $userstatic->id = $obj->rowid; $userstatic->admin = $obj->admin; - $userstatic->ref = $obj->label; + $userstatic->ref = $obj->rowid; $userstatic->login = $obj->login; $userstatic->statut = $obj->statut; $userstatic->office_phone = $obj->office_phone; @@ -848,10 +851,22 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $li = $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1); + $canreadhrmdata = 0; + if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read) && in_array($obj->rowid, $childids)) + || (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall)) + || (!empty($conf->hrm->enabled) && !empty($user->rights->hrm->employee->read))) { + $canreadhrmdata = 1; + } + $canreadsecretapi = 0; + if ($user->id = $obj->rowid || !empty($user->admin)) { // Current user or admin + $canreadsecretapi = 1; + } + print ''; + // Login if (!empty($arrayfields['u.login']['checked'])) { - print ''; if (!$i) { @@ -928,33 +944,42 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalarray['nbfield']++; } } + if (!empty($arrayfields['u.office_phone']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.user_mobile']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.email']['checked'])) { - print '\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.api_key']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.fk_soc']['checked'])) { print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 469823f0358..3acad0ac0c3 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -72,7 +72,7 @@ $permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->u if ($user->socid) { $id = $user->socid; } -$result = restrictedArea($user, 'user', '', ''); +$result = restrictedArea($user, 'user', '', '', 'user'); /* @@ -437,7 +437,7 @@ if ($result > 0) { } print ''; - if ($optioncss != '') { + if (isset($optioncss) && $optioncss != '') { print ''; } print ''; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 2856f787b52..72f9b075be9 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -231,19 +231,9 @@ if ($action == 'edit') { dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin); - if (!empty($conf->use_javascript_ajax)) {/* - print '';*/ - } + print dol_get_fiche_end(); + + if (!empty($conf->use_javascript_ajax)) { print ''."\n"; llxHeader($moreheadcss.$moreheadjs, $langs->trans("WebsiteSetup"), $helpurl, '', 0, 0, $arrayofjs, $arrayofcss, '', '', ''."\n".'
    '); print "\n"; -print ''; +print ''."\n"; +print ''; print ''; print ''; @@ -2626,7 +2650,7 @@ if (!GETPOST('hide_websitemenu')) { $out .= ' jQuery("#website").change(function () {'; $out .= ' console.log("We select "+jQuery("#website option:selected").val());'; $out .= ' if (jQuery("#website option:selected").val() == \'-2\') {'; - $out .= ' window.location.href = "'.$urltocreatenewwebsite.'";'; + $out .= ' window.location.href = "'.dol_escape_js($urltocreatenewwebsite).'";'; $out .= ' } else {'; $out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website="+jQuery("#website option:selected").val();'; $out .= ' }'; @@ -4018,7 +4042,9 @@ if ($action == 'editfile' || $action == 'file_manager' || $action == 'convertimg print '

    '; //print '
    '.$langs->trans("FeatureNotYetAvailable").''; + $module = 'medias'; + $formalreadyopen = 2; // So the form to submit a new file will not be opened another time inside the core/tpl/filemanager.tpl.php if (empty($url)) { $url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param } @@ -4098,9 +4124,9 @@ if ($action == 'replacesite' || $action == 'replacesiteconfirm' || $massaction = print $langs->trans("SearchReplaceInto"); print '
    '; print '
    '; - print ' '.$langs->trans("Content").'
    '; - print ' '.$langs->trans("Title").' | '.$langs->trans("Description").' | '.$langs->trans("Keywords").'
    '; - print ' '.$langs->trans("GlobalCSSorJS").'
    '; + print '
    '; + print '
    '; + print '
    '; print '
    '; print '
    '; diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index b847f607bf3..34f6db8d044 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -149,8 +149,10 @@ if ($rss) { } if ($buildfile) { - $langs->load("other"); - $title = $desc = $langs->transnoentities('LatestBlogPosts'); + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang($l); + $outputlangs->loadLangs(array("main", "other")); + $title = $desc = $outputlangs->transnoentities('LatestBlogPosts'); // Create temp file $outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads @@ -224,9 +226,9 @@ if ($rss) { // Find the subdirectory name as the reference include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname); - $accessallowed = $check_access['accessallowed']; - $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; - $fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name + $accessallowed = empty($check_access['accessallowed']) ? '' : $check_access['accessallowed']; + $sqlprotectagainstexternals = empty($check_access['sqlprotectagainstexternals']) ? '' : $check_access['sqlprotectagainstexternals']; + $fullpath_original_file = empty($check_access['original_file']) ? '' : $check_access['original_file']; // $fullpath_original_file is now a full path name if ($hashp) { $accessallowed = 1; // When using hashp, link is public so we force $accessallowed $sqlprotectagainstexternals = ''; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 2074873a031..cf4d26b2c33 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -117,22 +117,6 @@ $formfile = new FormFile($db); llxHeader('', 'WebsiteAccount', ''); -// Example : Adding jquery code -print ''; - - // Part to create if ($action == 'create') { print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("WebsiteAccount"))); diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index d81bab42eab..5cb6baf3565 100755 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -101,7 +101,7 @@ class Workstation extends CommonObject public $fields=array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'0', 'default'=>'', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'showoncombobox'=>'1',), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'showoncombobox'=>'2',), 'type' => array('type'=>'varchar(8)', 'label'=>'Type', 'enabled'=>'1', 'position'=>32, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'arrayofkeyval'=>array('HUMAN'=>'Human', 'MACHINE'=>'Machine', 'BOTH'=>'HumanMachine'),), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 673b1db935d..5b63ca2d481 100755 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -159,7 +159,7 @@ $help_url = 'EN:Module_Workstation'; llxHeader('', $title, $help_url); -// Example : Adding jquery code +// jquery code ?>
    '.$langs->trans("Module").''; - print ''.$langs->trans("All").""; + print ''.$langs->trans("All").""; print '/'; - print ''.$langs->trans("None").""; + print ''.$langs->trans("None").""; print ' '.$langs->trans("Permissions").''.$langs->trans("ID").'
    '; - print 'module.'">'.$langs->trans("All").""; + print 'module.'&token='.newToken().'">'.$langs->trans("All").""; print '/'; - print 'module.'">'.$langs->trans("None").""; + print 'module.'&token='.newToken().'">'.$langs->trans("None").""; print '    
    id.'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print 'id.'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print 'id.'">'; + print 'id.'&confirm=yes&token='.newToken().'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ' '.$permlabel.''; + print $permlabel; + if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (preg_match('/_advance$/', $obj->perms)) { + print ' ('.$langs->trans("AdvancedModeOnly").')'; + } + } + print ''.$obj->id.''; + $htmltext = $langs->trans("ID").': '.$obj->id; + $htmltext .= '
    '.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : ''); + print $form->textwithpicto('', $htmltext); + //print ''.$obj->id.''; + print '
    '; + print ''; print $li; if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar', 'class="valignmiddle paddingleft"'); @@ -885,6 +900,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalarray['nbfield']++; } } + // Employee yes/no if (!empty($arrayfields['u.employee']['checked'])) { print ''.yn($obj->employee).'".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."".dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)."'.dol_print_email($obj->email, $obj->rowid, $obj->fk_soc, 'AC_EMAIL', 0, 0, 1)."'.$obj->api_key.''; + if ($obj->api_key) { + if ($canreadsecretapi) { + print $obj->api_key; + } else { + print ''.$langs->trans("Hidden").''; + } + } + print ''; - if ($obj->fk_soc) { + if ($obj->fk_soc > 0) { $companystatic->id = $obj->fk_soc; $companystatic->name = $obj->name; $companystatic->canvas = $obj->canvas; @@ -988,7 +1013,15 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Salary if (!empty($arrayfields['u.salary']['checked'])) { - print ''.($obj->salary ? price($obj->salary) : '').''; + if ($obj->salary) { + if ($canreadhrmdata) { + print price($obj->salary); + } else { + print ''.$langs->trans("Hidden").''; + } + } + print '