diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fed73d7b002..f112ea0523b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -56,7 +56,7 @@ You can add it to your git configuration using: git config --local commit.template .gitmessage ``` -where +where #### Keyword In uppercase if you want to have the log comment appears into the generated ChangeLog file. @@ -101,7 +101,7 @@ Long description (Can span accross multiple lines). ### Pull Requests -Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and +Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and a process to follow to optimize the chance to have PRs merged efficiently... * A PR must be atomic. It means it must contains the lower possible changes for 1 need (1 bug fix or 1 new feature) without breaking usability of code. If a PR can be split into several PRs, it often means your PR is not atomic. @@ -120,7 +120,7 @@ Once a PR has been submitted, you may need to wait for its integration. It is co If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion). -If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration. +If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration. If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet. In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR. @@ -141,7 +141,7 @@ Translations done on transifex are available in the next major release. Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History" -to retreive all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to. +to retrieve all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to. ### Resources diff --git a/.travis.yml b/.travis.yml index 16d3403f554..9d0700d3a84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,13 +124,13 @@ install: if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \ [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then composer -n require phpunit/phpunit ^5 \ - php-parallel-lint/php-parallel-lint ^0 \ + php-parallel-lint/php-parallel-lint ^1 \ php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \ - php-parallel-lint/php-parallel-lint ^1 \ + php-parallel-lint/php-parallel-lint ^1.2 \ php-parallel-lint/php-console-highlighter ^0 \ squizlabs/php_codesniffer ^3 fi @@ -428,7 +428,7 @@ script: after_script: - | - echo "After script - Output lines of dolibarr.log" + echo "After script - Output last lines of dolibarr.log" ls $TRAVIS_BUILD_DIR/documents #cat $TRAVIS_BUILD_DIR/documents/dolibarr.log sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log diff --git a/ChangeLog b/ChangeLog index 27d9129c762..2e365b4f645 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,26 +7,240 @@ English Dolibarr ChangeLog For users: NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files. NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable. +NEW: Several security issues after a private bug bounty campaign. +NEW: #15065 Fix formatting +NEW: #15065 Put the product label in bold in the PDF templates if configured +NEW: Accountancy - Add chart of sub accounts +NEW: Accountancy - Add options to disable binding on sales, purchases & expense reports independently of the modules +NEW: Accountancy balance - Add a input to show subtotal by group +NEW: Accountancy - Move to real ledger, real journals, menu disposition +NEW: Accountancy - On transfers, select the periodicity by default +NEW: Add 2 rules for emailcollector: Message send/not sent from Dolibarr +NEW: Add a counter of number of words of pages in website module +NEW: add alert before change thirdparty in takepos +NEW: Add a page to list Stock at a given date. +NEW: Add a start date to begin binding in accountancy +NEW: Add a stat page to list popularity of products on invoices +NEW: Add calendar selection for agenda view +NEW: add class for ticket edition (pdf or odt) +NEW: Add column payment term into list of supplier invoices. +NEW: Add column quantity in product margin page +NEW: Add column vat rate in page to define accounting account on product/service +NEW: Add common list function for available app/module page +NEW: add costprice in fields of products list +NEW: ADDED IMPORT TOOL FOR CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE +NEW: Added incoterms to substitution array +NEW: Add employee in expense report binding page +NEW: Add export for various payment +NEW: add extra fields labels and values in mail on create ticket +NEW: Add extrafields support on ECM module +NEW: Add filter rules "is answer" and "is not answer" in email collector +NEW: Add focus when editing on product/stock/product.php Close #14548 +NEW: add formConfirm hook on product page +NEW: add free text on each terminal of cash desk +NEW: Add function dolButtonToOpenUrlInDialogPopup() to be able to open +NEW: Add global search for customer payments and vendor payments +NEW: Add global search for miscellaneous payments +NEW: Add helper function for table headers with numbers +NEW: add hooks on stats pages +NEW: Add link to edit property from search result of website pages +NEW: Add link to reset qty on supplier dispatch page +NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header in email collector +NEW: Add Manufacturing Orders into the automatic ECM +NEW: add margin info in invoice list +NEW: Add mass action to set category on a list of website pages. +NEW: Add mass deletion for events +NEW: Add __MEMBER_TYPE__ substitution key +NEW: Add message in error_log after detection of SQL or script injection +NEW: Add module Credit transfer SEPA to manage payment of supplier using +NEW: Add more filters on monthly statement list +NEW: Add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT +NEW: Add option to define a default warehouse at user level +NEW: Add option to include products without alert in replenish +NEW: add order by lastname and firstname by default in get sales representatives +NEW: Add param to not show links when output tags +NEW: Add PDF document templates for warehouses (list of stock) +NEW: Add property cssview when declaring fields of an object +NEW: Add prospect status managment for the contact with managment of custom icon +NEW: Add public note on products. This also partially fix the #14342 +NEW: Add quick dropdown menu in top right menu (MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN) +NEW: add region in export companies and contacts +NEW: add rights on margin info on invoice list +NEW: Add search param for close date on order list +NEW: add send context for ticket +NEW: Add show preview for mail attachement on form mail +NEW: add state origin for product +NEW: add State/Province origin for products +NEW: Add the workflow interaction close intervention on closing ticket +NEW: Add third order printer to TakePOS +NEW: add tracking number in list and search_all items +NEW: add two hooks printFieldListFrom and printFieldSearchParam +NEW: Add __TYPE__ substitution key +NEW: Add validation of MX domain for emails +NEW: add vcard for aderent and user +NEW: add week number for month view in agenda +NEW: Algeria data (tva and forme_juridique) +NEW: Allow click on all header numbers on commerce area +NEW: Allow to reopen interventions (green button) +NEW: Allow zero quality on supplier/vendor order line +NEW: Appearance tab in TakePOS with more visual parameters +NEW: Better currency rate editor +NEW: Calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') ) +NEW: Can add event to log into blockedlog module with a constant. +NEW: Can build vendor invoice from vendor orders +NEW: Can change a product in line of recurring invoice or contract +NEW: Can change size of logo on PDF documents +NEW: Can change VAT rate of all lines of a draft object in one step. +NEW: Can define date range of validity of a login during creation +NEW: Can disable, from edit page, the whole web site +NEW: can edit and set sales representatives directly on thirdparty card +NEW: Can edit the list of sending email profiles. +NEW: Can enable/disable users in bulk actions +NEW: Can filter on accounting system ref in export of chart of account +NEW: Can filter on container type, language and tags in the list of pages +NEW: Can force the antivirus from conf file or autoprepend ini setup. +NEW: Can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY +NEW: Can import proposals, sales orders, supplier invoices +NEW: can set a dedicated SMTP config for sending email from public ticket interface +NEW: Can set tags/categories to website pages. +NEW: Can set type of price without tax per default for new sale price creation +NEW: Can use desired stock of a given warehouse for replenishment +NEW: Can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode +NEW: change thirdparty with barcode scan in takepos +NEW: Common behavior for monthly leave list view +NEW: conf to allow show full arbo in warehouse getnomurl +NEW: convert all subscription in datetime +NEW: create thirdparty customer from TAKEPOS +NEW: Date shipment from order accepts hours +NEW: Declinaison price level compatibility +NEW: Delayed payment in TakePOS +NEW: Development of module Recruitment +NEW: display date range if exist in takepos +NEW: display resiliate status in takepos for member +NEW: display stat for BOM on "object referent"/linked Object product tab +NEW: edit and update a ticket +NEW: edit or delete dispatched lines +NEW: Email configuration - Allow auto signed certificat when smtp ssl activated +NEW: enable free emails input with select2 +NEW: endpoint getContacts and Clean results +NEW: Events in agenda for contact +NEW: Field to link website page to an other object +NEW: Fill ECM src object fields in dol_add_file_process +NEW: filter on progress column in task list +NEW: filter product list by country and/or state/province +NEW: format tickets sent by mail in public interface +NEW: add juridical status for Algeria +NEW: form to add customer/supplier into categories +NEW: Framework is ready for CSRF token protection on explicit GET URLs. +NEW: get all child recursively +NEW: Get contacts list of a given order +NEW: helper functions for export with phpspreadsheet +NEW: hide closed contract lines +NEW: hide label in pdf for variants +NEW: Hook on propal card +NEW: If specific help page is available, we change color of icon +NEW: Include the tag editor of page as a popup into website editor +NEW: Introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM +NEW: Introducing new modal boxes in TakePOS +NEW: Keep takepos terminal when login/logout +NEW: Link on balance to the ledger +NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector +NEW: manage errors on update extra fields in ticket card +NEW: mass-actions for the event list view +NEW: Module Intracomm report +NEW: More filter for "View change logs" +NEW: multicurrency total in takepos +NEW: multiselect type and date to date filter +NEW: Nature of product is now a dictionay +NEW: new line template: hidden conf to fill service dates from the last service line +NEW: PDF model storm for delivery +NEW: possibilty to group payments by mode and show their subtotal +NEW: Print payment method and change in TakePOS +NEW: Priority and transparency from external calendar events +NEW: Products Import/Export 'default warehouse' and 'use batch number' fields +NEW: Purchase price table: Added filterable table columns +NEW: rate editor for multicurrency +NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines +NEW: remove new lines in mail on add ticket message +NEW: restrict thirdparty to customer in takepos +NEW: Allow to edit "demand reason" field though API +NEW: Rule "email to" accept wildcard * +NEW: Save filter of the project homepage +NEW: Select-able columns on customer invoice paymnet list +NEW: Select-able columns on miscellaneous payments + more data columns +NEW: Select-able columns on social taxes list +NEW: Select-able columns on supplier invoice payment list +NEW: send context and remove new lines on create ticket +NEW: set entity when creating invoice on takepos +NEW: Show available stock in TakePOS +NEW: Show category filter on lists only when user have rights to read categories +NEW: Show header number and make it clickable in warehouse arean, payment area, shipment area +NEW: Show image of user in the combo select of users +NEW: Show label on batch card +NEW: Show line number on intervention card (via MAIN_VIEW_LINE_NUMBER) +NEW: show links for select and multi-select in category extra field +NEW: Show module and permission ids on user/group rights (only admin) +NEW: Show place from events on import calender +NEW: Show references in contract form on interventions +NEW: Show tags and status in search list of website pages +NEW: Show user on external calender events (when found) +NEW: subject title with company name instead of application title in ticket message +NEW: Support for Samba4 AD +NEW: TakePOS connector compatibility with RECEIPT PRINTERS module +NEW: TakePOS Gift Receipt +NEW: TakePOS Multicurrency compatibility +NEW: The global header of a website can also have dynamic content +NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms +NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late +NEW: ticket classification on create from email collector +NEW: Ticket message notifications when edited from public interface +NEW: translate classification labels in ticket +NEW: triggers create, modify, delete +NEW: VAT for Algeria +NEW: Use preselect third-party from list on new card +NEW: Vat report - Invert constant to show by default zero vat in reports +NEW: website page fields selection +NEW: Weighing Scale compatibility with TakePOS connector +NEW: When creating a user from a member linked to a thirdparty, you can choose to create if as external or internal user +NEW: Add clone functionality on miscellaneous payment +For developers: +NEW: Can use dynamic code into the 'enabled' property of DAO fields +NEW: API Can update a payment +NEW: api get member by thirdparty +NEW: API get thirdparty by barcode +NEW: API get users by email / login +NEW: fetch contact by email with REST API +NEW: field ref_ext in llx_commandedet +NEW: fields ref_ext for Attributes and Combinations +NEW: get state by REST API +NEW: get state dictionnary by REST API +NEW: Improve Product API for variant products +NEW: Oauth SCOPE for Admin SDK +NEW: Retrieve discount from invoice from API +NEW: standardizes API thirdparties by email like other object +NEW: thirdparty REST API: endpoint to set price level +NEW: Use new category API for project list view +NEW: Triggers Attributes and Attributes values +NEW: Add hooks on newpayment page to allow external payment modules WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* Properties ->contactid have been renamed into ->contact_id -* Properties ->titre have been renamed into ->title -* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english) -* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in - your email templates. -* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom - days of holiday. +* The object "livraison" has been renamed into "delivery" (directory, class, keys, methods with livraison in name ...). +* All properties ->contactid have been renamed into ->contact_id +* All properties ->titre have been renamed into ->title +* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id * Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency. +* The deprecated subsitution key __SIGNATURE__ has been removed. Use __USER_SIGNATURE__ if you used the old syntax in your email templates. +* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday. * If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm), - you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait. + you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait. * The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML. -* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. -* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of amount. +* If you have links in your code with '&action=add', '&action=update', '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. +* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount. * The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed. -* Depreciate all methods with name valide(). Use instead methods validate(). +* Depreciate all methods with name ->valide(). Use instead methods ->validate(). ***** ChangeLog for 12.0.3 compared to 12.0.2 ***** @@ -385,28 +599,28 @@ Following changes may create regressions for some external modules, but were nec * Default mode for GETPOST function is now 'alphanohtml' instead of 'none'. So check when you make POST or GET requests with HTML content that you make a GETPOST('myparam', 'restricthtml') or GETPOST('myparam', 'none') if you really need posted content without sanitizing the HTML code of content (in such a case, sanitize data later) -* Removed hidden constant MAIN_EXTRAFIELDS_IN_ONE_TD that was useless. -* Reference of object including a "/" are no more allowed. It is never used by default but to support setup that introduced it, the "/" will be replaced - by a "_" automatically when a reference (with a custom numbering mask that use it) is generated. +* Removed hidden constant MAIN_EXTRAFIELDS_IN_ONE_TD that was useless. +* Reference of object including a "/" are no more allowed. It is never used by default but to support setup that introduced it, the "/" will be replaced + by a "_" automatically when a reference (with a custom numbering mask that use it) is generated. * Library jflot (replace with chartjs) was removed. -* Library geoip (replaced with geoip2) was removed. +* Library geoip (replaced with geoip2) was removed. * Hidden constant COMMANDE_VALID_AFTER_CLOSE_PROPAL was renamed into ORDER_VALID_AFTER_CLOSE_PROPAL. * Object field ref_int is deprecated and set to 'not used', method to fetch object by only ref_int is not supported anymore. * UserGroup class has been refactored with new architecture. Triggers of class UserGroup are now USERGROUP_CREATE, USERGROUP_MODIFY, USERGROUP_DELETE * A new way to navigate between pages in list is available. To use it (not mandatory), you must: - - replace line $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + - replace line $page = GETPOST('page', 'int') with $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - remove input field in form '';' - add parameter $pagenavastextinput to value 1 when calling print_barre_liste() WARNING FOR DOLIWAMP USERS ONLY: Only people that installed Dolibarr using the all-in-one auto-installer for Windows called "DoliWAMP" are concerned by the following warnings: - + * DoliWAMP auto-installer for Windows is no more available on 32 bits systems. Use standard package if you need to use such architecture. -* It is not possible to migrate from an installation done with the old DoliWAMP auto-installer for Windows by using this new one. - You must make a backup of your database, make a fresh installation using the new installer and reload your backup. - Don't forget that DoliWAMP is a good solution to make a quick test of Dolibarr on your local computer but is not recommended as a production - solution on a local desktop since a local desktop computer has often no backup and security policy, or not as good as on a server (when there is one). +* It is not possible to migrate from an installation done with the old DoliWAMP auto-installer for Windows by using this new one. + You must make a backup of your database, make a fresh installation using the new installer and reload your backup. + Don't forget that DoliWAMP is a good solution to make a quick test of Dolibarr on your local computer but is not recommended as a production + solution on a local desktop since a local desktop computer has often no backup and security policy, or not as good as on a server (when there is one). DoliWAMP remains a solution for fast test or demo purposes. Prefer using standard packages for production. @@ -570,7 +784,7 @@ FIX: #13118 FIX: #13124 FIX: #13131 FIX: #13135 -FIX: #13146 +FIX: #13146 FIX: #13198 FIX: #13175 FIX: #13182 @@ -637,7 +851,7 @@ FIX: Confusion between 'bank reconciled' and 'accounted'. Show both data. FIX: Count of Stripe payment mode must take test/live into account FIX: Creation of Stripe card from backoffice must return a clean message FIX: CVE-2019–17223 -FIX: CVE-2019–17223 +FIX: CVE-2019–17223 FIX: CVE-2020-7994 FIX: CVE Need permission to be able to develop modules FIX: #13053 @@ -837,7 +1051,7 @@ NEW: #4301 For Developers or integrators: -NEW: Compatible with PHP 7.4 +NEW: Compatible with PHP 7.4 NEW: Code for extrafields uses the new array $extrafields->attributes NEW: Can set a filter on object linked in modulebuilder. NEW: Can defined a position of numbering submodules for thirdparties @@ -904,9 +1118,9 @@ Following changes may create regressions for some external modules, but were nec * Removed function dol_micro_time. Use native PHP microtime instead. * The trigger BON_PRELEVEMENT_CREATE has been renamed into DIRECT_DEBIT_ORDER_CREATE. * The constant INVOICE_SHOW_POS_IN_EXPORT has been renamed into INVOICE_SHOW_POS. -* If your logo is no more visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible again. -* All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. -* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. +* If your logo is no more visible on the menu bar, you must upload a new logo into 'Home-Setup-Company/Organization' to have it visible again. +* All properties 'libstatut', 'labelstatut', 'labelstatus' were renamed into 'labelStatus'. +* All properties 'labelstatusshort' and 'labelstatut_short' were renamed into 'labelStatusShort'. * All properties 'type_libelle' were renamed into 'type_label'. * Renamed property of thirdparty "statut_commercial" into "status_prospect_label" * The jquery plugin/dependency multiselect has been removed. It was not used by Dolibarr core. @@ -1056,11 +1270,11 @@ FIX: wrong invoice id for fetchObjetctLinked ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. -The unit were not saved correctly in database making calculation on shipments wrong. +The unit were not saved correctly in database making calculation on shipments wrong. Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to one of this version. Once update is done you must then edit (manually) the product that has bad unit to set the correct unit to have features restored. -FIX: #11702 +FIX: #11702 FIX: #11861 No consistent code to manage measuring units FIX: #11942 FIX: #12026 @@ -1122,7 +1336,7 @@ FIX: wrong test FIX: XSS FIX: Payment from POS ware not recorded. FIX: Can validate invoice with amount including tax of zero for the case of having a final invoice with - VAT that includes a deposit without vat. + VAT that includes a deposit without vat. ***** ChangeLog for 10.0.2 compared to 10.0.1 ***** FIX: #10460 compatibility with MariaDB 10.4 @@ -1225,14 +1439,14 @@ FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** FIX: #10930 -FIX: #10984 +FIX: #10984 FIX: reposition on "Build backup" button FIX: #11400 FIX: #11412 -FIX: #11460 +FIX: #11460 FIX: #11463 FIX: #11466 -FIX: #11492 +FIX: #11492 FIX: #11498 FIX: #11505 FIX: #11506 @@ -1241,7 +1455,7 @@ FIX: #11509 FIX: #11537 FIX: #11543 FIX: #11553 -FIX: #11576 +FIX: #11576 FIX: #11584 FIX: #11590 FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface @@ -1334,14 +1548,14 @@ FIX: wrong path sociales/index.php doesnt exist anymore ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** FIX: #10930 -FIX: #10984 +FIX: #10984 FIX: reposition on "Build backup" button FIX: #11400 FIX: #11412 -FIX: #11460 +FIX: #11460 FIX: #11463 FIX: #11466 -FIX: #11492 +FIX: #11492 FIX: #11498 FIX: #11505 FIX: #11506 @@ -1350,7 +1564,7 @@ FIX: #11509 FIX: #11537 FIX: #11543 FIX: #11553 -FIX: #11576 +FIX: #11576 FIX: #11584 FIX: #11590 FIX: accounting mode must be taken from global conf, because there's no way to choose a mode with interface @@ -1519,7 +1733,7 @@ NEW: Manage account sell_intra & sell_export in page accoutancy admin default pr NEW: Manage loan schedule. NEW: Manage status of member types. NEW: Mass action "create bills" for validated reception -NEW: Measuring unit are now defined into an editable dictionary. Add product size/unit into product import. +NEW: Measuring unit are now defined into an editable dictionary. Add product size/unit into product import. NEW: Template pdf 'canelle_reception' displays linked reception lines. NEW: Moral/physic status can be defined at member type level NEW: Pagination into list of time spent. @@ -1582,7 +1796,7 @@ NEW: Enhance management of webhooks NEW: Generation of doc by modulebuilder can include README and CHANGELOG NEW: massfilesarea feature is possible for external modules NEW: Show list of enabled modules in dol_print_error(). -NEW: Simplification of CSS styles of default themes. +NEW: Simplification of CSS styles of default themes. NEW: Clean code of a lot of deprecated code. NEW: Add hidden option to set a search entry to the top NEW: add hidden option DISPLAY_DISCOUNTED_SUPPLIER_PRICE @@ -1602,8 +1816,8 @@ Following changes may create regressions for some external modules, but were nec * The PHP extension php-intl is not mandatory and must be installed to have new features working correctly. * Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules. * API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules. -* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.; -* Files for variables of themes were renamed from graph-color.php into theme_vars.inc.php to match naming +* Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.; +* Files for variables of themes were renamed from graph-color.php into theme_vars.inc.php to match naming convention of extension .inc.php for files to be included. * All methods set_draft() were renamed into setDraft(). * Signatures of methods createFromClone() has been standardized. All methods requires the object User as first parameter. @@ -1615,7 +1829,7 @@ Following changes may create regressions for some external modules, but were nec * Deprecated property ->fk_departement is now ->state_id everywhere. * Removed the method 4 of GETPOST (to get $_COOKIE). It was not used and not recommanded to use in Dolibarr. * Column llx_facture.facnumber change to llx_facture.ref -* Variable $dolibarr_main_cookie_cryptkey is no more created at install (it was not used by Dolibarr). A new variable +* Variable $dolibarr_main_cookie_cryptkey is no more created at install (it was not used by Dolibarr). A new variable called $dolibarr_main_instance_unique_id is now generated at each installation. It will be used by some future features. @@ -3387,7 +3601,7 @@ Following changes may create regression for some external modules, but were nece entities and to review completely the rights of the groups and the users. * Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx') * Some other change were done in the way we read permission of a user when module multicompany is enabled. You can - retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1. + retrieve the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1. * The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow hook specifications so you must return output into "resprint". @@ -6133,7 +6347,7 @@ For users: - Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers - Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search - Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array -- Fix: Expedition creation, can retreive product from other expedition +- Fix: Expedition creation, can retrieve product from other expedition For translators: - Update language files. diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 039dafd198f..628ef917c05 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -181,6 +181,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -198,7 +199,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 098a041680a..aefc375d961 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -261,6 +261,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -278,7 +279,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a3f2d1d8d96..bcccb7c02a4 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -177,6 +177,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/custom %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -195,7 +196,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 5b1b86b28f4..8a55dd84faa 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -189,6 +189,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -206,7 +207,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/dev/examples/zapier/.editorconfig b/dev/examples/zapier/.editorconfig new file mode 100644 index 00000000000..9228bbb156b --- /dev/null +++ b/dev/examples/zapier/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig is awesome: https://editorconfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +end_of_line = lf + +[*.js] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = false diff --git a/dev/examples/zapier/.gitignore b/dev/examples/zapier/.gitignore index d81e057e6d3..3e9263e351f 100644 --- a/dev/examples/zapier/.gitignore +++ b/dev/examples/zapier/.gitignore @@ -5,3 +5,4 @@ node_modules .environment .env .zapierapprc +package-lock.json diff --git a/dev/examples/zapier/README.md b/dev/examples/zapier/README.md new file mode 100644 index 00000000000..6408c55c221 --- /dev/null +++ b/dev/examples/zapier/README.md @@ -0,0 +1,48 @@ +# HOW TO BUILD + +## DEVELOPPER ACCOUNT + +At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/) + +## BUILD INTEGRATION + +### Install Node.js + +An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier. + +After installation, confirm that Node.js is ready to use: + `node --version` + +### Install the Zapier CLI + +Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more: + + `cd dev/exemples/zapier` + + `npm install -g zapier-platform-cli` to install the CLI globally + + `zapier --version` to return version of the CLI + +### Run Zapier Login + +Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application. + + `zapier --version` + +This command will set up a .zapierrc file in your home directory. + +### Install the Project + +In zapier exemple directory, run: + + `npm install` + +### Deploying your App + +Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers. + + `zapier push` + +### More info + +You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction) diff --git a/dev/examples/zapier/package-lock.json b/dev/examples/zapier/package-lock.json deleted file mode 100644 index 7483948d5b8..00000000000 --- a/dev/examples/zapier/package-lock.json +++ /dev/null @@ -1,405 +0,0 @@ -{ - "name": "Dolibarr", - "version": "1.0.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@types/node": { - "version": "8.10.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz", - "integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==", - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bluebird": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "content-disposition": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "dotenv": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz", - "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==" - }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "~0.4.13" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" - }, - "json-tryparse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/json-tryparse/-/json-tryparse-1.0.5.tgz", - "integrity": "sha1-Khy6CLTjEjNo+p+2o01GQwBFeyc=" - }, - "jsonschema": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.1.1.tgz", - "integrity": "sha1-PO3o4+QR03eHLu+8n98mODy8Ptk=" - }, - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" - }, - "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" - }, - "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", - "requires": { - "mime-db": "~1.38.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "node-fetch": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz", - "integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ==", - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" - }, - "should": { - "version": "13.2.3", - "resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz", - "integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==", - "dev": true, - "requires": { - "should-equal": "^2.0.0", - "should-format": "^3.0.3", - "should-type": "^1.4.0", - "should-type-adaptors": "^1.0.1", - "should-util": "^1.0.0" - } - }, - "should-equal": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz", - "integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==", - "dev": true, - "requires": { - "should-type": "^1.4.0" - } - }, - "should-format": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz", - "integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=", - "dev": true, - "requires": { - "should-type": "^1.3.0", - "should-type-adaptors": "^1.0.1" - } - }, - "should-type": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz", - "integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=", - "dev": true - }, - "should-type-adaptors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz", - "integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==", - "dev": true, - "requires": { - "should-type": "^1.3.0", - "should-util": "^1.0.0" - } - }, - "should-util": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz", - "integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=", - "dev": true - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "zapier-platform-core": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/zapier-platform-core/-/zapier-platform-core-8.0.1.tgz", - "integrity": "sha512-vuAe7JkFQ88AeQ//NwwNEh8ZjiZr30GRWtwYo7Wo/nx1cqZwq+CRc9zJU2WRrhJfJOtOOTUF6w+pArBTtMOC5A==", - "requires": { - "@types/node": "8.10.20", - "bluebird": "3.5.0", - "content-disposition": "0.5.2", - "dotenv": "5.0.1", - "form-data": "2.3.2", - "lodash": "4.17.11", - "node-fetch": "1.7.1", - "oauth-sign": "0.9.0", - "semver": "5.6.0", - "zapier-platform-schema": "8.0.1" - } - }, - "zapier-platform-schema": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/zapier-platform-schema/-/zapier-platform-schema-8.0.1.tgz", - "integrity": "sha512-97KJ0xVLtpU4BiXVaMTPQpiA0T6CQIEzWfzAWwJAWbu5336+6DMFUzDWN4bANBeD3CIsRHHPcZkP8n/17U05ag==", - "requires": { - "jsonschema": "1.1.1", - "lodash": "4.17.10" - }, - "dependencies": { - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" - } - } - } - } -} diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index 8fbd203f962..be13c719c97 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -1,9 +1,9 @@ { - "name": "Dolibarr", + "name": "dolibarr", "version": "1.0.0", "description": "An app for connecting Dolibarr to the Zapier platform.", "repository": "Dolibarr/dolibarr", - "homepage": "https://www.dolibarr.fr/", + "homepage": "https://www.dolibarr.org/", "author": "Frédéric France ", "license": "BSD-3-Clause", "main": "index.js", diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index e6a67aa73c8..18256c33766 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -120,8 +120,8 @@ $sqls=array( "DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'", ), 'delivery'=>array( - "DELETE FROM ".MAIN_DB_PREFIX."livraisondet WHERE fk_livraison IN (select rowid FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__')", - "DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'", + "DELETE FROM ".MAIN_DB_PREFIX."deliverydet WHERE fk_delivery IN (select rowid FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__')", + "DELETE FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__'", ), 'contract'=>array( "DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))", diff --git a/dev/initdemo/mysqldump_dolibarr_12.0.0.sql b/dev/initdemo/mysqldump_dolibarr_12.0.0.sql index 3cc1db1cf34..a05c05c066e 100644 --- a/dev/initdemo/mysqldump_dolibarr_12.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_12.0.0.sql @@ -7522,13 +7522,13 @@ INSERT INTO `llx_links` VALUES (1,1,'2018-01-16 16:45:35','http://www.dolicloud. UNLOCK TABLES; -- --- Table structure for table `llx_livraison` +-- Table structure for table `llx_delivery` -- -DROP TABLE IF EXISTS `llx_livraison`; +DROP TABLE IF EXISTS `llx_delivery`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraison` ( +CREATE TABLE `llx_delivery` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ref` varchar(30) COLLATE utf8_unicode_ci NOT NULL, @@ -7554,61 +7554,61 @@ CREATE TABLE `llx_livraison` ( `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `extraparams` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), - UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), - KEY `idx_livraison_fk_soc` (`fk_soc`), - KEY `idx_livraison_fk_user_author` (`fk_user_author`), - KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), - CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), - CONSTRAINT `fk_livraison_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), - CONSTRAINT `fk_livraison_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) + UNIQUE KEY `idx_delivery_uk_ref` (`ref`,`entity`), + KEY `idx_delivery_fk_soc` (`fk_soc`), + KEY `idx_delivery_fk_user_author` (`fk_user_author`), + KEY `idx_delivery_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_delivery_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_delivery_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_delivery_fk_user_valid` FOREIGN KEY (`fk_user_valid`) 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_livraison` +-- Dumping data for table `llx_delivery` -- -LOCK TABLES `llx_livraison` WRITE; -/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; +LOCK TABLES `llx_delivery` WRITE; +/*!40000 ALTER TABLE `llx_delivery` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_delivery` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraison_extrafields` +-- Table structure for table `llx_delivery_extrafields` -- -DROP TABLE IF EXISTS `llx_livraison_extrafields`; +DROP TABLE IF EXISTS `llx_delivery_extrafields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraison_extrafields` ( +CREATE TABLE `llx_delivery_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_livraison_extrafields` (`fk_object`) + KEY `idx_delivery_extrafields` (`fk_object`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraison_extrafields` +-- Dumping data for table `llx_delivery_extrafields` -- -LOCK TABLES `llx_livraison_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_livraison_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraison_extrafields` ENABLE KEYS */; +LOCK TABLES `llx_delivery_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_delivery_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_delivery_extrafields` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraisondet` +-- Table structure for table `llx_deliverydet` -- -DROP TABLE IF EXISTS `llx_livraisondet`; +DROP TABLE IF EXISTS `llx_deliverydet`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraisondet` ( +CREATE TABLE `llx_deliverydet` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_livraison` int(11) DEFAULT NULL, + `fk_delivery` int(11) DEFAULT NULL, `fk_origin_line` int(11) DEFAULT NULL, `fk_product` int(11) DEFAULT NULL, `description` text COLLATE utf8_unicode_ci DEFAULT NULL, @@ -7617,44 +7617,44 @@ CREATE TABLE `llx_livraisondet` ( `total_ht` double(24,8) DEFAULT 0.00000000, `rang` int(11) DEFAULT 0, PRIMARY KEY (`rowid`), - KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), - CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) + KEY `idx_deliverydet_fk_expedition` (`fk_delivery`), + CONSTRAINT `fk_deliverydet_fk_delivery` FOREIGN KEY (`fk_delivery`) REFERENCES `llx_delivery` (`rowid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraisondet` +-- Dumping data for table `llx_deliverydet` -- -LOCK TABLES `llx_livraisondet` WRITE; -/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; +LOCK TABLES `llx_deliverydet` WRITE; +/*!40000 ALTER TABLE `llx_deliverydet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_deliverydet` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraisondet_extrafields` +-- Table structure for table `llx_deliverydet_extrafields` -- -DROP TABLE IF EXISTS `llx_livraisondet_extrafields`; +DROP TABLE IF EXISTS `llx_deliverydet_extrafields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraisondet_extrafields` ( +CREATE TABLE `llx_deliverydet_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_livraisondet_extrafields` (`fk_object`) + KEY `idx_deliverydet_extrafields` (`fk_object`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraisondet_extrafields` +-- Dumping data for table `llx_deliverydet_extrafields` -- -LOCK TABLES `llx_livraisondet_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_livraisondet_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraisondet_extrafields` ENABLE KEYS */; +LOCK TABLES `llx_deliverydet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_deliverydet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_deliverydet_extrafields` ENABLE KEYS */; UNLOCK TABLES; -- @@ -12679,7 +12679,7 @@ CREATE TABLE `llx_user` ( LOCK TABLES `llx_user` WRITE; /*!40000 ALTER TABLE `llx_user` DISABLE KEYS */; -INSERT INTO `llx_user` VALUES (1,'2012-07-08 13:20:11','2019-11-28 11:52:58',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','',NULL,'123456789','','','','aeinstein@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(2,'2012-07-08 13:54:48','2019-11-28 11:52:58',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','Trainee',NULL,'09123123','','','','daviddoe@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2018-07-30 23:10:54','2018-07-30 23:04:17',NULL,'',1,'person9.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,35.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(3,'2012-07-11 16:18:59','2020-01-21 09:30:27',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','',NULL,'','','','','pcurie@example.com','','[]','',0,'',1,1,NULL,NULL,2,'','2014-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(4,'2015-01-23 17:52:27','2019-11-28 11:52:58',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper',NULL,'','','','','bbookkeeper@example.com','','{\"skype\":\"skypebbookkeeper\"}','',0,'',1,1,17,6,NULL,'','2015-02-25 10:18:41','2015-01-23 17:53:20',NULL,'',1,'person8.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,16.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(10,'2017-10-03 11:47:41','2019-11-28 11:52:58',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','',NULL,'','','','','mcurie@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(11,'2017-10-05 09:07:52','2019-11-28 11:52:58',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President - CEO',NULL,'','','','','zzeceo@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 22:48:08','2017-10-05 21:18:46',NULL,'',1,'person4.jpeg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,'2019-06-10 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(12,'2017-10-05 09:09:46','2020-01-07 13:47:17',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'f6fdffe48c908deb0f4c3bd36c032e72',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical',NULL,'','','','','aadminson@example.com','','[]','Alice - 123',1,NULL,1,1,NULL,NULL,NULL,'','2020-01-21 10:38:41','2020-01-21 10:35:27',NULL,'',1,'person6.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2700.00000000,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(13,'2017-10-05 21:29:35','2019-11-28 11:52:58',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Coraly','Commercial leader',NULL,'','','','','ccommercy@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person7.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,1890.00000000,NULL,NULL,25.00000000,'woman',NULL,'2018-09-11 00:00:00',NULL,NULL,'1998-12-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(14,'2017-10-05 21:33:33','2019-11-28 11:52:58',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader',NULL,'','','','','sscientol@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person3.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,3500.00000000,NULL,NULL,39.00000000,NULL,NULL,'2018-07-03 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(16,'2017-10-05 22:47:52','2019-11-28 11:52:58',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative',NULL,'','','','','ccommerson@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:46:24','2017-10-05 23:37:31',NULL,'',1,'person1.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2900.00000000,NULL,NULL,39.00000000,NULL,NULL,'2019-09-01 00:00:00',NULL,NULL,'1976-02-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(17,'2017-10-05 22:48:39','2019-11-28 11:52:58',NULL,NULL,'aleerfok',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Leerfok','Amanda','Sale representative',NULL,'','','','','aleerfok@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:16:06',NULL,NULL,'',0,'person5.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(18,'2018-01-22 17:27:02','2019-11-28 11:52:58',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM',NULL,'','','','','ldestailleur@example.com','','[]','
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.destailleur.fr','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); +INSERT INTO `llx_user` VALUES (1,'2012-07-08 13:20:11','2019-11-28 11:52:58',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','',NULL,'123456789','','','','aeinstein@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(2,'2012-07-08 13:54:48','2019-11-28 11:52:58',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','Trainee',NULL,'09123123','','','','daviddoe@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2018-07-30 23:10:54','2018-07-30 23:04:17',NULL,'',1,'person9.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,35.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(3,'2012-07-11 16:18:59','2020-01-21 09:30:27',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','',NULL,'','','','','pcurie@example.com','','[]','',0,'',1,1,NULL,NULL,2,'','2014-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(4,'2015-01-23 17:52:27','2019-11-28 11:52:58',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper',NULL,'','','','','bbookkeeper@example.com','','{\"skype\":\"skypebbookkeeper\"}','',0,'',1,1,17,6,NULL,'','2015-02-25 10:18:41','2015-01-23 17:53:20',NULL,'',1,'person8.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,16.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(10,'2017-10-03 11:47:41','2019-11-28 11:52:58',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','',NULL,'','','','','mcurie@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(11,'2017-10-05 09:07:52','2019-11-28 11:52:58',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President - CEO',NULL,'','','','','zzeceo@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 22:48:08','2017-10-05 21:18:46',NULL,'',1,'person4.jpeg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,'2019-06-10 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(12,'2017-10-05 09:09:46','2020-01-07 13:47:17',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'f6fdffe48c908deb0f4c3bd36c032e72',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical',NULL,'','','','','aadminson@example.com','','[]','Alice - 123',1,NULL,1,1,NULL,NULL,NULL,'','2020-01-21 10:38:41','2020-01-21 10:35:27',NULL,'',1,'person6.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2700.00000000,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(13,'2017-10-05 21:29:35','2019-11-28 11:52:58',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Coraly','Commercial leader',NULL,'','','','','ccommercy@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person7.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,1890.00000000,NULL,NULL,25.00000000,'woman',NULL,'2018-09-11 00:00:00',NULL,NULL,'1998-12-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(14,'2017-10-05 21:33:33','2019-11-28 11:52:58',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader',NULL,'','','','','sscientol@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person3.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,3500.00000000,NULL,NULL,39.00000000,NULL,NULL,'2018-07-03 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(16,'2017-10-05 22:47:52','2019-11-28 11:52:58',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative',NULL,'','','','','ccommerson@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:46:24','2017-10-05 23:37:31',NULL,'',1,'person1.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2900.00000000,NULL,NULL,39.00000000,NULL,NULL,'2019-09-01 00:00:00',NULL,NULL,'1976-02-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(17,'2017-10-05 22:48:39','2019-11-28 11:52:58',NULL,NULL,'aleerfok',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Leerfok','Amanda','Sale representative',NULL,'','','','','aleerfok@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:16:06',NULL,NULL,'',0,'person5.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(18,'2018-01-22 17:27:02','2019-11-28 11:52:58',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM',NULL,'','','','','ldestailleur@example.com','','[]','
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 `llx_user` ENABLE KEYS */; UNLOCK TABLES; @@ -13655,7 +13655,7 @@ CREATE TABLE `tmp_user` ( LOCK TABLES `tmp_user` WRITE; /*!40000 ALTER TABLE `tmp_user` DISABLE KEYS */; -INSERT INTO `tmp_user` VALUES (1,'2012-07-08 13:20:11','2019-11-28 11:52:58',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','',NULL,'123456789','','','','aeinstein@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(2,'2012-07-08 13:54:48','2019-11-28 11:52:58',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','Trainee',NULL,'09123123','','','','daviddoe@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2018-07-30 23:10:54','2018-07-30 23:04:17',NULL,'',1,'person9.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,35.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(3,'2012-07-11 16:18:59','2020-01-21 09:30:27',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','',NULL,'','','','','pcurie@example.com','','[]','',0,'',1,1,NULL,NULL,2,'','2014-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(4,'2015-01-23 17:52:27','2019-11-28 11:52:58',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper',NULL,'','','','','bbookkeeper@example.com','','{\"skype\":\"skypebbookkeeper\"}','',0,'',1,1,17,6,NULL,'','2015-02-25 10:18:41','2015-01-23 17:53:20',NULL,'',1,'person8.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,16.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(10,'2017-10-03 11:47:41','2019-11-28 11:52:58',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','',NULL,'','','','','mcurie@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(11,'2017-10-05 09:07:52','2019-11-28 11:52:58',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President - CEO',NULL,'','','','','zzeceo@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 22:48:08','2017-10-05 21:18:46',NULL,'',1,'person4.jpeg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,'2019-06-10 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(12,'2017-10-05 09:09:46','2020-01-07 13:47:17',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'f6fdffe48c908deb0f4c3bd36c032e72',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical',NULL,'','','','','aadminson@example.com','','[]','Alice - 123',1,NULL,1,1,NULL,NULL,NULL,'','2020-01-21 10:38:41','2020-01-21 10:35:27',NULL,'',1,'person6.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2700.00000000,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(13,'2017-10-05 21:29:35','2019-11-28 11:52:58',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Coraly','Commercial leader',NULL,'','','','','ccommercy@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person7.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,1890.00000000,NULL,NULL,25.00000000,'woman',NULL,'2018-09-11 00:00:00',NULL,NULL,'1998-12-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(14,'2017-10-05 21:33:33','2019-11-28 11:52:58',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader',NULL,'','','','','sscientol@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person3.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,3500.00000000,NULL,NULL,39.00000000,NULL,NULL,'2018-07-03 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(16,'2017-10-05 22:47:52','2019-11-28 11:52:58',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative',NULL,'','','','','ccommerson@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:46:24','2017-10-05 23:37:31',NULL,'',1,'person1.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2900.00000000,NULL,NULL,39.00000000,NULL,NULL,'2019-09-01 00:00:00',NULL,NULL,'1976-02-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(17,'2017-10-05 22:48:39','2019-11-28 11:52:58',NULL,NULL,'aleerfok',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Leerfok','Amanda','Sale representative',NULL,'','','','','aleerfok@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:16:06',NULL,NULL,'',0,'person5.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(18,'2018-01-22 17:27:02','2019-11-28 11:52:58',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM',NULL,'','','','','ldestailleur@example.com','','[]','
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.destailleur.fr','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); +INSERT INTO `tmp_user` VALUES (1,'2012-07-08 13:20:11','2019-11-28 11:52:58',NULL,NULL,'aeinstein',0,NULL,NULL,NULL,1,0,NULL,'11c9c772d6471aa24c27274bdd8a223b',NULL,NULL,'Einstein','Albert','',NULL,'123456789','','','','aeinstein@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2017-10-05 08:32:44','2017-10-03 11:43:50',NULL,'',1,'alberteinstein.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'aaaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(2,'2012-07-08 13:54:48','2019-11-28 11:52:58',NULL,NULL,'demo',1,NULL,NULL,NULL,1,0,NULL,'fe01ce2a7fbac8fafaed7c982a04e229',NULL,NULL,'Doe','David','Trainee',NULL,'09123123','','','','daviddoe@example.com','','[]','',0,'',1,1,NULL,NULL,NULL,'','2018-07-30 23:10:54','2018-07-30 23:04:17',NULL,'',1,'person9.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,35.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(3,'2012-07-11 16:18:59','2020-01-21 09:30:27',NULL,NULL,'pcurie',1,NULL,NULL,NULL,1,0,NULL,'ab335b4eb4c3c99334f656e5db9584c9',NULL,NULL,'Curie','Pierre','',NULL,'','','','','pcurie@example.com','','[]','',0,'',1,1,NULL,NULL,2,'','2014-12-21 17:38:55',NULL,NULL,'',1,'pierrecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(4,'2015-01-23 17:52:27','2019-11-28 11:52:58',NULL,NULL,'bbookkeeper',1,NULL,NULL,NULL,1,0,NULL,'a7d30b58d647fcf59b7163f9592b1dbb',NULL,NULL,'Bookkeeper','Bob','Bookkeeper',NULL,'','','','','bbookkeeper@example.com','','{\"skype\":\"skypebbookkeeper\"}','',0,'',1,1,17,6,NULL,'','2015-02-25 10:18:41','2015-01-23 17:53:20',NULL,'',1,'person8.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,16.00000000,'man',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(10,'2017-10-03 11:47:41','2019-11-28 11:52:58',NULL,NULL,'mcurie',1,NULL,NULL,NULL,1,0,NULL,'52cda011808bb282d1d3625ab607a145',NULL,'t3mnkbhs','Curie','Marie','',NULL,'','','','','mcurie@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'mariecurie.jpg',NULL,NULL,14,NULL,NULL,NULL,'','','',NULL,NULL,'ffaaff','',NULL,0,0,NULL,NULL,NULL,44.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(11,'2017-10-05 09:07:52','2019-11-28 11:52:58',NULL,NULL,'zzeceo',1,NULL,NULL,NULL,1,0,NULL,'92af989c4c3a5140fb5d73eb77a52454',NULL,'cq78nf9m','Zeceo','Zack','President - CEO',NULL,'','','','','zzeceo@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 22:48:08','2017-10-05 21:18:46',NULL,'',1,'person4.jpeg',NULL,NULL,NULL,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,NULL,NULL,'2019-06-10 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(12,'2017-10-05 09:09:46','2020-01-07 13:47:17',NULL,NULL,'admin',0,NULL,NULL,NULL,1,0,NULL,'f6fdffe48c908deb0f4c3bd36c032e72',NULL,'nd6hgbcr','Adminson','Alice','Admin Technical',NULL,'','','','','aadminson@example.com','','[]','Alice - 123',1,NULL,1,1,NULL,NULL,NULL,'','2020-01-21 10:38:41','2020-01-21 10:35:27',NULL,'',1,'person6.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2700.00000000,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,'generic_user_odt','1985-09-15',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(13,'2017-10-05 21:29:35','2019-11-28 11:52:58',NULL,NULL,'ccommercy',1,NULL,NULL,NULL,1,0,NULL,'179858e041af35e8f4c81d68c55fe9da',NULL,'y451ksdv','Commercy','Coraly','Commercial leader',NULL,'','','','','ccommercy@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person7.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,1890.00000000,NULL,NULL,25.00000000,'woman',NULL,'2018-09-11 00:00:00',NULL,NULL,'1998-12-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(14,'2017-10-05 21:33:33','2019-11-28 11:52:58',NULL,NULL,'sscientol',1,NULL,NULL,NULL,1,0,NULL,'39bee07ac42f31c98e79cdcd5e5fe4c5',NULL,'s2hp8bxd','Scientol','Sam','Scientist leader',NULL,'','','','','sscientol@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,'person3.jpeg',NULL,NULL,11,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,3500.00000000,NULL,NULL,39.00000000,NULL,NULL,'2018-07-03 00:00:00',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(16,'2017-10-05 22:47:52','2019-11-28 11:52:58',NULL,NULL,'ccommerson',1,NULL,NULL,NULL,1,0,NULL,'d68005ccf362b82d084551b6291792a3',NULL,'cx9y1dk0','Charle1','Commerson','Sale representative',NULL,'','','','','ccommerson@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:46:24','2017-10-05 23:37:31',NULL,'',1,'person1.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,2900.00000000,NULL,NULL,39.00000000,NULL,NULL,'2019-09-01 00:00:00',NULL,NULL,'1976-02-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(17,'2017-10-05 22:48:39','2019-11-28 11:52:58',NULL,NULL,'aleerfok',1,NULL,NULL,NULL,1,0,NULL,'a964065211872fb76f876c6c3e952ea3',NULL,'gw8cb7xj','Leerfok','Amanda','Sale representative',NULL,'','','','','aleerfok@example.com','','[]','',0,NULL,1,1,NULL,NULL,NULL,'','2017-10-05 23:16:06',NULL,NULL,'',0,'person5.jpeg',NULL,NULL,13,NULL,NULL,NULL,'','','',NULL,NULL,'','',NULL,0,0,NULL,NULL,NULL,39.00000000,'woman',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,-1,NULL,NULL),(18,'2018-01-22 17:27:02','2019-11-28 11:52:58',NULL,NULL,'ldestailleur',1,NULL,NULL,NULL,1,0,NULL,'1bb7805145a7a5066df9e6d585b8b645',NULL,'87g06wbx','Destailleur','Laurent','Project leader of Dolibarr ERP CRM',NULL,'','','','','ldestailleur@example.com','','[]','
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 */; diff --git a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql index 28b05e920d8..46053d1a187 100644 --- a/dev/initdemo/mysqldump_dolibarr_3.5.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_3.5.0.sql @@ -181,7 +181,7 @@ CREATE TABLE `llx_actioncomm` ( LOCK TABLES `llx_actioncomm` WRITE; /*!40000 ALTER TABLE `llx_actioncomm` DISABLE KEYS */; -INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',NULL,NULL,50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2010-07-08 12:21:44',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',NULL,NULL,50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2010-07-08 12:23:48',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',NULL,NULL,50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2010-07-08 20:42:12',1,NULL,NULL,3,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',NULL,NULL,50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2010-07-08 20:48:18',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',NULL,NULL,50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2010-07-08 21:22:57',1,NULL,NULL,5,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',NULL,NULL,50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2010-07-08 22:15:09',1,NULL,NULL,6,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',NULL,NULL,50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2010-07-08 23:24:26',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',NULL,NULL,50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2010-07-10 12:54:27',1,NULL,NULL,8,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',NULL,NULL,50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2010-07-10 12:54:44',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',NULL,NULL,50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice'),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',NULL,NULL,50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2010-07-10 13:13:08',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',NULL,NULL,5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',NULL,NULL,50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2010-07-10 16:18:16',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',NULL,NULL,50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2010-07-10 16:35:57',1,NULL,NULL,11,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',NULL,NULL,50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2010-07-11 14:18:08',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',NULL,NULL,5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',NULL,NULL,50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2010-07-11 15:13:20',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',NULL,NULL,50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2010-07-11 15:15:42',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',NULL,NULL,50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2010-07-11 16:47:33',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',NULL,NULL,50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2011-07-18 17:29:22',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal'),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',NULL,NULL,50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2011-07-18 18:49:58',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice'),(24,NULL,1,'2011-07-28 01:37:00',NULL,NULL,NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',NULL,NULL,50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2011-08-01 00:31:24',1,NULL,NULL,15,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe'),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',NULL,NULL,50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2011-08-01 00:31:43',1,NULL,NULL,16,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe'),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',NULL,NULL,50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2011-08-01 00:41:26',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe'),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice'),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice'),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice'),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice'),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',NULL,NULL,50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2011-08-08 00:41:55',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice'),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',NULL,NULL,50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2011-08-08 00:53:40',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice'),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',NULL,NULL,50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2011-08-08 00:54:05',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice'),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',NULL,NULL,50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2011-08-08 00:55:04',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice'),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',NULL,NULL,50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2011-08-08 00:55:26',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice'),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',NULL,NULL,50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2011-08-08 00:55:58',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice'),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',NULL,NULL,50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2011-08-08 01:04:22',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order'),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',NULL,NULL,50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2011-08-08 11:59:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order'),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',NULL,NULL,50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2011-08-08 12:24:18',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal'),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',NULL,NULL,50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2011-08-08 12:24:24',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal'),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',NULL,NULL,50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2011-08-08 13:04:37',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier'),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2012-12-08 16:56:47',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2012-12-08 16:57:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',NULL,NULL,40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2012-12-08 16:58:27',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice'),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',NULL,NULL,40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2012-12-08 17:20:49',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice'),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',NULL,NULL,40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2012-12-09 17:35:07',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice'),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',NULL,NULL,40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2012-12-09 19:14:42',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe'),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',NULL,NULL,40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2012-12-12 17:54:19',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice'),(121,NULL,1,'2012-12-06 10:00:00',NULL,NULL,NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',NULL,NULL,40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2012-12-21 17:09:52',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à laurent@destailleur.fr.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice'),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',NULL,NULL,40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2013-01-06 12:13:57',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier'),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',NULL,NULL,40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2013-01-12 11:23:05',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe'),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',NULL,NULL,40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2013-01-12 11:52:20',1,NULL,NULL,20,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe'),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',NULL,NULL,40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2013-01-19 17:22:48',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice'),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice'),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice'),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice'),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice'),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',NULL,NULL,50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2013-01-23 14:07:54',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons'),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',NULL,NULL,40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2013-01-23 15:56:58',1,NULL,NULL,21,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe'),(134,NULL,1,'2013-01-23 17:34:00',NULL,NULL,NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',NULL,NULL,40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2013-02-20 20:11:54',1,1,NULL,7,NULL,0,NULL,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
\r\nAuteur: admin',13,'invoice'),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',NULL,NULL,40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2013-02-12 16:06:51',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order'),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',NULL,NULL,40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2013-02-17 15:22:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal'),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',NULL,NULL,40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2013-02-17 15:27:00',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice'),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',NULL,NULL,40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2013-02-17 15:27:29',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal'),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',NULL,NULL,40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2013-02-17 17:27:56',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order'),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',NULL,NULL,40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2013-02-17 17:38:14',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order'),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',NULL,NULL,40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2013-02-26 21:57:50',1,NULL,NULL,22,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe'),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',NULL,NULL,40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2013-02-26 21:58:13',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe'),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',NULL,NULL,5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,NULL,NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',NULL,NULL,40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2013-03-06 09:05:07',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract'),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',NULL,NULL,40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2013-03-06 15:43:37',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice'),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',NULL,NULL,40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2013-03-06 15:44:12',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice'),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',NULL,NULL,40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2013-03-06 15:47:48',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice'),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',NULL,NULL,40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2013-03-06 15:48:16',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice'),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',NULL,NULL,40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2013-03-06 16:13:59',1,NULL,NULL,24,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe'),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',NULL,NULL,40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2013-03-08 09:02:22',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal'),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',NULL,NULL,40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2013-03-09 18:39:27',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier'),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',NULL,NULL,40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2013-03-10 14:47:37',1,NULL,NULL,25,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe'),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',NULL,NULL,40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2013-03-10 14:57:32',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe'),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2013-03-10 14:58:28',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice'),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2013-03-19 08:38:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice'),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2013-03-20 13:30:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice'),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2013-03-22 08:40:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2013-03-23 16:16:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2013-03-23 17:08:27',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice'),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2013-03-24 14:54:00',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice'),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2013-11-07 00:02:39',1,NULL,NULL,27,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe'),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2013-11-07 00:05:22',1,NULL,NULL,28,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe'),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2013-11-07 00:07:07',1,NULL,NULL,29,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe'),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2013-11-07 00:07:58',1,NULL,NULL,30,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe'),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2013-11-07 00:10:09',1,NULL,NULL,31,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe'),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2013-11-07 00:15:57',1,NULL,NULL,32,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe'),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2013-11-07 00:16:51',1,NULL,NULL,33,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe'); +INSERT INTO `llx_actioncomm` VALUES (1,NULL,1,'2010-07-08 14:21:44','2010-07-08 14:21:44',NULL,NULL,50,NULL,'Company AAA and Co added into Dolibarr','2010-07-08 14:21:44','2010-07-08 12:21:44',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company AAA and Co added into Dolibarr\nAuthor: admin',NULL,NULL),(2,NULL,1,'2010-07-08 14:23:48','2010-07-08 14:23:48',NULL,NULL,50,NULL,'Company Belin SARL added into Dolibarr','2010-07-08 14:23:48','2010-07-08 12:23:48',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Belin SARL added into Dolibarr\nAuthor: admin',NULL,NULL),(3,NULL,1,'2010-07-08 22:42:12','2010-07-08 22:42:12',NULL,NULL,50,NULL,'Company Spanish Comp added into Dolibarr','2010-07-08 22:42:12','2010-07-08 20:42:12',1,NULL,NULL,3,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Spanish Comp added into Dolibarr\nAuthor: admin',NULL,NULL),(4,NULL,1,'2010-07-08 22:48:18','2010-07-08 22:48:18',NULL,NULL,50,NULL,'Company Prospector Vaalen added into Dolibarr','2010-07-08 22:48:18','2010-07-08 20:48:18',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Prospector Vaalen added into Dolibarr\nAuthor: admin',NULL,NULL),(5,NULL,1,'2010-07-08 23:22:57','2010-07-08 23:22:57',NULL,NULL,50,NULL,'Company NoCountry Co added into Dolibarr','2010-07-08 23:22:57','2010-07-08 21:22:57',1,NULL,NULL,5,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company NoCountry Co added into Dolibarr\nAuthor: admin',NULL,NULL),(6,NULL,1,'2010-07-09 00:15:09','2010-07-09 00:15:09',NULL,NULL,50,NULL,'Company Swiss customer added into Dolibarr','2010-07-09 00:15:09','2010-07-08 22:15:09',1,NULL,NULL,6,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Swiss customer added into Dolibarr\nAuthor: admin',NULL,NULL),(7,NULL,1,'2010-07-09 01:24:26','2010-07-09 01:24:26',NULL,NULL,50,NULL,'Company Generic customer added into Dolibarr','2010-07-09 01:24:26','2010-07-08 23:24:26',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Company Generic customer added into Dolibarr\nAuthor: admin',NULL,NULL),(8,NULL,1,'2010-07-10 14:54:27','2010-07-10 14:54:27',NULL,NULL,50,NULL,'Société Client salon ajoutée dans Dolibarr','2010-07-10 14:54:27','2010-07-10 12:54:27',1,NULL,NULL,8,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(9,NULL,1,'2010-07-10 14:54:44','2010-07-10 14:54:44',NULL,NULL,50,NULL,'Société Client salon invidivdu ajoutée dans Doliba','2010-07-10 14:54:44','2010-07-10 12:54:44',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Client salon invidivdu ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(10,NULL,1,'2010-07-10 14:56:10','2010-07-10 14:56:10',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:56:10','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(11,NULL,1,'2010-07-10 14:58:53','2010-07-10 14:58:53',NULL,NULL,50,NULL,'Facture FA1007-0001 validée dans Dolibarr','2010-07-10 14:58:53','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 validée dans Dolibarr\nAuteur: admin',1,'invoice'),(12,NULL,1,'2010-07-10 15:00:55','2010-07-10 15:00:55',NULL,NULL,50,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr','2010-07-10 15:00:55','2011-07-18 17:29:22',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Facture FA1007-0001 passée à payée dans Dolibarr\nAuteur: admin',1,'invoice'),(13,NULL,1,'2010-07-10 15:13:08','2010-07-10 15:13:08',NULL,NULL,50,NULL,'Société Smith Vick ajoutée dans Dolibarr','2010-07-10 15:13:08','2010-07-10 13:13:08',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Smith Vick ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(14,NULL,1,'2010-07-10 15:21:00','2010-07-10 16:21:00',NULL,NULL,5,NULL,'RDV avec mon chef','2010-07-10 15:21:48','2010-07-10 13:21:48',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'',3600,NULL,'',NULL,NULL),(15,NULL,1,'2010-07-10 18:18:16','2010-07-10 18:18:16',NULL,NULL,50,NULL,'Contrat CONTRAT1 validé dans Dolibarr','2010-07-10 18:18:16','2010-07-10 16:18:16',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Contrat CONTRAT1 validé dans Dolibarr\nAuteur: admin',NULL,NULL),(16,NULL,1,'2010-07-10 18:35:57','2010-07-10 18:35:57',NULL,NULL,50,NULL,'Société Mon client ajoutée dans Dolibarr','2010-07-10 18:35:57','2010-07-10 16:35:57',1,NULL,NULL,11,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Mon client ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(17,NULL,1,'2010-07-11 16:18:08','2010-07-11 16:18:08',NULL,NULL,50,NULL,'Société Dupont Alain ajoutée dans Dolibarr','2010-07-11 16:18:08','2010-07-11 14:18:08',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Dupont Alain ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(18,NULL,1,'2010-07-11 17:11:00','2010-07-11 17:17:00',NULL,NULL,5,NULL,'Rendez-vous','2010-07-11 17:11:22','2010-07-11 15:11:22',1,NULL,NULL,NULL,NULL,0,1,NULL,NULL,0,0,1,0,'gfgdfgdf',360,NULL,'',NULL,NULL),(19,NULL,1,'2010-07-11 17:13:20','2010-07-11 17:13:20',NULL,NULL,50,NULL,'Société Vendeur de chips ajoutée dans Dolibarr','2010-07-11 17:13:20','2010-07-11 15:13:20',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Société Vendeur de chips ajoutée dans Dolibarr\nAuteur: admin',NULL,NULL),(20,NULL,1,'2010-07-11 17:15:42','2010-07-11 17:15:42',NULL,NULL,50,NULL,'Commande CF1007-0001 validée','2010-07-11 17:15:42','2010-07-11 15:15:42',1,NULL,NULL,13,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0001 validée\nAuteur: admin',NULL,NULL),(21,NULL,1,'2010-07-11 18:47:33','2010-07-11 18:47:33',NULL,NULL,50,NULL,'Commande CF1007-0002 validée','2010-07-11 18:47:33','2010-07-11 16:47:33',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Commande CF1007-0002 validée\nAuteur: admin',NULL,NULL),(22,NULL,1,'2010-07-18 11:36:18','2010-07-18 11:36:18',NULL,NULL,50,NULL,'Proposition PR1007-0003 validée','2010-07-18 11:36:18','2011-07-18 17:29:22',1,NULL,NULL,4,NULL,0,NULL,NULL,1,0,0,1,100,'',NULL,NULL,'Proposition PR1007-0003 validée\nAuteur: admin',3,'propal'),(23,NULL,1,'2011-07-18 20:49:58','2011-07-18 20:49:58',NULL,NULL,50,NULL,'Invoice FA1007-0002 validated in Dolibarr','2011-07-18 20:49:58','2011-07-18 18:49:58',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 validated in Dolibarr\nAuthor: admin',2,'invoice'),(24,NULL,1,'2011-07-28 01:37:00',NULL,NULL,NULL,1,NULL,'Phone call','2011-07-28 01:37:48','2011-07-27 23:37:48',1,NULL,NULL,NULL,2,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(25,NULL,1,'2011-08-01 02:31:24','2011-08-01 02:31:24',NULL,NULL,50,NULL,'Company mmm added into Dolibarr','2011-08-01 02:31:24','2011-08-01 00:31:24',1,NULL,NULL,15,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company mmm added into Dolibarr\nAuthor: admin',15,'societe'),(26,NULL,1,'2011-08-01 02:31:43','2011-08-01 02:31:43',NULL,NULL,50,NULL,'Company ppp added into Dolibarr','2011-08-01 02:31:43','2011-08-01 00:31:43',1,NULL,NULL,16,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ppp added into Dolibarr\nAuthor: admin',16,'societe'),(27,NULL,1,'2011-08-01 02:41:26','2011-08-01 02:41:26',NULL,NULL,50,NULL,'Company aaa added into Dolibarr','2011-08-01 02:41:26','2011-08-01 00:41:26',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company aaa added into Dolibarr\nAuthor: admin',17,'societe'),(28,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 validated in Dolibarr\nAuthor: admin',5,'invoice'),(29,NULL,1,'2011-08-01 03:34:11','2011-08-01 03:34:11',NULL,NULL,50,NULL,'Invoice FA1108-0003 validated in Dolibarr','2011-08-01 03:34:11','2011-08-01 01:34:11',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0003 changed to paid in Dolibarr\nAuthor: admin',5,'invoice'),(30,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 validated in Dolibarr\nAuthor: admin',6,'invoice'),(31,NULL,1,'2011-08-06 20:33:54','2011-08-06 20:33:54',NULL,NULL,50,NULL,'Invoice FA1108-0004 validated in Dolibarr','2011-08-06 20:33:54','2011-08-06 18:33:54',1,NULL,NULL,7,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0004 changed to paid in Dolibarr\nAuthor: admin',6,'invoice'),(38,NULL,1,'2011-08-08 02:41:55','2011-08-08 02:41:55',NULL,NULL,50,NULL,'Invoice FA1108-0005 validated in Dolibarr','2011-08-08 02:41:55','2011-08-08 00:41:55',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 validated in Dolibarr\nAuthor: admin',8,'invoice'),(40,NULL,1,'2011-08-08 02:53:40','2011-08-08 02:53:40',NULL,NULL,50,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr','2011-08-08 02:53:40','2011-08-08 00:53:40',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0005 changed to paid in Dolibarr\nAuthor: admin',8,'invoice'),(41,NULL,1,'2011-08-08 02:54:05','2011-08-08 02:54:05',NULL,NULL,50,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr','2011-08-08 02:54:05','2011-08-08 00:54:05',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1007-0002 changed to paid in Dolibarr\nAuthor: admin',2,'invoice'),(42,NULL,1,'2011-08-08 02:55:04','2011-08-08 02:55:04',NULL,NULL,50,NULL,'Invoice FA1107-0006 validated in Dolibarr','2011-08-08 02:55:04','2011-08-08 00:55:04',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 validated in Dolibarr\nAuthor: admin',3,'invoice'),(43,NULL,1,'2011-08-08 02:55:26','2011-08-08 02:55:26',NULL,NULL,50,NULL,'Invoice FA1108-0007 validated in Dolibarr','2011-08-08 02:55:26','2011-08-08 00:55:26',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1108-0007 validated in Dolibarr\nAuthor: admin',9,'invoice'),(44,NULL,1,'2011-08-08 02:55:58','2011-08-08 02:55:58',NULL,NULL,50,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr','2011-08-08 02:55:58','2011-08-08 00:55:58',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Invoice FA1107-0006 changed to paid in Dolibarr\nAuthor: admin',3,'invoice'),(45,NULL,1,'2011-08-08 03:04:22','2011-08-08 03:04:22',NULL,NULL,50,NULL,'Order CO1108-0001 validated','2011-08-08 03:04:22','2011-08-08 01:04:22',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1108-0001 validated\nAuthor: admin',5,'order'),(46,NULL,1,'2011-08-08 13:59:09','2011-08-08 13:59:09',NULL,NULL,50,NULL,'Order CO1107-0002 validated','2011-08-08 13:59:10','2011-08-08 11:59:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CO1107-0002 validated\nAuthor: admin',1,'order'),(47,NULL,1,'2011-08-08 14:24:18','2011-08-08 14:24:18',NULL,NULL,50,NULL,'Proposal PR1007-0001 validated','2011-08-08 14:24:18','2011-08-08 12:24:18',1,NULL,NULL,2,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1007-0001 validated\nAuthor: admin',1,'propal'),(48,NULL,1,'2011-08-08 14:24:24','2011-08-08 14:24:24',NULL,NULL,50,NULL,'Proposal PR1108-0004 validated','2011-08-08 14:24:24','2011-08-08 12:24:24',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposal PR1108-0004 validated\nAuthor: admin',4,'propal'),(49,NULL,1,'2011-08-08 15:04:37','2011-08-08 15:04:37',NULL,NULL,50,NULL,'Order CF1108-0003 validated','2011-08-08 15:04:37','2011-08-08 13:04:37',1,NULL,NULL,17,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Order CF1108-0003 validated\nAuthor: admin',6,'order_supplier'),(50,NULL,1,'2012-12-08 17:56:47','2012-12-08 17:56:47',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:56:47','2012-12-08 16:56:47',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(51,NULL,1,'2012-12-08 17:57:11','2012-12-08 17:57:11',NULL,NULL,40,NULL,'Facture AV1212-0001 validée dans Dolibarr','2012-12-08 17:57:11','2012-12-08 16:57:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0001 validée dans Dolibarr\nAuteur: admin',10,'invoice'),(52,NULL,1,'2012-12-08 17:58:27','2012-12-08 17:58:27',NULL,NULL,40,NULL,'Facture FA1212-0008 validée dans Dolibarr','2012-12-08 17:58:27','2012-12-08 16:58:27',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0008 validée dans Dolibarr\nAuteur: admin',11,'invoice'),(53,NULL,1,'2012-12-08 18:20:49','2012-12-08 18:20:49',NULL,NULL,40,NULL,'Facture AV1212-0002 validée dans Dolibarr','2012-12-08 18:20:49','2012-12-08 17:20:49',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 validée dans Dolibarr\nAuteur: admin',12,'invoice'),(54,NULL,1,'2012-12-09 18:35:07','2012-12-09 18:35:07',NULL,NULL,40,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr','2012-12-09 18:35:07','2012-12-09 17:35:07',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture AV1212-0002 passée à payée dans Dolibarr\nAuteur: admin',12,'invoice'),(55,NULL,1,'2012-12-09 20:14:42','2012-12-09 20:14:42',NULL,NULL,40,NULL,'Société doe john ajoutée dans Dolibarr','2012-12-09 20:14:42','2012-12-09 19:14:42',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société doe john ajoutée dans Dolibarr\nAuteur: admin',18,'societe'),(56,NULL,1,'2012-12-12 18:54:19','2012-12-12 18:54:19',NULL,NULL,40,NULL,'Facture FA1212-0009 validée dans Dolibarr','2012-12-12 18:54:19','2012-12-12 17:54:19',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0009 validée dans Dolibarr\nAuteur: admin',55,'invoice'),(121,NULL,1,'2012-12-06 10:00:00',NULL,NULL,NULL,50,NULL,'aaab','2012-12-21 17:48:08','2012-12-21 16:54:07',3,1,NULL,NULL,NULL,0,3,NULL,NULL,1,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(122,NULL,1,'2012-12-21 18:09:52','2012-12-21 18:09:52',NULL,NULL,40,NULL,'Facture client FA1007-0001 envoyée par EMail','2012-12-21 18:09:52','2012-12-21 17:09:52',1,NULL,NULL,9,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Mail envoyé par Firstname SuperAdminName à laurent@mydomain.com.\nSujet du mail: Envoi facture FA1007-0001\nCorps du mail:\nVeuillez trouver ci-joint la facture FA1007-0001\r\n\r\nVous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement via Paypal\r\n\r\nhttp://localhost/dolibarrnew/public/paypal/newpayment.php?source=invoice&ref=FA1007-0001&securekey=50c82fab36bb3b6aa83e2a50691803b2\r\n\r\nCordialement',1,'invoice'),(123,NULL,1,'2013-01-06 13:13:57','2013-01-06 13:13:57',NULL,NULL,40,NULL,'Facture 16 validée dans Dolibarr','2013-01-06 13:13:57','2013-01-06 12:13:57',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture 16 validée dans Dolibarr\nAuteur: admin',16,'invoice_supplier'),(124,NULL,1,'2013-01-12 12:23:05','2013-01-12 12:23:05',NULL,NULL,40,NULL,'Patient aaa ajouté','2013-01-12 12:23:05','2013-01-12 11:23:05',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient aaa ajouté\nAuteur: admin',19,'societe'),(125,NULL,1,'2013-01-12 12:52:20','2013-01-12 12:52:20',NULL,NULL,40,NULL,'Patient pppoo ajouté','2013-01-12 12:52:20','2013-01-12 11:52:20',1,NULL,NULL,20,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pppoo ajouté\nAuteur: admin',20,'societe'),(127,NULL,1,'2013-01-19 18:22:48','2013-01-19 18:22:48',NULL,NULL,40,NULL,'Facture FS1301-0001 validée dans Dolibarr','2013-01-19 18:22:48','2013-01-19 17:22:48',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0001 validée dans Dolibarr\nAuteur: admin',148,'invoice'),(128,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 validée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 validée dans Dolibarr\nAuteur: admin',150,'invoice'),(129,NULL,1,'2013-01-19 18:31:10','2013-01-19 18:31:10',NULL,NULL,40,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr','2013-01-19 18:31:10','2013-01-19 17:31:10',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA6801-0010 passée à payée dans Dolibarr\nAuteur: admin',150,'invoice'),(130,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 validée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 validée dans Dolibarr\nAuteur: admin',151,'invoice'),(131,NULL,1,'2013-01-19 18:31:58','2013-01-19 18:31:58',NULL,NULL,40,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr','2013-01-19 18:31:58','2013-01-19 17:31:58',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FS1301-0002 passée à payée dans Dolibarr\nAuteur: admin',151,'invoice'),(132,NULL,1,'2013-01-23 15:07:54','2013-01-23 15:07:54',NULL,NULL,50,NULL,'Consultation 24 saisie (aaa)','2013-01-23 15:07:54','2013-01-23 14:07:54',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Consultation 24 saisie (aaa)\nAuteur: admin',24,'cabinetmed_cons'),(133,NULL,1,'2013-01-23 16:56:58','2013-01-23 16:56:58',NULL,NULL,40,NULL,'Patient pa ajouté','2013-01-23 16:56:58','2013-01-23 15:56:58',1,NULL,NULL,21,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient pa ajouté\nAuteur: admin',21,'societe'),(134,NULL,1,'2013-01-23 17:34:00',NULL,NULL,NULL,50,NULL,'bbcv','2013-01-23 17:35:21','2013-01-23 16:35:21',1,NULL,1,2,NULL,0,1,NULL,NULL,0,0,1,-1,'',NULL,NULL,'',NULL,NULL),(135,NULL,1,'2013-02-12 15:54:00','2013-02-12 15:54:00',NULL,NULL,40,NULL,'Facture FA1212-0011 validée dans Dolibarr','2013-02-12 15:54:37','2013-02-20 20:11:54',1,1,NULL,7,NULL,0,NULL,NULL,1,0,0,1,50,NULL,NULL,NULL,'Facture FA1212-0011 validée dans Dolibarr
\r\nAuteur: admin',13,'invoice'),(136,NULL,1,'2013-02-12 17:06:51','2013-02-12 17:06:51',NULL,NULL,40,NULL,'Commande CO1107-0003 validée','2013-02-12 17:06:51','2013-02-12 16:06:51',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0003 validée\nAuteur: admin',2,'order'),(137,NULL,1,'2013-02-17 16:22:10','2013-02-17 16:22:10',NULL,NULL,40,NULL,'Proposition PR1302-0009 validée','2013-02-17 16:22:10','2013-02-17 15:22:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0009 validée\nAuteur: admin',9,'propal'),(138,NULL,1,'2013-02-17 16:27:00','2013-02-17 16:27:00',NULL,NULL,40,NULL,'Facture FA1302-0012 validée dans Dolibarr','2013-02-17 16:27:00','2013-02-17 15:27:00',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1302-0012 validée dans Dolibarr\nAuteur: admin',152,'invoice'),(139,NULL,1,'2013-02-17 16:27:29','2013-02-17 16:27:29',NULL,NULL,40,NULL,'Proposition PR1302-0010 validée','2013-02-17 16:27:29','2013-02-17 15:27:29',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition PR1302-0010 validée\nAuteur: admin',11,'propal'),(140,NULL,1,'2013-02-17 18:27:56','2013-02-17 18:27:56',NULL,NULL,40,NULL,'Commande CO1107-0004 validée','2013-02-17 18:27:56','2013-02-17 17:27:56',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1107-0004 validée\nAuteur: admin',3,'order'),(141,NULL,1,'2013-02-17 18:38:14','2013-02-17 18:38:14',NULL,NULL,40,NULL,'Commande CO1302-0005 validée','2013-02-17 18:38:14','2013-02-17 17:38:14',1,NULL,NULL,18,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CO1302-0005 validée\nAuteur: admin',7,'order'),(142,NULL,1,'2013-02-26 22:57:50','2013-02-26 22:57:50',NULL,NULL,40,NULL,'Company pppp added into Dolibarr','2013-02-26 22:57:50','2013-02-26 21:57:50',1,NULL,NULL,22,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company pppp added into Dolibarr\nAuthor: admin',22,'societe'),(143,NULL,1,'2013-02-26 22:58:13','2013-02-26 22:58:13',NULL,NULL,40,NULL,'Company ttttt added into Dolibarr','2013-02-26 22:58:13','2013-02-26 21:58:13',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Company ttttt added into Dolibarr\nAuthor: admin',23,'societe'),(144,NULL,1,'2013-02-27 10:00:00','2013-02-27 19:20:00',NULL,NULL,5,NULL,'Rendez-vous','2013-02-27 19:20:53','2013-02-27 18:20:53',1,NULL,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,'',33600,NULL,'',NULL,NULL),(145,NULL,1,'2013-02-27 19:28:00',NULL,NULL,NULL,2,NULL,'fdsfsd','2013-02-27 19:28:48','2013-02-27 18:29:53',1,1,NULL,NULL,NULL,0,1,NULL,1,0,0,1,-1,NULL,NULL,NULL,NULL,NULL,NULL),(146,NULL,1,'2013-03-06 10:05:07','2013-03-06 10:05:07',NULL,NULL,40,NULL,'Contrat (PROV3) validé dans Dolibarr','2013-03-06 10:05:07','2013-03-06 09:05:07',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Contrat (PROV3) validé dans Dolibarr\nAuteur: admin',3,'contract'),(147,NULL,1,'2013-03-06 16:43:37','2013-03-06 16:43:37',NULL,NULL,40,NULL,'Facture FA1307-0013 validée dans Dolibarr','2013-03-06 16:43:37','2013-03-06 15:43:37',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée dans Dolibarr\nAuteur: admin',158,'invoice'),(148,NULL,1,'2013-03-06 16:44:12','2013-03-06 16:44:12',NULL,NULL,40,NULL,'Facture FA1407-0014 validée dans Dolibarr','2013-03-06 16:44:12','2013-03-06 15:44:12',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1407-0014 validée dans Dolibarr\nAuteur: admin',159,'invoice'),(149,NULL,1,'2013-03-06 16:47:48','2013-03-06 16:47:48',NULL,NULL,40,NULL,'Facture FA1507-0015 validée dans Dolibarr','2013-03-06 16:47:48','2013-03-06 15:47:48',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1507-0015 validée dans Dolibarr\nAuteur: admin',160,'invoice'),(150,NULL,1,'2013-03-06 16:48:16','2013-03-06 16:48:16',NULL,NULL,40,NULL,'Facture FA1607-0016 validée dans Dolibarr','2013-03-06 16:48:16','2013-03-06 15:48:16',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1607-0016 validée dans Dolibarr\nAuteur: admin',161,'invoice'),(151,NULL,1,'2013-03-06 17:13:59','2013-03-06 17:13:59',NULL,NULL,40,NULL,'Société smith smith ajoutée dans Dolibarr','2013-03-06 17:13:59','2013-03-06 16:13:59',1,NULL,NULL,24,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Société smith smith ajoutée dans Dolibarr\nAuteur: admin',24,'societe'),(152,NULL,1,'2013-03-08 10:02:22','2013-03-08 10:02:22',NULL,NULL,40,NULL,'Proposition (PROV12) validée dans Dolibarr','2013-03-08 10:02:22','2013-03-08 09:02:22',1,NULL,NULL,23,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Proposition (PROV12) validée dans Dolibarr\nAuteur: admin',12,'propal'),(203,NULL,1,'2013-03-09 19:39:27','2013-03-09 19:39:27',NULL,NULL,40,'AC_ORDER_SUPPLIER_VALIDATE','Commande CF1303-0004 validée','2013-03-09 19:39:27','2013-03-09 18:39:27',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Commande CF1303-0004 validée\nAuteur: admin',13,'order_supplier'),(204,NULL,1,'2013-03-10 15:47:37','2013-03-10 15:47:37',NULL,NULL,40,'AC_COMPANY_CREATE','Patient créé','2013-03-10 15:47:37','2013-03-10 14:47:37',1,NULL,NULL,25,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Patient créé\nAuteur: admin',25,'societe'),(205,NULL,1,'2013-03-10 15:57:32','2013-03-10 15:57:32',NULL,NULL,40,'AC_COMPANY_CREATE','Tiers créé','2013-03-10 15:57:32','2013-03-10 14:57:32',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Tiers créé\nAuteur: admin',26,'societe'),(206,NULL,1,'2013-03-10 15:58:28','2013-03-10 15:58:28',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0017 validée','2013-03-10 15:58:28','2013-03-10 14:58:28',1,NULL,NULL,26,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0017 validée\nAuteur: admin',208,'invoice'),(207,NULL,1,'2013-03-19 09:38:10','2013-03-19 09:38:10',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0018 validée','2013-03-19 09:38:10','2013-03-19 08:38:10',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0018 validée\nAuteur: admin',209,'invoice'),(208,NULL,1,'2013-03-20 14:30:11','2013-03-20 14:30:11',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1107-0019 validée','2013-03-20 14:30:11','2013-03-20 13:30:11',1,NULL,NULL,10,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1107-0019 validée\nAuteur: admin',210,'invoice'),(209,NULL,1,'2013-03-22 09:40:25','2013-03-22 09:40:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-22 09:40:25','2013-03-22 08:40:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(210,NULL,1,'2013-03-23 17:16:25','2013-03-23 17:16:25',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1303-0020 validée','2013-03-23 17:16:25','2013-03-23 16:16:25',1,NULL,NULL,19,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1303-0020 validée\nAuteur: admin',211,'invoice'),(211,NULL,1,'2013-03-23 18:08:27','2013-03-23 18:08:27',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1307-0013 validée','2013-03-23 18:08:27','2013-03-23 17:08:27',1,NULL,NULL,12,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1307-0013 validée\nAuteur: admin',158,'invoice'),(212,NULL,1,'2013-03-24 15:54:00','2013-03-24 15:54:00',NULL,NULL,40,'AC_BILL_VALIDATE','Facture FA1212-0021 validée','2013-03-24 15:54:00','2013-03-24 14:54:00',1,NULL,NULL,1,NULL,0,NULL,NULL,1,0,0,1,-1,'',NULL,NULL,'Facture FA1212-0021 validée\nAuteur: admin',32,'invoice'),(213,NULL,1,'2013-11-07 01:02:39','2013-11-07 01:02:39',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:02:39','2013-11-07 00:02:39',1,NULL,NULL,27,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',27,'societe'),(214,NULL,1,'2013-11-07 01:05:22','2013-11-07 01:05:22',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:05:22','2013-11-07 00:05:22',1,NULL,NULL,28,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',28,'societe'),(215,NULL,1,'2013-11-07 01:07:07','2013-11-07 01:07:07',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:07','2013-11-07 00:07:07',1,NULL,NULL,29,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',29,'societe'),(216,NULL,1,'2013-11-07 01:07:58','2013-11-07 01:07:58',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:07:58','2013-11-07 00:07:58',1,NULL,NULL,30,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',30,'societe'),(217,NULL,1,'2013-11-07 01:10:09','2013-11-07 01:10:09',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:10:09','2013-11-07 00:10:09',1,NULL,NULL,31,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',31,'societe'),(218,NULL,1,'2013-11-07 01:15:57','2013-11-07 01:15:57',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:15:57','2013-11-07 00:15:57',1,NULL,NULL,32,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',32,'societe'),(219,NULL,1,'2013-11-07 01:16:51','2013-11-07 01:16:51',NULL,NULL,40,'AC_COMPANY_CREATE','Third party created','2013-11-07 01:16:51','2013-11-07 00:16:51',1,NULL,NULL,33,NULL,0,NULL,0,1,0,0,1,-1,'',NULL,NULL,'Third party created\nAuthor: admin',33,'societe'); /*!40000 ALTER TABLE `llx_actioncomm` ENABLE KEYS */; UNLOCK TABLES; @@ -6805,7 +6805,7 @@ CREATE TABLE `llx_user` ( LOCK TABLES `llx_user` WRITE; /*!40000 ALTER TABLE `llx_user` DISABLE KEYS */; -INSERT INTO `llx_user` VALUES (1,'2010-07-08 13:20:11','2012-12-12 17:54:10','admin',0,NULL,NULL,NULL,'admin','21232f297a57a5a743894a0e4a801fc3',NULL,'SuperAdminName','Firstname','',NULL,'','','','bidon@destailleur.fr','',1,'','','',1,1,NULL,NULL,NULL,'','2014-04-05 16:19:30','2013-11-07 01:01:51',NULL,'',1,'01.jpg',NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(2,'2010-07-08 13:54:48','2010-07-08 11:54:48','demo',1,NULL,NULL,NULL,'demo','fe01ce2a7fbac8fafaed7c982a04e229',NULL,'John','Doe',NULL,NULL,'09123123','','','johndoe@mycompany.com',NULL,0,'','','',1,1,NULL,NULL,NULL,'','2013-03-24 16:30:29','2010-07-08 14:12:02',NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(3,'2010-07-11 16:18:59','2013-02-20 19:07:21','adupont',1,NULL,NULL,NULL,'adupont','00856ab2bbb748aa29aa335a6e3a2407',NULL,'Dupont','Alain','',NULL,'','','','toto@aa.com','',0,'','','',1,1,NULL,NULL,2,'','2012-12-21 17:38:55',NULL,NULL,'',1,NULL,NULL,NULL,2,NULL,NULL,NULL,0,0,NULL,NULL),(4,'2013-01-23 17:52:27','2013-02-20 19:48:01','aaa',1,NULL,NULL,NULL,'aaa','47bce5c74f589f4867dbd57e9ca9f808',NULL,'aaa','','',NULL,'','','','','',0,'','','',1,1,17,6,NULL,'','2013-02-25 10:18:41','2013-01-23 17:53:20',NULL,'',1,NULL,NULL,NULL,5,NULL,NULL,NULL,0,0,NULL,NULL),(5,'2013-01-23 17:52:37','2013-01-23 16:52:37','bbb',0,NULL,NULL,NULL,'bbb','08f8e0260c64418510cefb2b06eee5cd',NULL,'bbb','','',NULL,'','','','','',1,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(6,'2013-02-16 20:22:40','2013-02-16 19:22:40','aaab',2,NULL,NULL,NULL,'aaab','4c189b020ceb022e0ecc42482802e2b8',NULL,'aaab','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(7,'2013-02-16 20:48:15','2013-02-16 19:48:15','zzz',2,NULL,NULL,NULL,'zzz','f3abb86bd34cf4d52698f14c0da1dc60',NULL,'zzz','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(9,'2013-02-16 20:50:07','2013-03-24 16:10:14','zzzg',2,NULL,NULL,NULL,'jc28fg4h','93d789524fd223cf05eecea3f59cbe86',NULL,'zzzg','','',NULL,'','','','','fsdkkfsdf
\r\nfsdfsd
\r\nfsdfs',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,5,'','','',NULL,NULL,NULL,NULL); +INSERT INTO `llx_user` VALUES (1,'2010-07-08 13:20:11','2012-12-12 17:54:10','admin',0,NULL,NULL,NULL,'admin','21232f297a57a5a743894a0e4a801fc3',NULL,'SuperAdminName','Firstname','',NULL,'','','','bidon@mydomain.com','',1,'','','',1,1,NULL,NULL,NULL,'','2014-04-05 16:19:30','2013-11-07 01:01:51',NULL,'',1,'01.jpg',NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(2,'2010-07-08 13:54:48','2010-07-08 11:54:48','demo',1,NULL,NULL,NULL,'demo','fe01ce2a7fbac8fafaed7c982a04e229',NULL,'John','Doe',NULL,NULL,'09123123','','','johndoe@mycompany.com',NULL,0,'','','',1,1,NULL,NULL,NULL,'','2013-03-24 16:30:29','2010-07-08 14:12:02',NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(3,'2010-07-11 16:18:59','2013-02-20 19:07:21','adupont',1,NULL,NULL,NULL,'adupont','00856ab2bbb748aa29aa335a6e3a2407',NULL,'Dupont','Alain','',NULL,'','','','toto@aa.com','',0,'','','',1,1,NULL,NULL,2,'','2012-12-21 17:38:55',NULL,NULL,'',1,NULL,NULL,NULL,2,NULL,NULL,NULL,0,0,NULL,NULL),(4,'2013-01-23 17:52:27','2013-02-20 19:48:01','aaa',1,NULL,NULL,NULL,'aaa','47bce5c74f589f4867dbd57e9ca9f808',NULL,'aaa','','',NULL,'','','','','',0,'','','',1,1,17,6,NULL,'','2013-02-25 10:18:41','2013-01-23 17:53:20',NULL,'',1,NULL,NULL,NULL,5,NULL,NULL,NULL,0,0,NULL,NULL),(5,'2013-01-23 17:52:37','2013-01-23 16:52:37','bbb',0,NULL,NULL,NULL,'bbb','08f8e0260c64418510cefb2b06eee5cd',NULL,'bbb','','',NULL,'','','','','',1,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(6,'2013-02-16 20:22:40','2013-02-16 19:22:40','aaab',2,NULL,NULL,NULL,'aaab','4c189b020ceb022e0ecc42482802e2b8',NULL,'aaab','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(7,'2013-02-16 20:48:15','2013-02-16 19:48:15','zzz',2,NULL,NULL,NULL,'zzz','f3abb86bd34cf4d52698f14c0da1dc60',NULL,'zzz','','',NULL,'','','','','',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL),(9,'2013-02-16 20:50:07','2013-03-24 16:10:14','zzzg',2,NULL,NULL,NULL,'jc28fg4h','93d789524fd223cf05eecea3f59cbe86',NULL,'zzzg','','',NULL,'','','','','fsdkkfsdf
\r\nfsdfsd
\r\nfsdfs',0,'','','',1,1,NULL,NULL,NULL,'',NULL,NULL,NULL,'',1,NULL,NULL,NULL,5,'','','',NULL,NULL,NULL,NULL); /*!40000 ALTER TABLE `llx_user` ENABLE KEYS */; UNLOCK TABLES; diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 29ed90bb7be..d015d8f07b5 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -210,7 +210,7 @@ if ($action == 'create') { print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -252,7 +252,7 @@ if ($action == 'create') { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -272,7 +272,7 @@ if ($action == 'create') { // Edit mode if ($action == 'update') { - dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); + print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr'); print '
'."\n"; print ''; @@ -314,7 +314,7 @@ if ($action == 'create') { print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -327,7 +327,7 @@ if ($action == 'create') { // View mode $linkback = ''.$langs->trans("BackToList").''; - dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr'); + print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr'); dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref'); @@ -364,7 +364,7 @@ if ($action == 'create') { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Actions buttons diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index f68fbc18905..eefe62a47a4 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -102,7 +102,7 @@ print ''."\n"; print ''; print ''; -dol_fiche_head(); +print dol_get_fiche_head(); print ''; @@ -146,7 +146,7 @@ if (!empty($cat_id)) print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index a4227a761a4..aa10c0101c1 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -159,7 +159,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -187,7 +187,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -202,7 +202,7 @@ if ($action == 'create') $head = fiscalyear_prepare_head($object); if ($action == 'edit') { - dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); print '
'."\n"; print ''; @@ -248,7 +248,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } else { /* * Confirm delete @@ -257,7 +257,7 @@ if ($action == 'create') print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete"); } - dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron'); print ''; @@ -296,7 +296,7 @@ if ($action == 'create') print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); if (!empty($user->rights->accounting->fiscalyear->write)) { diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index f293c9b450b..2971e2eb114 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -49,7 +49,7 @@ if ($id) { $head = fiscalyear_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron'); + print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron'); print '
'; dol_print_object_info($object); diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 8ca880de25f..ef9ebe3f9b9 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -351,7 +351,7 @@ if ($action == 'create') print ''."\n"; print ''."\n"; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -386,7 +386,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -415,7 +415,7 @@ if ($action == 'create') $head[$h][2] = 'transaction'; $h++; - dol_fiche_head($head, 'transaction', '', -1); + print dol_get_fiche_head($head, 'transaction', '', -1); //dol_banner_tab($object, '', $backlink); @@ -573,7 +573,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; @@ -719,7 +719,7 @@ if ($action == 'create') } } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 321ef282dff..8e6387d4608 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -135,13 +135,13 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company'); +print dol_get_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company'); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); -dol_fiche_end(); +print dol_get_fiche_end(); $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 144c2595d25..afdf5f902f7 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -134,13 +134,13 @@ $head = societe_prepare_head($object); dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error'); -dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company'); +print dol_get_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company'); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom'); -dol_fiche_end(); +print dol_get_fiche_end(); $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; $sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 199899f89d5..e7a65ceec97 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -453,21 +453,22 @@ class AccountingAccount extends CommonObject */ public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '') { - global $langs, $conf, $user; + global $langs, $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; + $url = ''; if (empty($option) || $option == 'ledger') { - $url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + $url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); $labelurl = $langs->trans("ShowAccountingAccountInLedger"); } elseif ($option == 'journals') { - $url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number; + $url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number); $labelurl = $langs->trans("ShowAccountingAccountInJournals"); } elseif ($option == 'accountcard') { - $url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id; + $url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id); $labelurl = $langs->trans("ShowAccountingAccount"); } diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index ed8f347a177..1a37bb1019b 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -119,7 +119,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -137,7 +137,7 @@ if (!empty($id)) { print ''; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index ab02592f6b8..67c790a9c36 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -121,7 +121,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -146,7 +146,7 @@ if (!empty($id)) { print ''; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 0ed6db948a2..29777316a64 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -339,7 +339,7 @@ if ($result) { $tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30); $tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id; - // Retreive the accounting code of the social contribution of the payment from link of payment. + // Retrieve the accounting code of the social contribution of the payment from link of payment. // Note: We have the social contribution id, it can be faster to get accounting code from social contribution id. $sqlmid = 'SELECT cchgsoc.accountancy_code'; $sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc"; diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 4a4747cfaf4..d6b289a76c8 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -121,7 +121,7 @@ if (!empty($id)) { print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_accountancy'); - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -141,7 +141,7 @@ if (!empty($id)) { print ''; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index f2c52daa4b0..17d5f51d6eb 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -132,7 +132,7 @@ print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user'); +print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user'); print '
'; print ''; @@ -246,7 +246,7 @@ $helptext .= '__YEAR__, __MONTH__, __DAY__'; form_constantes($constantes, 0, $helptext); -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index a3550e4a35a..4374d281895 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -119,7 +119,7 @@ print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); -dol_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); +print dol_get_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); // TODO Use global form //print ''; @@ -136,7 +136,7 @@ form_constantes($constantes, 0, $helptext); //print '
'; //print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index 8ca29286cab..ae4f1989114 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'user'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'user'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 5546a99a334..92b5ed990e3 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -73,11 +73,11 @@ print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup'); $head = member_admin_prepare_head(); -dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1, 'user'); +print dol_get_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1, 'user'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index d030c73f530..330568c20bf 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -94,7 +94,7 @@ print '
'; print ''; print ''; -dol_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user'); +print dol_get_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user'); if ($conf->use_javascript_ajax) { print "\n".''."\n"; - } + if (GETPOST('paymentsave')) print '$("#'.GETPOST('paymentsave').'").prop("checked",true);'; + print '});'; + print ''."\n"; + } // Confirm create third party @@ -778,16 +778,16 @@ if ($rowid > 0) { if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED)) { $tmpcompany = new Societe($db); $tmpcompany->name = $companyname; - $tmpcompany->get_codeclient($tmpcompany, 0); + $tmpcompany->get_codeclient($tmpcompany, 0); $customercode = $tmpcompany->code_client; $formquestion[] = array( - 'label' => $langs->trans("CustomerCode"), - 'type' => 'text', - 'name' => 'customercode', - 'value' => $customercode, - 'morecss' => 'minwidth300', - 'moreattr' => 'maxlength="128"', - ); + 'label' => $langs->trans("CustomerCode"), + 'type' => 'text', + 'name' => 'customercode', + 'value' => $customercode, + 'morecss' => 'minwidth300', + 'moreattr' => 'maxlength="128"', + ); } // @todo Add other extrafields mandatory for thirdparty creation @@ -795,99 +795,99 @@ if ($rowid > 0) { } - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print "\n"; - print ''; + print ''; $today = dol_now(); - $datefrom = 0; - $dateto = 0; - $paymentdate = -1; + $datefrom = 0; + $dateto = 0; + $paymentdate = -1; - // Date payment - if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday')) { - $paymentdate = dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear')); - } + // Date payment + if (GETPOST('paymentyear') && GETPOST('paymentmonth') && GETPOST('paymentday')) { + $paymentdate = dol_mktime(0, 0, 0, GETPOST('paymentmonth'), GETPOST('paymentday'), GETPOST('paymentyear')); + } - print ''; - // Date start subscription - print '"; + print ''; + // Date start subscription + print '"; - // Date end subscription - if (GETPOST('endday')) { - $dateto = dol_mktime(0, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); - } - if (!$dateto) { - $dateto = -1; // By default, no date is suggested - } - print '"; + // Date end subscription + if (GETPOST('endday')) { + $dateto = dol_mktime(0, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); + } + if (!$dateto) { + $dateto = -1; // By default, no date is suggested + } + print '"; - if ($adht->subscription) { - // Amount - print ''; + if ($adht->subscription) { + // Amount + print ''; - // Label - print ''; - print ''; + // Label + print ''; + print ''; - // Complementary action - if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { - $company = new Societe($db); - if ($object->fk_soc) { - $result = $company->fetch($object->fk_soc); - } + // Complementary action + if ((!empty($conf->banque->enabled) || !empty($conf->facture->enabled)) && empty($conf->global->ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS)) { + $company = new Societe($db); + if ($object->fk_soc) { + $result = $company->fetch($object->fk_soc); + } - // Title payments - //print ''; + // Title payments + //print ''; - // No more action - print ''; - print ''; + print '\n"; // Payment mode @@ -1020,7 +1020,7 @@ if ($rowid > 0) { print ''; print '
'.$langs->trans("DateSubscription").''; - if (GETPOST('reday')) { - $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - } - if (!$datefrom) { - $datefrom = $object->datevalid; - if ($object->datefin > 0) { - $datefrom = dol_time_plus_duree($object->datefin, 1, 'd'); - } - } - print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1); - print "
'.$langs->trans("DateSubscription").''; + if (GETPOST('reday')) { + $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + } + if (!$datefrom) { + $datefrom = $object->datevalid; + if ($object->datefin > 0) { + $datefrom = dol_time_plus_duree($object->datefin, 1, 'd'); + } + } + print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1); + print "
'.$langs->trans("DateEndSubscription").''; - print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0); - print "
'.$langs->trans("DateEndSubscription").''; + print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0); + print "
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Amount").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("Label").'
'.$langs->trans("Label").'
'.$langs->trans("Payment").'
'.$langs->trans("Payment").'
'.$langs->trans('MoreActions'); - print ''; - print ' '.$langs->trans("None").'
'; - // Add entry into bank accoun - if (!empty($conf->banque->enabled)) { - print ' '.$langs->trans("MoreActionBankDirect").'
'; - } - // Add invoice with no payments - if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { - print 'fk_soc)) print ' disabled'; - print '> '.$langs->trans("MoreActionInvoiceOnly"); - if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else { - print ' ('; - if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); - print $langs->trans("NoThirdPartyAssociatedToMember"); - print ' - '; - print $langs->trans("CreateDolibarrThirdParty"); - print ')'; - } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; + // No more action + print '
'.$langs->trans('MoreActions'); + print ''; + print ' '.$langs->trans("None").'
'; + // Add entry into bank accoun + if (!empty($conf->banque->enabled)) { + print ' '.$langs->trans("MoreActionBankDirect").'
'; + } + // Add invoice with no payments + if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + print 'fk_soc)) print ' disabled'; + print '> '.$langs->trans("MoreActionInvoiceOnly"); + if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; + else { + print ' ('; + if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); + print $langs->trans("NoThirdPartyAssociatedToMember"); + print ' - '; + print $langs->trans("CreateDolibarrThirdParty"); + print ')'; + } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); $result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); @@ -896,23 +896,23 @@ if ($rowid > 0) { } print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product } - print '
'; - } - // Add invoice with payments - if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { - print 'fk_soc)) print ' disabled'; - print '> '.$langs->trans("MoreActionBankViaInvoice"); - if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; - else { - print ' ('; - if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); - print $langs->trans("NoThirdPartyAssociatedToMember"); - print ' - '; - print $langs->trans("CreateDolibarrThirdParty"); - print ')'; - } - if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; + print '
'; + } + // Add invoice with payments + if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) { + print 'fk_soc)) print ' disabled'; + print '> '.$langs->trans("MoreActionBankViaInvoice"); + if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; + else { + print ' ('; + if (empty($object->fk_soc)) print img_warning($langs->trans("NoThirdPartyAssociatedToMember")); + print $langs->trans("NoThirdPartyAssociatedToMember"); + print ' - '; + print $langs->trans("CreateDolibarrThirdParty"); + print ')'; + } + if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription", 0).''; if (!empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (!empty($conf->product->enabled) || !empty($conf->service->enabled))) { $prodtmp = new Product($db); $result = $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); @@ -927,7 +927,7 @@ if ($rowid > 0) { // Bank account print '
'.$langs->trans("FinancialAccount").''; - $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 1); + $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2); print "
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 017962701e4..6479b5c479f 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -170,7 +170,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') { print ""; print "fk_bank."\">"; - dol_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment'); + print dol_get_fiche_head($head, 'general', $langs->trans("Subscription"), 0, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -232,7 +232,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -256,7 +256,7 @@ if ($rowid && $action != 'edit') { $head = subscription_prepare_head($object); - dol_fiche_head($head, 'general', $langs->trans("Subscription"), -1, 'payment'); + print dol_get_fiche_head($head, 'general', $langs->trans("Subscription"), -1, 'payment'); // Confirmation to delete subscription if ($action == 'delete') { @@ -335,7 +335,7 @@ if ($rowid && $action != 'edit') { print ''; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Barre d'actions diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 78b3fd4384b..a7a4a897505 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -51,7 +51,7 @@ $result = $object->fetch($rowid); $head = subscription_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment'); +print dol_get_fiche_head($head, 'info', $langs->trans("Subscription"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -72,7 +72,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 364a7854fb7..9b5efa214b9 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -142,6 +142,7 @@ $now = dol_now(); // List of subscriptions $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, d.photo, d.statut,"; +$sql .= " d.gender, d.email, d.morphy,"; $sql .= " c.rowid as crowid, c.fk_type, c.subscription,"; $sql .= " c.dateadh, c.datef, c.datec as date_creation, c.tms as date_update,"; $sql .= " c.fk_bank as bank, c.note,"; @@ -151,8 +152,7 @@ $sql .= " JOIN ".MAIN_DB_PREFIX."subscription as c on d.rowid = c.fk_adherent"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."adherent_extrafields as ef on (d.rowid = ef.fk_object)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; -if (isset($date_select) && $date_select != '') -{ +if (isset($date_select) && $date_select != '') { $sql .= " AND c.dateadh >= '".((int) $date_select)."-01-01 00:00:00'"; $sql .= " AND c.dateadh < '".((int) $date_select + 1)."-01-01 00:00:00'"; } @@ -403,6 +403,9 @@ while ($i < min($num, $limit)) { $adherent->statut = $obj->statut; $adherent->login = $obj->login; $adherent->photo = $obj->photo; + $adherent->gender = $obj->gender; + $adherent->morphy = $obj->morphy; + $adherent->email = $obj->email; $adherent->typeid = $obj->type; $typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index ecd709bdd17..d1573f316f9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -207,7 +207,7 @@ llxHeader('', $langs->trans("MembersTypeSetup"), 'EN:Module_Foundations|FR:Modul // List of members type if (!$rowid && $action != 'create' && $action != 'edit') { - //dol_fiche_head(''); + //print dol_get_fiche_head(''); $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut as status, d.morphy"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; @@ -308,7 +308,7 @@ if ($action == 'create') { print ''; print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print ''; print ''; @@ -358,7 +358,7 @@ if ($action == 'create') { print ''; print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -389,7 +389,7 @@ if ($rowid > 0) { $head = member_type_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group'); + print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group'); $linkback = ''.$langs->trans("BackToList").''; @@ -433,7 +433,7 @@ if ($rowid > 0) { print ''; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Buttons @@ -710,7 +710,7 @@ if ($rowid > 0) { print ''; print ''; - dol_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group'); + print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group'); print ''; @@ -759,7 +759,7 @@ if ($rowid > 0) { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 5e745293050..d8deebba9ba 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -86,7 +86,7 @@ $form = new Form($db); $head = member_type_prepare_head($object); -dol_fiche_head($head, 'ldap', $langs->trans("MemberType"), -1, 'group'); +print dol_get_fiche_head($head, 'ldap', $langs->trans("MemberType"), -1, 'group'); $linkback = ''.$langs->trans("BackToList").''; @@ -114,7 +114,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); /* * Action bar diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 10c43dadbe3..6cf349270e8 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -160,13 +160,13 @@ if (!empty($object->multilangs)) { } -dol_fiche_head($head, 'translation', $titre, 0, 'group'); +print dol_get_fiche_head($head, 'translation', $titre, 0, 'group'); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback); -dol_fiche_end(); +print dol_get_fiche_end(); @@ -258,7 +258,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; print '
'.$langs->trans('Language').''; @@ -272,7 +272,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index b039032b9c2..cbf9fdbaa50 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -82,7 +82,7 @@ print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); -dol_fiche_head($head, 'accountant', $langs->trans("Company"), -1, 'company'); +print dol_get_fiche_head($head, 'accountant', $langs->trans("Company"), -1, 'company'); $form = new Form($db); $formother = new FormOther($db); diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 2cc79be297d..0cd9dd52648 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -132,7 +132,7 @@ $param .= '&search_event='.urlencode($search_event); $head = agenda_prepare_head(); -dol_fiche_head($head, 'autoactions', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'autoactions', $langs->trans("Agenda"), -1, 'action'); print ''.$langs->trans("AgendaAutoActionDesc")." ".$langs->trans("OnlyActiveElementsAreShown", 'modules.php').'
'; print "
\n"; @@ -197,7 +197,7 @@ if (!empty($triggers)) print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 605f3c76519..0c46e84dff6 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -74,11 +74,11 @@ print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); $head = agenda_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Agenda"), -1, 'action'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index e7e5edefaab..c743ed06e55 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -136,7 +136,7 @@ print ''; $head = agenda_prepare_head(); -dol_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action'); print ''.$langs->trans("AgendaExtSitesDesc")."
\n"; print "
\n"; @@ -224,7 +224,7 @@ while ($i <= $MAXAGENDA) print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 48368af45f2..a31c4ed1dbe 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -175,7 +175,7 @@ print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); $head = agenda_prepare_head(); -dol_fiche_head($head, 'other', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'other', $langs->trans("Agenda"), -1, 'action'); /* @@ -376,7 +376,7 @@ print ''."\n"; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index e4b3c59781c..51a9d4f327b 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -166,7 +166,7 @@ print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup'); $head = agenda_prepare_head(); -dol_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'reminders', $langs->trans("Agenda"), -1, 'action'); print '
'; print ''; @@ -229,7 +229,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2) print ''; -dol_fiche_end(); +print dol_get_fiche_end(); //print '
'; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 5b747260a05..fd80a545aa5 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -80,7 +80,7 @@ print ''; $head = agenda_prepare_head(); -dol_fiche_head($head, 'xcal', $langs->trans("Agenda"), -1, 'action'); +print dol_get_fiche_head($head, 'xcal', $langs->trans("Agenda"), -1, 'action'); print ''.$langs->trans("AgendaSetupOtherDesc")."
\n"; print "
\n"; @@ -135,7 +135,7 @@ print ""; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print "trans("Save")."\">"; diff --git a/htdocs/admin/bank.php b/htdocs/admin/bank.php index 772ef604ab5..c8157a40d81 100644 --- a/htdocs/admin/bank.php +++ b/htdocs/admin/bank.php @@ -215,7 +215,7 @@ print ''; print ''; $head = bank_admin_prepare_head(null); -dol_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); +print dol_get_fiche_head($head, 'general', $langs->trans("BankSetupModule"), -1, 'account'); //Show bank account order print load_fiche_titre($langs->trans("BankOrderShow"), '', ''); @@ -495,7 +495,7 @@ if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) { print "\n"; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/bank_extrafields.php b/htdocs/admin/bank_extrafields.php index 312da228f50..7ad9e1d0f23 100644 --- a/htdocs/admin/bank_extrafields.php +++ b/htdocs/admin/bank_extrafields.php @@ -71,11 +71,11 @@ print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup $head = bank_admin_prepare_head(null); -dol_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"), -1, 'account'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("BankSetupModule"), -1, 'account'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 3f331286aa2..db3bc348716 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -181,7 +181,7 @@ print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); $head = bomAdminPrepareHead(); -dol_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom'); +print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom'); /* * BOMs Numbering model diff --git a/htdocs/admin/bom_extrafields.php b/htdocs/admin/bom_extrafields.php index 7ec50d9d7db..8ae26587ebd 100644 --- a/htdocs/admin/bom_extrafields.php +++ b/htdocs/admin/bom_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup'); $head = bomAdminPrepareHead(); -dol_fiche_head($head, 'bom_extrafields', $langs->trans("ExtraFields"), -1, 'account'); +print dol_get_fiche_head($head, 'bom_extrafields', $langs->trans("ExtraFields"), -1, 'account'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 6de752518c0..4fee30d274e 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -99,7 +99,7 @@ $linkback = 'trans("BankSetupModule"), -1, 'account'); +print dol_get_fiche_head($head, 'checkreceipts', $langs->trans("BankSetupModule"), -1, 'account'); /* * Numbering module @@ -266,7 +266,7 @@ print "
"; print ''."\n"; -dol_fiche_end(); +print dol_get_fiche_end(); print ''; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index b920d9e6f9e..594052500ca 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -246,7 +246,7 @@ print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); $head = order_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); +print dol_get_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); /* * Orders Numbering model diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index e1ec33c02d4..98a98a7ec2c 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -79,11 +79,11 @@ print "
\n"; $head = reception_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'sending'); +print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'sending'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index a099547fbc0..2705ede5540 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -88,9 +88,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_del_const($db, "MAIN_INFO_SOCIETE_STATE", $conf->entity); } - $db->begin(); + $db->begin(); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -141,8 +141,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) // Create thumbs of logo (Note that PDF use original file and not thumbs) if ($isimage > 0) { - // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + // Create thumbs + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get... // Create small thumb, Used on logon for example $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); @@ -269,8 +269,8 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') // Regenerate thumb $reg = array(); - // Create thumbs - //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... + // Create thumbs + //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retrieve value with get... // Create small thumb. Used on logon for example $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small', $quality); @@ -373,7 +373,7 @@ print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); -dol_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); +print dol_get_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company'); print ''.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."
\n"; print "
\n"; @@ -777,8 +777,8 @@ if ($mysoc->useLocalTax(2)) $tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."\n" : ""); if (!isOnlyOneLocalTax(2)) { - print '
: '; - $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + print '
: '; + $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); } print '
: '; print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 3f1eb8d9651..0eadfa2c629 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -67,12 +67,12 @@ if ($action == 'disable_sending') if ($action == 'activate_delivery') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); + dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity); header("Location: confexped.php"); exit; } @@ -92,7 +92,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'general', $langs->trans("Sendings"), -1, 'shipment'); // Miscellaneous parameters @@ -121,7 +121,7 @@ else print ""; print ''; -// Bon de livraison activation/desactivation +// Delivery note activate/deactivate Bon de livraison activation/desactivation print ''; print ''; print $langs->trans("DeliveriesOrderAbility"); @@ -131,7 +131,7 @@ print ''; print ''; print ''; -if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) +if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { print '
'.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index e8440963f9f..b7065a230bd 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -178,7 +178,7 @@ print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup' $head = contract_admin_prepare_head(); -dol_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract'); +print dol_get_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract'); /* * Contracts Numbering model @@ -488,7 +488,7 @@ print '
'; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 0438d5759ad..2e8d29500ed 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -69,7 +69,7 @@ print ''; $head = dav_admin_prepare_head(); -dol_fiche_head($head, 'webdav', '', -1, 'action'); +print dol_get_fiche_head($head, 'webdav', '', -1, 'action'); if ($action == 'edit') { @@ -148,7 +148,7 @@ if ($action == 'edit') } -dol_fiche_end(); +print dol_get_fiche_end(); /*print '
'; print "trans("Save")."\">"; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 6e172656930..e3006635b39 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -224,7 +224,7 @@ print ''; $head = defaultvalues_prepare_head(); -dol_fiche_head($head, $mode, '', -1, ''); +print dol_get_fiche_head($head, $mode, '', -1, ''); if ($mode == 'sortorder') { @@ -401,7 +401,7 @@ if ($result) print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print "\n"; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/delivery.php similarity index 91% rename from htdocs/admin/livraison.php rename to htdocs/admin/delivery.php index f3477e151a2..c05bd985705 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/delivery.php @@ -24,15 +24,15 @@ */ /** - * \file htdocs/admin/livraison.php - * \ingroup livraison - * \brief Page d'administration/configuration du module Livraison + * \file htdocs/admin/delivery.php + * \ingroup delivery + * \brief age to setup extra fields of delivery */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; +require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); @@ -87,7 +87,7 @@ if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); - $sending = new Livraison($db); + $sending = new Delivery($db); $sending->initAsSpecimen(); // Search template files @@ -95,7 +95,7 @@ if ($action == 'specimen') $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0); + $file = dol_buildpath($reldir."core/modules/delivery/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound = 1; @@ -112,7 +112,7 @@ if ($action == 'specimen') if ($module->write_file($sending, $langs) > 0) { - header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=delivery&file=SPECIMEN.pdf"); return; } else { setEventMessages($module->error, $module->errors, 'errors'); @@ -134,17 +134,17 @@ if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); + if ($conf->global->DELIVERY_ADDON_PDF == "$value") dolibarr_del_const($db, 'DELIVERY_ADDON_PDF', $conf->entity); } } if ($action == 'setdoc') { - if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + if (dolibarr_set_const($db, "DELIVERY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent - $conf->global->LIVRAISON_ADDON_PDF = $value; + $conf->global->DELIVERY_ADDON_PDF = $value; } // On active le modele @@ -160,7 +160,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "DELIVERY_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -179,7 +179,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'shipment'); // Delivery numbering model @@ -199,7 +199,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/"); + $dir = dol_buildpath($reldir."core/modules/delivery/"); if (is_dir($dir)) { @@ -208,8 +208,7 @@ foreach ($dirmodels as $reldir) { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file) - 3, 3) == 'php') - { + if (preg_match('/^mod_delivery_([a-z0-9_]*)\.php$/', $file)) { $file = substr($file, 0, dol_strlen($file) - 4); require_once $dir.$file.'.php'; @@ -222,8 +221,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - - print ''.$module->nom."\n"; + print ''.$module->name."\n"; print $module->info(); print ''; @@ -237,7 +235,7 @@ foreach ($dirmodels as $reldir) print ''."\n"; print ''; - if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") + if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -245,13 +243,13 @@ foreach ($dirmodels as $reldir) } print ''; - $livraison = new Livraison($db); - $livraison->initAsSpecimen(); + $delivery = new Delivery($db); + $delivery->initAsSpecimen(); // Info $htmltooltip = ''; $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval = $module->getNextValue($mysoc, $livraison); + $nextval = $module->getNextValue($mysoc, $delivery); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip .= ''.$langs->trans("NextValue").': '; if ($nextval) { @@ -323,7 +321,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/doc/"); + $dir = dol_buildpath($reldir."core/modules/delivery/doc/"); if (is_dir($dir)) { @@ -378,7 +376,7 @@ foreach ($dirmodels as $reldir) // Default print ""; - if ($conf->global->LIVRAISON_ADDON_PDF == "$name") + if ($conf->global->DELIVERY_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/delivery_extrafields.php similarity index 91% rename from htdocs/admin/livraison_extrafields.php rename to htdocs/admin/delivery_extrafields.php index d30635333be..c0ed636abac 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/admin/livraison_extrafields.php - * \ingroup livraison - * \brief Page to setup extra fields of livraison + * \file htdocs/admin/delivery_extrafields.php + * \ingroup delivery + * \brief Page to setup extra fields of delivery */ require '../main.inc.php'; @@ -49,7 +49,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'livraison'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'delivery'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); @@ -76,11 +76,11 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'attributes_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php similarity index 91% rename from htdocs/admin/livraisondet_extrafields.php rename to htdocs/admin/deliverydet_extrafields.php index cc9dfa1c49f..50032e8f793 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -24,9 +24,9 @@ */ /** - * \file htdocs/admin/livraisondet_extrafields.php - * \ingroup livraison - * \brief Page to setup extra fields of livraison + * \file htdocs/admin/deliverydet_extrafields.php + * \ingroup delivery + * \brief Page to setup extra fields of delivery */ require '../main.inc.php'; @@ -50,7 +50,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'livraisondet'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'deliverydet'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); @@ -77,11 +77,11 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'attributeslines_receivings', $langs->trans("Receivings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 0ee07aad230..43ce69f6e02 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -11,7 +11,7 @@ * Copyright (C) 2011-2019 Alexandre Spangaro * Copyright (C) 2015 Ferran Marcet * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2020 Frédéric France * Copyright (C) 2020 Open-Dsi * * This program is free software; you can redistribute it and/or modify @@ -746,8 +746,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } } - if ($id == 3 && !is_numeric($_POST["code"])) - { + if (($id == 3 || $id == 42) && !is_numeric($_POST["code"])) { $ok = 0; setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric", $langs->transnoentities("Code")), null, 'errors'); } @@ -879,7 +878,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i++; } - $sql .= " WHERE ".$rowidcol." = ".(int) $db->escape($rowid); + if (in_array($rowidcol, array('code', 'code_iso'))) { + $sql .= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'"; + } else { + $sql .= " WHERE ".$rowidcol." = ".((int) $rowid); + } if (in_array('entity', $listfieldmodify)) $sql .= " AND entity = '".getEntity($tabname[$id])."'"; dol_syslog("actionmodify", LOG_DEBUG); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index e11434c45d6..33df8a4b6e3 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -73,7 +73,7 @@ print '
'; $head = ecm_admin_prepare_head(); -dol_fiche_head($head, 'ecm', $langs->trans("ECM"), -1, 'ecm'); +print dol_get_fiche_head($head, 'ecm', $langs->trans("ECM"), -1, 'ecm'); print ''; print ''; diff --git a/htdocs/admin/ecm_directories_extrafields.php b/htdocs/admin/ecm_directories_extrafields.php index 77e21963e4c..3179c01960c 100644 --- a/htdocs/admin/ecm_directories_extrafields.php +++ b/htdocs/admin/ecm_directories_extrafields.php @@ -80,11 +80,11 @@ print "
\n"; $head = ecm_admin_prepare_head(); -dol_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM"), -1, 'ecm'); +print dol_get_fiche_head($head, 'attributes_ecm_directories', $langs->trans("ECM"), -1, 'ecm'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/ecm_files_extrafields.php b/htdocs/admin/ecm_files_extrafields.php index aaa507ca7c4..9fc297fd37a 100644 --- a/htdocs/admin/ecm_files_extrafields.php +++ b/htdocs/admin/ecm_files_extrafields.php @@ -80,11 +80,11 @@ print "
\n"; $head = ecm_admin_prepare_head(); -dol_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1, 'ecm'); +print dol_get_fiche_head($head, 'attributes_ecm_files', $langs->trans("ECM"), -1, 'ecm'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index eb9ffb52831..7a48883fd55 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -247,7 +247,7 @@ if ($action == 'create') { print ''; print ''; - dol_fiche_head(array(), ''); + print dol_get_fiche_head(array(), ''); print '
'."\n"; @@ -261,7 +261,7 @@ if ($action == 'create') { print '
'."\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -283,7 +283,7 @@ if (($id || $ref) && $action == 'edit') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''."\n"; @@ -295,7 +295,7 @@ if (($id || $ref) && $action == 'edit') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print '   '; @@ -313,7 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fetchActions(); $head = emailcollectorPrepareHead($object); - dol_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'email'); + print dol_get_fiche_head($head, 'card', $langs->trans("EmailCollector"), -1, 'email'); $formconfirm = ''; @@ -655,7 +655,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '

'; - dol_fiche_end(); + print dol_get_fiche_end(); // Buttons for actions if ($action != 'presend' && $action != 'editline') { diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 37d1a795428..b75606f739c 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -102,7 +102,7 @@ print ''; $head = security_prepare_head(); -dol_fiche_head($head, 'audit', '', -1); +print dol_get_fiche_head($head, 'audit', '', -1); print ''; print ""; @@ -125,7 +125,7 @@ foreach ($eventstolog as $key => $arr) } print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print "trans("Save")."\">"; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 56f4f5a9be2..b446851b539 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -184,7 +184,7 @@ print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup') print '
'; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'shipment', $langs->trans("Sendings"), -1, 'shipment'); // Shipment numbering model @@ -212,8 +212,7 @@ foreach ($dirmodels as $reldir) { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 15) == 'mod_expedition_' && substr($file, dol_strlen($file) - 3, 3) == 'php') - { + if (preg_match('/^mod_expedition_([a-z0-9_]*)\.php$/', $file)) { $file = substr($file, 0, dol_strlen($file) - 4); require_once $dir.$file.'.php'; @@ -226,7 +225,7 @@ foreach ($dirmodels as $reldir) if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; - print ''.$module->nom."\n"; + print ''.$module->name."\n"; print ''; print $module->info(); print ''; diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index d9bf58027f8..901caf58c00 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -76,11 +76,11 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'attributes_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index a00816d9d75..a61581ce18a 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -77,11 +77,11 @@ print "
\n"; $head = expedition_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment'); +print dol_get_fiche_head($head, 'attributeslines_shipment', $langs->trans("Sendings"), -1, 'shipment'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 3ac71cfa6b0..fb2782d3aa7 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -187,7 +187,7 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_s $head = expensereport_admin_prepare_head(); -dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip'); +print dol_get_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip'); /* * Expense report numbering model @@ -480,7 +480,7 @@ print '
'; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index ba29df4b766..ac88ec78912 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_s $head = expensereport_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), -1, 'trip'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("ExpenseReports"), -1, 'trip'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index f55e78d4105..2e00d0d8ff9 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -95,7 +95,7 @@ $linkback = 'trans("ExpenseReportsIk"), -1, 'trip'); +print dol_get_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip'); echo ''.$langs->trans('ExpenseReportIkDesc').''; print '

'; @@ -180,7 +180,7 @@ foreach ($rangesbycateg as $fk_c_exp_tax_cat => $Tab) echo ''; echo ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index e0012139154..9a4bf2804b2 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -151,7 +151,7 @@ $linkback = '
trans("ExpenseReportsRules"), -1, 'trip'); +print dol_get_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip'); echo ''.$langs->trans('ExpenseReportRulesDesc').''; print '

'; @@ -338,7 +338,7 @@ echo ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index ae7faafa937..5dd541b34b5 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -71,7 +71,7 @@ $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; -dol_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic"); +print dol_get_fiche_head($head, 'setup', $langs->trans("ExportsArea"), -1, "technic"); print '
'; print ''; @@ -103,7 +103,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 0c12f11b4a3..35dd1002b12 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -245,7 +245,7 @@ $linkback = '
trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); /* * Numbering module @@ -802,7 +802,7 @@ print ''; print "
\n"; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 61969651634..7ef9e216ad9 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -71,7 +71,7 @@ $linkback = 'trans("InvoiceSituation"), -1, 'invoice'); +print dol_get_fiche_head($head, 'situation', $langs->trans("InvoiceSituation"), -1, 'invoice'); print ''.$langs->trans("InvoiceFirstSituationDesc").'

'; @@ -104,12 +104,7 @@ $arrayAvailableType = array( Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation"), Facture::TYPE_STANDARD.'+'.Facture::TYPE_SITUATION => $langs->trans("InvoiceSituation").' + '.$langs->trans("InvoiceStandard"), ); -$selected = array(); -$implodeglue = '+'; -if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) { - $selected = explode('+', $conf->global->{$confkey}); -} - +$selected = $conf->global->$confkey; $curentInput = (empty($inputCount) ? 1 : ($inputCount + 1)); $formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1); _printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType); @@ -145,7 +140,7 @@ _updateBtn(); print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 5199165d4f4..faeaf84cb70 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -240,7 +240,7 @@ print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_se $head = fichinter_admin_prepare_head(); -dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention'); +print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention'); // Interventions numbering model diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 23a0cec8130..44b7034064b 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -177,7 +177,7 @@ print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); $head = holiday_admin_prepare_head(); -dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday'); +print dol_get_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday'); /* * Holiday Numbering model @@ -282,7 +282,7 @@ print '
'; if ($conf->global->MAIN_FEATURES_LEVEL < 2) { - dol_fiche_end(); + print dol_get_fiche_end(); // End of page llxFooter(); $db->close(); @@ -501,7 +501,7 @@ print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/holiday_extrafields.php b/htdocs/admin/holiday_extrafields.php index 30eb707782b..1205b592e5f 100644 --- a/htdocs/admin/holiday_extrafields.php +++ b/htdocs/admin/holiday_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); $head = holiday_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Holidays"), -1, 'holiday'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Holidays"), -1, 'holiday'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php index d36ffd5265f..e70d8eadbba 100644 --- a/htdocs/admin/import.php +++ b/htdocs/admin/import.php @@ -70,7 +70,7 @@ $head[$h][1] = $langs->trans("Setup"); $head[$h][2] = 'setup'; $h++; -dol_fiche_head($head, 'setup', $langs->trans("ImportArea"), -1, "technic"); +print dol_get_fiche_head($head, 'setup', $langs->trans("ImportArea"), -1, "technic"); print '
'; print ''; @@ -93,7 +93,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 951b93f908c..b8c207644c6 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -108,7 +108,7 @@ $form = new Form($db); print '
'; print ''; -dol_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1); print ''; @@ -251,7 +251,7 @@ print ''; print '
'.$langs->trans('Password').' (ex: secret)
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 54de74c6371..b29fa00e49e 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -105,7 +105,7 @@ if (!function_exists("ldap_connect")) setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -dol_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescContact").'
'; @@ -246,7 +246,7 @@ print ''; print info_admin($langs->trans("LDAPDescValues")); -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 4e0c430fb90..9de9c195f8f 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -95,7 +95,7 @@ if (!function_exists("ldap_connect")) setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -dol_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescGroups").'
'; @@ -180,7 +180,7 @@ print ''; print info_admin($langs->trans("LDAPDescValues")); -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 0cd09d27f7e..214a4f2cb9b 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -125,7 +125,7 @@ if (!function_exists("ldap_connect")) print ''; print ''; -dol_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescMembers").'
'; @@ -366,7 +366,7 @@ print ''; print info_admin($langs->trans("LDAPDescValues")); -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 371437e1640..489e6047f9b 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -93,7 +93,7 @@ if (!function_exists("ldap_connect")) setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors'); } -dol_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescMembersTypes").'
'; @@ -162,7 +162,7 @@ print ''; print info_admin($langs->trans("LDAPDescValues")); -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index d5778fbfb1c..efb34cca413 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -121,7 +121,7 @@ print ''; print ''; -dol_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1); +print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1); print $langs->trans("LDAPDescUsers").'
'; print '
'; @@ -336,7 +336,7 @@ print ''; print info_admin($langs->trans("LDAPDescValues")); -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index db29deef9d7..82e28f3cf73 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -125,7 +125,7 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY if (!empty($aCurrencies) && count($aCurrencies) > 1) { $head = multicurrencyLimitPrepareHead($aCurrencies); - dol_fiche_head($head, $currencycode, '', -1, "multicurrency"); + print dol_get_fiche_head($head, $currencycode, '', -1, "multicurrency"); } } @@ -201,7 +201,7 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY { if (!empty($aCurrencies) && count($aCurrencies) > 1) { - dol_fiche_end(); + print dol_get_fiche_end(); } } diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index d9d3ae8142d..58e904f02ce 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -153,7 +153,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) print ''; print ''; - dol_fiche_head($head, 'mailman', $langs->trans("Setup"), -1, 'user'); + print dol_get_fiche_head($head, 'mailman', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link = '
'; @@ -198,13 +198,13 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; } else { - dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + print dol_get_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); $link = '
'; //$link.=img_$langs->trans("Activate") @@ -212,7 +212,7 @@ if (!empty($conf->global->ADHERENT_USE_MAILMAN)) $link .= ''; print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 55316e47332..cc81c78255d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -273,7 +273,7 @@ if ($action == 'edit') print ''; print ''; - dol_fiche_head($head, 'common', '', -1); + print dol_get_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -506,7 +506,7 @@ if ($action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -516,7 +516,7 @@ if ($action == 'edit') print ''; } else { - dol_fiche_head($head, 'common', '', -1); + print dol_get_fiche_head($head, 'common', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -529,211 +529,215 @@ if ($action == 'edit') if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) print img_warning($langs->trans("Disabled")); print ''; - // Force e-mail recipient - print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; - if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) - { - if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail")); - else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); + if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { + // Force e-mail recipient + print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; + if (!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) + { + if (!isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail")); + else print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); + } + print ''; } - print ''; print ''; - print '
'; + if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { + print '
'; - print ''; - print ''; + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").'
'; + print ''; - // Method - print ''; + print ''; - // Host server - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) - { - print ''; - } else { - print ''; - } - - // Port - if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) - { - print ''; - } else { - print ''; - } - - // SMTPS ID - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) - { - print ''; - } - - // SMTPS PW - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) - { - print ''; - } - - // TLS - print ''; + print ''; + } else { + print ''; + } - // STARTTLS - print ''; + print ''; + } else { + print ''; + } - // SMTP_ALLOW_SELF_SIGNED - print ''; + print ''; + } + // SMTPS PW + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) + { + print ''; + } - if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') - { - // DKIM - print ''; - // Domain - print ''; - print ''; - - // Selector - print ''; - print ''; - - // PRIVATE KEY - print ''; - print ''; - } - - print '
'.$langs->trans("MAIN_MAIL_SENDMODE").'
'.$langs->trans("MAIN_MAIL_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; - if (empty($text)) $text = $langs->trans("Undefined").img_warning(); - print $text; + // Method + print '
'.$langs->trans("MAIN_MAIL_SENDMODE").''; + $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; + if (empty($text)) $text = $langs->trans("Undefined").img_warning(); + print $text; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print $form->textwithpicto('', $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 1, 'warning'); - } + if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + print $form->textwithpicto('', $langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 1, 'warning'); + } - print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) - { - if (function_exists('openssl_open')) + // Host server + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print yn($conf->global->MAIN_MAIL_EMAIL_TLS); - } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; - print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '').'
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) - { - if (function_exists('openssl_open')) + // Port + if ($linuxlike && (isset($conf->global->MAIN_MAIL_SENDMODE) && $conf->global->MAIN_MAIL_SENDMODE == 'mail')) { - print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); - } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; - print '
'.$langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike").''.$langs->trans("SeeLocalSendMailSetup").'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined")).''.(!empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : '').'
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) - { - if (function_exists('openssl_open')) + // SMTPS ID + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED); - } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; - print '
'.$langs->trans("MAIN_MAIL_SMTPS_ID").''.$conf->global->MAIN_MAIL_SMTPS_ID.'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; - if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) + // TLS + print '
'.$langs->trans("MAIN_MAIL_EMAIL_TLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { if (function_exists('openssl_open')) { - print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED); + print yn($conf->global->MAIN_MAIL_EMAIL_TLS); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; - } else print yn(0).' ('.$langs->trans("NotSupported").')'; + } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; - print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR; - print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY; - print '
'; - - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { - print info_admin($langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); - } - - print '
'; - - print ''; - print ''; - - // From - print ''; - print ''; - - // Default from type - $liste = array(); - $liste['user'] = $langs->trans('UserEmail'); - $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')'; - $sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile'; - $sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')'; - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - while ($i < $num) + // STARTTLS + print ''; - print ''; - print ''; + + + if ($conf->global->MAIN_MAIL_SENDMODE == 'swiftmailer') + { + // DKIM + print ''; + + // Domain + print ''; + print ''; + + // Selector + print ''; + print ''; + + // PRIVATE KEY + print ''; + print ''; } + + print '
'.$langs->trans("OtherOptions").'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; - if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); - print '
'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - $obj = $db->fetch_object($resql); - if ($obj) + if (function_exists('openssl_open')) { - $liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; - } - $i++; - } - } else dol_print_error($db); + print yn($conf->global->MAIN_MAIL_EMAIL_STARTTLS); + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; - if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') - { - print $langs->trans('RobotEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') - { - print $langs->trans('UserEmail'); - } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') - { - print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); - } else { - $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); - if ($id > 0) + // SMTP_ALLOW_SELF_SIGNED + print '
'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; - $emailsenderprofile = new EmailSenderProfile($db); - $emailsenderprofile->fetch($id); - print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED); + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print ''.yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").''; + if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) + { + if (function_exists('openssl_open')) + { + print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED); + } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; + } else print yn(0).' ('.$langs->trans("NotSupported").')'; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_DOMAIN").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_DOMAIN; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_SELECTOR").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_SELECTOR; + print '
'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").''.$conf->global->MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY; + print '
'; + + if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && empty($conf->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) { + print info_admin($langs->trans("WarningPHPMail").'
'.$langs->trans("WarningPHPMailA").'
'.$langs->trans("WarningPHPMailB").'
'.$langs->trans("WarningPHPMailC").'

'.$langs->trans("WarningPHPMailD"), 0, 0, 'warning'); + } + + print '
'; + + print ''; + print ''; + + // From + print ''; + print ''; + + // Default from type + $liste = array(); + $liste['user'] = $langs->trans('UserEmail'); + $liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $langs->trans("NotDefined") : $conf->global->MAIN_INFO_SOCIETE_MAIL).')'; + $sql = 'SELECT rowid, label, email FROM '.MAIN_DB_PREFIX.'c_email_senderprofile'; + $sql .= ' WHERE active = 1 AND (private = 0 OR private = '.$user->id.')'; + $resql = $db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + if ($obj) + { + $liste['senderprofile_'.$obj->rowid] = $obj->label.' <'.$obj->email.'>'; + } + $i++; + } + } else dol_print_error($db); + + print ''; + print ''; + + // Errors To + print ''; + print ''; + + // Autocopy to + print ''; + print ''; + + //Add user to select destinaries list + print ''; + + print '
'.$langs->trans("OtherOptions").'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ?ini_get('sendmail_from') : $langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; + if (!empty($conf->global->MAIN_MAIL_EMAIL_FROM) && !isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); + print '
'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').''; + if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') + { + print $langs->trans('RobotEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') + { + print $langs->trans('UserEmail'); + } elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') + { + print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>'); + } else { + $id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE); + if ($id > 0) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; + $emailsenderprofile = new EmailSenderProfile($db); + $emailsenderprofile->fetch($id); + print $emailsenderprofile->label.' '.dol_escape_htmltag('<'.$emailsenderprofile->email.'>'); + } + } + print '
'.$langs->trans("MAIN_MAIL_ERRORS_TO").''.$conf->global->MAIN_MAIL_ERRORS_TO; + if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); + print '
'.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; + if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) + { + print $conf->global->MAIN_MAIL_AUTOCOPY_TO; + if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); + } else { + print ' '; + } + print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'
'; } - print ''; - // Errors To - print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; - print ''.$conf->global->MAIN_MAIL_ERRORS_TO; - if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) print img_warning($langs->trans("ErrorBadEMail")); - print ''; - - // Autocopy to - print ''.$langs->trans("MAIN_MAIL_AUTOCOPY_TO").''; - print ''; - if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) - { - print $conf->global->MAIN_MAIL_AUTOCOPY_TO; - if (!isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail")); - } else { - print ' '; - } - print ''; - - //Add user to select destinaries list - print ''.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).''; - - print ''; - - dol_fiche_end(); + print dol_get_fiche_end(); // Actions button @@ -741,21 +745,23 @@ if ($action == 'edit') print ''.$langs->trans("Modify").''; - if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) - { - if (function_exists('fsockopen') && $port && $server) + if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { + if ($conf->global->MAIN_MAIL_SENDMODE != 'mail' || !$linuxlike) { - print ''.$langs->trans("DoTestServerAvailability").''; + if (function_exists('fsockopen') && $port && $server) + { + print ''.$langs->trans("DoTestServerAvailability").''; + } + } else { + print ''.$langs->trans("DoTestServerAvailability").''; } - } else { - print ''.$langs->trans("DoTestServerAvailability").''; - } - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; - if (!empty($conf->fckeditor->enabled)) - { - print ''.$langs->trans("DoTestSendHTML").''; + if (!empty($conf->fckeditor->enabled)) + { + print ''.$langs->trans("DoTestSendHTML").''; + } } print '
'; @@ -843,7 +849,7 @@ if ($action == 'edit') print '
'; print load_fiche_titre($action == 'testhtml' ? $langs->trans("DoTestSendHTML") : $langs->trans("DoTestSend")); - dol_fiche_head(''); + print dol_get_fiche_head(''); // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -886,7 +892,7 @@ if ($action == 'edit') print $formmail->get_form('addfile', 'removefile'); - dol_fiche_end(); + print dol_get_fiche_end(); // References print ''.$langs->trans("EMailsWillHaveMessageID").': '; diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index b97437216d6..a464c0fca8e 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -226,7 +226,7 @@ if ($action == 'edit') print ''; print ''; - dol_fiche_head($head, 'common_emailing', '', -1); + print dol_get_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -384,7 +384,7 @@ if ($action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -394,7 +394,7 @@ if ($action == 'edit') print ''; } else { - dol_fiche_head($head, 'common_emailing', '', -1); + print dol_get_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -475,7 +475,7 @@ if ($action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) @@ -559,7 +559,7 @@ if ($action == 'edit') print '
'; print load_fiche_titre($action == 'testhtml' ? $langs->trans("DoTestSendHTML") : $langs->trans("DoTestSend")); - dol_fiche_head(''); + print dol_get_fiche_head(''); // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -599,7 +599,7 @@ if ($action == 'edit') print $formmail->get_form('addfile', 'removefile'); - dol_fiche_end(); + print dol_get_fiche_end(); } } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index b9299a5c58b..4556ec80bff 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -205,7 +205,7 @@ print load_fiche_titre($title, $linkback, $titlepicto); $head = email_admin_prepare_head(); -dol_fiche_head($head, 'senderprofiles', '', -1); +print dol_get_fiche_head($head, 'senderprofiles', '', -1); print ''.$langs->trans("EMailsSenderProfileDesc")."
\n"; print "
\n"; @@ -645,7 +645,7 @@ if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $n print $formfile->showdocuments('massfilesarea_emailsenderprofile', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index b9281765771..8cbd9675160 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -67,7 +67,6 @@ $actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); $listoffset = GETPOST('listoffset', 'alpha'); $listlimit = GETPOST('listlimit', 'alpha') > 0 ?GETPOST('listlimit', 'alpha') : 1000; -$active = 1; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); @@ -274,9 +273,15 @@ if (empty($reshook)) if ($i) $sql .= ", "; if (GETPOST($keycode) == '' && $keycode != 'langcode') $sql .= "null"; // langcode must be '' if not defined so the unique key that include lang will work elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work - elseif ($keycode == 'content') { + elseif ($keycode == 'fk_user') { + if (! $user->admin) { // A non admin user can only edit its own template + $sql .= " ".((int) $user->id); + } else { + $sql .= " ".((int) GETPOST($keycode, 'fk_user')); + } + } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'position'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; @@ -327,9 +332,15 @@ if (empty($reshook)) if (GETPOST($keycode) == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && !GETPOST($keycode))) $sql .= "null"; // langcode,... must be '' if not defined so the unique key that include lang will work elseif (GETPOST($keycode) == '0' && $keycode == 'langcode') $sql .= "''"; // langcode must be '' if not defined so the unique key that include lang will work - elseif ($keycode == 'content') { + elseif ($keycode == 'fk_user') { + if (! $user->admin) { // A non admin user can only edit its own template + $sql .= " ".((int) $user->id); + } else { + $sql .= " ".((int) GETPOST($keycode, 'fk_user')); + } + } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; - } elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) { + } elseif (in_array($keycode, array('joinfile', 'private', 'position'))) { $sql .= (int) GETPOST($keycode, 'int'); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'"; @@ -339,6 +350,9 @@ if (empty($reshook)) } $sql .= " WHERE ".$rowidcol." = ".((int) $rowid); + if (! $user->admin) { // A non admin user can only edit its own template + $sql .= " AND fk_user = ".$user->id; + } //print $sql;exit; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; @@ -357,7 +371,9 @@ if (empty($reshook)) $rowidcol = "rowid"; $sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."=".((int) $rowid); - + if (! $user->admin) { // A non admin user can only edit its own template + $sql .= " AND fk_user = ".$user->id; + } dol_syslog("delete", LOG_DEBUG); $result = $db->query($sql); if (!$result) @@ -420,7 +436,7 @@ print load_fiche_titre($title, $linkback, $titlepicto); $head = email_admin_prepare_head(); -dol_fiche_head($head, 'templates', '', -1); +print dol_get_fiche_head($head, 'templates', '', -1); // Confirmation de la suppression de la ligne if ($action == 'delete') @@ -937,7 +953,7 @@ print '
'; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 39e159535ba..e0a42ee3a2d 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -215,7 +215,7 @@ if ($action == 'edit') print ''; print ''; - dol_fiche_head($head, 'common_ticket', '', -1); + print dol_get_fiche_head($head, 'common_ticket', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -361,7 +361,7 @@ if ($action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -371,7 +371,7 @@ if ($action == 'edit') print ''; } else { - dol_fiche_head($head, 'common_ticket', '', -1); + print dol_get_fiche_head($head, 'common_ticket', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; print "
\n"; @@ -441,7 +441,7 @@ if ($action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); if ($conf->global->MAIN_MAIL_SENDMODE_TICKET == 'mail' && empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) @@ -525,7 +525,7 @@ if ($action == 'edit') print '
'; print load_fiche_titre($action == 'testhtml' ? $langs->trans("DoTestSendHTML") : $langs->trans("DoTestSend")); - dol_fiche_head(''); + print dol_get_fiche_head(''); // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -565,7 +565,7 @@ if ($action == 'edit') print $formmail->get_form('addfile', 'removefile'); - dol_fiche_end(); + print dol_get_fiche_end(); } } diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index ff15bbdcd40..9bdc497c776 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -151,7 +151,7 @@ print '
'; print ''; print ''; -dol_fiche_head($head, 'handler', '', -1); +print dol_get_fiche_head($head, 'handler', '', -1); print ''.$langs->trans("MenusDesc")."
\n"; print "
\n"; @@ -206,7 +206,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 31e0f896633..70d2f4bcda6 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -299,7 +299,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -398,7 +398,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -417,7 +417,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -507,7 +507,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); // Bouton print '
'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index f83507c37aa..f81a80794d3 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -229,7 +229,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'editor', '', -1); +print dol_get_fiche_head($head, 'editor', '', -1); print ''.$langs->trans("MenusEditorDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index cd8c7cccfa6..2450d572abd 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -75,7 +75,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'misc', '', -1); +print dol_get_fiche_head($head, 'misc', '', -1); // Other Options diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index c788eca01d3..9aec5ef0c29 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -265,7 +265,7 @@ $picto = 'object_'.$objMod->picto; print load_fiche_titre(($modulename ? $modulename : $moduledesc), $moreinfo, $picto, 0, '', 'titlemodulehelp'); print '
'; -dol_fiche_head($head, $mode, '', -1); +print dol_get_fiche_head($head, $mode, '', -1); if (!$modulename) { @@ -554,7 +554,7 @@ if ($mode == 'changelog') print $text; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8010acd8e84..e281cb21155 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -496,7 +496,7 @@ if ($mode == 'common' || $mode == 'commonkanban') $newmode = $mode; if ($newmode == 'common') $newmode = 'commonkanban'; - dol_fiche_head($head, $newmode, '', -1); + print dol_get_fiche_head($head, $newmode, '', -1); $moreforfilter = '
'; @@ -883,7 +883,7 @@ if ($mode == 'common' || $mode == 'commonkanban') } } - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; @@ -895,7 +895,7 @@ if ($mode == 'common' || $mode == 'commonkanban') if ($mode == 'marketplace') { - dol_fiche_head($head, $mode, '', -1); + print dol_get_fiche_head($head, $mode, '', -1); // Marketplace print '
'; @@ -916,7 +916,7 @@ if ($mode == 'marketplace') print "\n"; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; @@ -980,7 +980,7 @@ if ($mode == 'marketplace') if ($mode == 'deploy') { - dol_fiche_head($head, $mode, '', -1); + print dol_get_fiche_head($head, $mode, '', -1); $dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT); $allowonlineinstall = true; @@ -1136,12 +1136,12 @@ if ($mode == 'deploy') } } - dol_fiche_end(); + print dol_get_fiche_end(); } if ($mode == 'develop') { - dol_fiche_head($head, $mode, '', -1); + print dol_get_fiche_head($head, $mode, '', -1); // Marketplace print "\n"; @@ -1170,7 +1170,7 @@ if ($mode == 'develop') print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 863633176bd..837a77fe2a7 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -182,7 +182,7 @@ print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); $head = mrpAdminPrepareHead(); -dol_fiche_head($head, 'settings', $langs->trans("MOs"), -1, 'mrp'); +print dol_get_fiche_head($head, 'settings', $langs->trans("MOs"), -1, 'mrp'); /* * MOs Numbering model diff --git a/htdocs/admin/mrp_extrafields.php b/htdocs/admin/mrp_extrafields.php index b0bd0e522ab..e81c7f1cf75 100644 --- a/htdocs/admin/mrp_extrafields.php +++ b/htdocs/admin/mrp_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("MrpSetupPage"), $linkback, 'title_setup'); $head = mrpAdminPrepareHead(); -dol_fiche_head($head, 'mrp_extrafields', $langs->trans("ExtraFields"), -1, 'account'); +print dol_get_fiche_head($head, 'mrp_extrafields', $langs->trans("ExtraFields"), -1, 'account'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index a447551b04e..1973ec95909 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -176,7 +176,7 @@ print load_fiche_titre($langs->trans($page_name), $linkback); // Configuration header $head = multicurrencyAdminPrepareHead(); -dol_fiche_head($head, 'settings', $langs->trans("ModuleSetup"), -1, "multicurrency"); +print dol_get_fiche_head($head, 'settings', $langs->trans("ModuleSetup"), -1, "multicurrency"); print ''; diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index 8b0e9516abd..af352558a71 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -85,7 +85,7 @@ print ''; $head = oauthadmin_prepare_head(); -dol_fiche_head($head, 'services', '', -1, 'technic'); +print dol_get_fiche_head($head, 'services', '', -1, 'technic'); print ''.$langs->trans("ListOfSupportedOauthProviders").'

'; @@ -141,7 +141,7 @@ foreach ($list as $key) print '
'."\n"; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index 2c8f2070724..99510f4b7c8 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -123,7 +123,7 @@ print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup'); $head = oauthadmin_prepare_head(); -dol_fiche_head($head, 'tokengeneration', '', -1, 'technic'); +print dol_get_fiche_head($head, 'tokengeneration', '', -1, 'technic'); if (GETPOST('error')) { setEventMessages(GETPOST('error'), null, 'errors'); @@ -402,7 +402,7 @@ if ($mode == 'userconf' && $user->admin) print ''; } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/openinghours.php b/htdocs/admin/openinghours.php index d4886bb2a57..9d70fdedff7 100644 --- a/htdocs/admin/openinghours.php +++ b/htdocs/admin/openinghours.php @@ -75,7 +75,7 @@ print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); -dol_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company'); +print dol_get_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company'); print ''.$langs->trans("OpeningHoursDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php index 1b2bb0c0cd0..81d0312ab69 100644 --- a/htdocs/admin/order_extrafields.php +++ b/htdocs/admin/order_extrafields.php @@ -73,11 +73,11 @@ print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); $head = order_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Orders"), -1, 'order'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Orders"), -1, 'order'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php index 1f645241646..734d617f564 100644 --- a/htdocs/admin/orderdet_extrafields.php +++ b/htdocs/admin/orderdet_extrafields.php @@ -74,11 +74,11 @@ print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); $head = order_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("Orders"), -1, 'order'); +print dol_get_fiche_head($head, 'attributeslines', $langs->trans("Orders"), -1, 'order'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 92b5c9511d5..8edf851f49e 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -101,7 +101,7 @@ $linkback = 'trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'payment', $langs->trans("Invoices"), -1, 'invoice'); /* * Numbering module @@ -262,7 +262,7 @@ print "\n"; print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print '
'; diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 718e64e6446..6a419d39e53 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -361,7 +361,7 @@ foreach ($dirmodels as $reldir) */ -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index cd9d290b828..3677daa38a5 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -116,7 +116,7 @@ $db->commit(); $head = security_prepare_head(); -dol_fiche_head($head, 'default', '', -1); +print dol_get_fiche_head($head, 'default', '', -1); // Show warning about external users @@ -260,7 +260,7 @@ if ($result) print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 50d01924364..c16b5c30c47 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -368,7 +368,7 @@ foreach ($dirmodels as $reldir) */ -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 3b574956cd0..5123cec7f08 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -206,7 +206,7 @@ print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal'); +print dol_get_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal'); /* * Module numerotation diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 795cbec5ede..71bd50ef5ce 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -94,7 +94,7 @@ print ''; $head = security_prepare_head(); -dol_fiche_head($head, 'proxy', '', -1); +print dol_get_fiche_head($head, 'proxy', '', -1); if ($conf->use_javascript_ajax) @@ -197,7 +197,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 26bfd1ef1c8..3f66d04ca01 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -282,7 +282,7 @@ if ($mode == 'config' && $user->admin) { } - dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); + print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); print ''.$langs->trans("ReceiptPrinterDesc")."

\n"; @@ -354,7 +354,7 @@ if ($mode == 'config' && $user->admin) { print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print ''; @@ -387,7 +387,7 @@ if ($mode == 'config' && $user->admin) { // mode = template if ($mode == 'template' && $user->admin) { - dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); + print dol_get_fiche_head($head, $mode, $langs->trans("ModuleSetup"), -1, 'technic'); print '
'; print ''; @@ -460,7 +460,7 @@ if ($mode == 'template' && $user->admin) { } print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index d9babd5d95b..605b8cf465e 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -79,11 +79,11 @@ print "
\n"; $head = reception_admin_prepare_head(); -dol_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'sending'); +print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'sending'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index f84d9a3a7f9..6c5d9916225 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -189,7 +189,7 @@ print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup print '
'; $head = reception_admin_prepare_head(); -dol_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending'); +print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending'); // Reception numbering model diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index b57e41ddfd4..ecf72df9b37 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans('ResourceSetup'), $linkback, 'title_setup') $head = resource_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("ResourceSingular"), -1, 'action'); +print dol_get_fiche_head($head, 'general', $langs->trans("ResourceSingular"), -1, 'action'); print '
'; print ''; @@ -142,7 +142,7 @@ print '
'; //RESOURCE_HIDE_ADD_CONTACT_USER //RESOURCE_HIDE_ADD_CONTACT_THIPARTY -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/resource_extrafields.php b/htdocs/admin/resource_extrafields.php index 61b0bf900df..d7287b53019 100644 --- a/htdocs/admin/resource_extrafields.php +++ b/htdocs/admin/resource_extrafields.php @@ -73,11 +73,11 @@ print "
\n"; $head = resource_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("ResourceSingular"), -1, 'action'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("ResourceSingular"), -1, 'action'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index f25cdf25958..db91aae87a1 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -197,7 +197,7 @@ print "
\n"; $head = security_prepare_head(); -dol_fiche_head($head, 'passwords', '', -1); +print dol_get_fiche_head($head, 'passwords', '', -1); // Choix du gestionnaire du generateur de mot de passe diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index a2e97b45869..fc2c4e141d5 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -100,7 +100,7 @@ print ''; $head = security_prepare_head(); -dol_fiche_head($head, 'file', '', -1); +print dol_get_fiche_head($head, 'file', '', -1); // Upload options @@ -177,7 +177,7 @@ print ''; print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 4eb6af14843..2e4f1f05229 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -93,7 +93,7 @@ print ''; $head = security_prepare_head(); -dol_fiche_head($head, 'misc', '', -1); +print dol_get_fiche_head($head, 'misc', '', -1); // Other Options @@ -184,7 +184,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/socialnetworks.php b/htdocs/admin/socialnetworks.php index b848dccd998..faf8897126f 100644 --- a/htdocs/admin/socialnetworks.php +++ b/htdocs/admin/socialnetworks.php @@ -89,7 +89,7 @@ $h++; print '
'; -dol_fiche_head($head, 'setup', '', 0, 'user'); +print dol_get_fiche_head($head, 'setup', '', 0, 'user'); print '
'; @@ -108,7 +108,7 @@ foreach ($arrayofsocialnetworks as $snkey => $snlabel) { } -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index ca44caac258..fe98d4bfe9e 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -126,7 +126,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) print ''; print ''; - dol_fiche_head($head, 'spip', $langs->trans("Setup"), -1, 'user'); + print dol_get_fiche_head($head, 'spip', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link = '
'; @@ -146,13 +146,13 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) form_constantes($constantes, 2); - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; } else { - dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + print dol_get_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); $link = '
'; //$link.=$langs->trans("Activate"); @@ -160,7 +160,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) $link .= ''; print load_fiche_titre($langs->trans('SPIPTitle'), $link, ''); - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 20b1252456e..e833bd543ed 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -184,7 +184,7 @@ print load_fiche_titre($langs->trans("StockSetup"), $linkback, 'title_setup'); $head = stock_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock'); +print dol_get_fiche_head($head, 'general', $langs->trans("StockSetup"), -1, 'stock'); $form = new Form($db); $formproduct = new FormProduct($db); diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php index c4f2e48ff4a..c248a45f9f9 100644 --- a/htdocs/admin/supplier_invoice.php +++ b/htdocs/admin/supplier_invoice.php @@ -199,7 +199,7 @@ print "
"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company'); // Supplier invoice numbering module diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 9afa2bb2d1f..1999326c07e 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -222,7 +222,7 @@ print "
"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company'); // Supplier order numbering module diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 003c0247f20..c0c04eb9430 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -165,7 +165,7 @@ print load_fiche_titre($langs->trans("SupplierPaymentSetup"), $linkback, 'title_ print "
"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'supplierpayment', $langs->trans("Suppliers"), -1, 'company'); /* * Numbering module @@ -454,7 +454,7 @@ print "\n"; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; print '
'; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 7bf34fa669a..3e0708660d3 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -202,7 +202,7 @@ print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title $head = supplier_proposal_admin_prepare_head(); -dol_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal'); +print dol_get_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal'); /* * Module numerotation diff --git a/htdocs/admin/supplierinvoice_extrafields.php b/htdocs/admin/supplierinvoice_extrafields.php index 50e2fbbbb91..d84779c7477 100644 --- a/htdocs/admin/supplierinvoice_extrafields.php +++ b/htdocs/admin/supplierinvoice_extrafields.php @@ -74,11 +74,11 @@ print "
\n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index 15a96009392..ac40ef66e09 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -76,11 +76,11 @@ print "
\n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'supplierinvoicedet', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 17d866d8f94..c46eebfb037 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -74,11 +74,11 @@ print "
\n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/supplierorderdet_extrafields.php b/htdocs/admin/supplierorderdet_extrafields.php index 1bcfcec05c4..7017bebf61f 100644 --- a/htdocs/admin/supplierorderdet_extrafields.php +++ b/htdocs/admin/supplierorderdet_extrafields.php @@ -75,11 +75,11 @@ print "
\n"; $head = supplierorder_admin_prepare_head(); -dol_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), -1, 'company'); +print dol_get_fiche_head($head, 'supplierorderdet', $langs->trans("Suppliers"), -1, 'company'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index a3d54104a02..c8878b6b69f 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -147,7 +147,7 @@ if (GETPOST('target') == 'remote') $xmlarray = getURLContent($xmlremote); // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) - if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404') + if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { $xmlfile = $xmlarray['content']; //print "xmlfilestart".$xmlfile."xmlfileend"; diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 7857773924f..d9901818c92 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -431,7 +431,6 @@ print '
'; print ''; print $form->textwithpicto($langs->trans("CompressionOfResources"), $langs->trans("CompressionOfResourcesDesc")); print ': '; -//$tmp=getURLContent(DOL_URL_ROOT.'/index.php','GET');var_dump($tmp); print '
'; // on PHP print '
'.img_picto('', 'tick.png').' '.$langs->trans("FilesOfTypeCompressed", 'php (.php)').'
'; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 0cf70f2bbaa..05cf9dd1b8e 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -50,15 +50,21 @@ llxHeader(); print load_fiche_titre($langs->trans("Security"), '', 'title_setup'); print ''.$langs->trans("YouMayFindSecurityAdviceHere", 'hhttps://wiki.dolibarr.org/index.php/Security_information').' ('.$langs->trans("Reload").')
'; +print '
'; -// Recupere la version de PHP +print load_fiche_titre($langs->trans("PHPSetup"), '', ''); + +// Get version of PHP $phpversion = version_php(); -print "
PHP - ".$langs->trans("Version").": ".$phpversion."
\n"; +print "PHP - ".$langs->trans("Version").": ".$phpversion."
\n"; -// Recupere la version du serveur web +// Get versionof web server print "
Web server - ".$langs->trans("Version").": ".$_SERVER["SERVER_SOFTWARE"]."
\n"; print '
'; +print "PHP safe_mode = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0))."
\n"; +print "PHP open_basedir = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0))."
\n"; +print '
'; print load_fiche_titre($langs->trans("ConfigFile"), '', ''); @@ -73,6 +79,7 @@ print load_fiche_titre($langs->trans("PermissionsOnFiles"), '', ''); print ''.$langs->trans("PermissionOnFileInWebRoot").': '; // TODO +print 'TODO'; print '
'; @@ -126,6 +133,8 @@ print ''.$langs->trans("AntivirusEnabledOnUpload").': '; // TODO print '
'; +print '
'; + print ''.$langs->trans("SecurityAudit").': '; // TODO Disabled or enabled ? print '
'; diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index 51a089336c6..0963a264c52 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -125,7 +125,7 @@ if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('TaxSetup'), $linkback, 'title_setup'); -//dol_fiche_head(null, '', '', -1); +//print dol_get_fiche_head(null, '', '', -1); if (empty($mysoc->tva_assuj)) { diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index b30dd9c5f13..e8da4a8d736 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -182,11 +182,11 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); // Configuration header $head = ticketAdminPrepareHead(); -dol_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket"); +print dol_get_fiche_head($head, 'settings', $langs->trans("Module56000Name"), -1, "ticket"); print ''.$langs->trans("TicketSetupDictionaries").' : '.$langs->trans("ClickHereToGoTo", $langs->transnoentitiesnoconv("DictionarySetup")).'
'; -dol_fiche_end(); +print dol_get_fiche_end(); /* diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 91e5df44180..4a50beaa32e 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -71,11 +71,11 @@ print load_fiche_titre($langs->trans("TicketSetup"), $linkback, 'title_setup'); $head = ticketAdminPrepareHead(); -dol_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticket"); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Module56000Name"), -1, "ticket"); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index 011de9422bf..50ff514c6a7 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -171,11 +171,11 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); // Configuration header $head = ticketAdminPrepareHead(); -dol_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); +print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket"); print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php', 2).''; -dol_fiche_end(); +print dol_get_fiche_end(); $enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' '; diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 27b53e8266e..f39766818f3 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -54,7 +54,7 @@ $version = '0.0'; if ($action == 'getlastversion') { - $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); + $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); $sfurl = simplexml_load_string($result['content']); } diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c962a9fb776..edd5ca95026 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -235,7 +235,7 @@ print ''; $head = translation_prepare_head(); -dol_fiche_head($head, $mode, '', -1, ''); +print dol_get_fiche_head($head, $mode, '', -1, ''); if ($mode == 'overwrite') { @@ -547,7 +547,7 @@ if ($mode == 'searchkey') print '
'; } -dol_fiche_end(); +print dol_get_fiche_end(); print "\n"; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 620efb0540e..a22e585f972 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -132,7 +132,7 @@ print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); $head = user_admin_prepare_head(); -dol_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); +print dol_get_fiche_head($head, 'card', $langs->trans("MenuUsersAndGroups"), -1, 'user'); print ''; print ''; @@ -328,7 +328,7 @@ foreach ($dirmodels as $reldir) print '
'; print "
"; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 9ae01790bb2..e73e01ccbdf 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -113,7 +113,7 @@ print load_fiche_titre($langs->trans("UsersSetup"), $linkback, 'title_setup'); $head = user_admin_prepare_head(); -dol_fiche_head($head, 'usergroupcard', $langs->trans("MenuUsersAndGroups"), -1, 'user'); +print dol_get_fiche_head($head, 'usergroupcard', $langs->trans("MenuUsersAndGroups"), -1, 'user'); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); @@ -260,7 +260,7 @@ foreach ($dirmodels as $reldir) print ''; print "
"; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 19d71ebb1d9..208caf85666 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -401,7 +401,7 @@ $head[$h][1] = $langs->trans("Options"); $head[$h][2] = 'options'; $h++; -dol_fiche_head($head, 'website', '', -1); +print dol_get_fiche_head($head, 'website', '', -1); print ''.$langs->trans("WebsiteSetupDesc").'
'; @@ -621,7 +621,7 @@ if ($id) } } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 1df7642b646..738fd5bc998 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -94,7 +94,7 @@ $head[$h][1] = $langs->trans("Options"); $head[$h][2] = 'options'; $h++; -dol_fiche_head($head, 'options', '', -1); +print dol_get_fiche_head($head, 'options', '', -1); if ($action == 'edit') @@ -140,7 +140,7 @@ if ($action == 'edit') } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 554edbb892e..5987ddfea66 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -104,7 +104,7 @@ class DolibarrApi unset($object->restrictiononfksoc); unset($object->table_rowid); - // Remove linkedObjects. We should already have linkedObjectIds that avoid huge responses + // Remove linkedObjects. We should already have linkedObjectsIds that avoid huge responses unset($object->linkedObjects); unset($object->fields); diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 8177fbf7e1e..8e632fa0032 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1634,7 +1634,7 @@ class Setup extends DolibarrApi $xmlarray = getURLContent($xmlremote); // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...) - if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404') + if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') { $xmlfile = $xmlarray['content']; //print "xmlfilestart".$xmlfile."endxmlfile"; diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index 0bdbff93569..3334610b927 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -66,11 +66,11 @@ print load_fiche_titre($langs->trans("AssetsSetup"), $linkback, 'title_setup'); $head = asset_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Assets"), -1, 'generic'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Assets"), -1, 'generic'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/asset/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php index ba42a3374dc..25d7df8e1a7 100644 --- a/htdocs/asset/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -65,11 +65,11 @@ print load_fiche_titre($langs->trans("AssetsSetup"), $linkback, 'title_setup'); $head = asset_admin_prepare_head(); -dol_fiche_head($head, 'attributes_type', $langs->trans("Assets"), -1, 'generic'); +print dol_get_fiche_head($head, 'attributes_type', $langs->trans("Assets"), -1, 'generic'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 64e2bc2b5ad..6fec16ef0a0 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -60,7 +60,7 @@ print load_fiche_titre($langs->trans("AssetsSetup"), $linkback, 'title_setup'); $head = asset_admin_prepare_head(); -dol_fiche_head($head, 'settings', $langs->trans("Assets"), -1, 'generic'); +print dol_get_fiche_head($head, 'settings', $langs->trans("Assets"), -1, 'generic'); if ($action == 'edit') @@ -105,7 +105,7 @@ if ($action == 'edit') print '
'; } -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 7ef3d9c011e..0fa78edf9ce 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -168,7 +168,7 @@ if ($action == 'create') if ($backtopage) print ''; if ($backtopageforcancel) print ''; - dol_fiche_head(array(), ''); + print dol_get_fiche_head(array(), ''); print ''."\n"; @@ -180,7 +180,7 @@ if ($action == 'create') print '
'."\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -206,7 +206,7 @@ if (($id || $ref) && $action == 'edit') if ($backtopage) print ''; if ($backtopageforcancel) print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''."\n"; @@ -218,7 +218,7 @@ if (($id || $ref) && $action == 'edit') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print '   '; @@ -233,7 +233,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = asset_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto); + print dol_get_fiche_head($head, 'card', $langs->trans("Asset"), -1, $object->picto); $formconfirm = ''; @@ -297,7 +297,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); // Buttons for actions diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 2cc48489f7f..05782b8ec67 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -113,17 +113,17 @@ class Asset extends CommonObject */ public $entity; - /** - * @var string Asset label - */ - public $label; + /** + * @var string Asset label + */ + public $label; public $amount; /** * @var int Thirdparty ID */ - public $fk_soc; + public $fk_soc; /** * @var string description @@ -134,21 +134,21 @@ class Asset extends CommonObject public $note_private; /** - * @var integer|string date_creation - */ + * @var integer|string date_creation + */ public $date_creation; public $tms; /** - * @var int ID - */ + * @var int ID + */ public $fk_user_creat; /** - * @var int ID - */ + * @var int ID + */ public $fk_user_modif; public $import_key; @@ -381,7 +381,7 @@ class Asset extends CommonObject return $this->LibStatut($this->status, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return the status * @@ -391,12 +391,14 @@ class Asset extends CommonObject */ public static function LibStatut($status, $mode = 0) { - // phpcs:enable + // phpcs:enable global $langs; $langs->load("contracts"); + $labelStatus = array(); $labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled'); $labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); + $labelStatusShort = array(); $labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled'); $labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled'); @@ -407,7 +409,7 @@ class Asset extends CommonObject } /** - * Charge les informations d'ordre info dans l'objet commande + * Load info into asset object * * @param int $id Id of order * @return void diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index b43ec8d40cf..4c2e36aed9a 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -103,7 +103,7 @@ if ($object->id) if (!empty($conf->notification->enabled)) $langs->load("mails"); $head = asset_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans("Asset"), -1, 'generic'); + print dol_get_fiche_head($head, 'document', $langs->trans("Asset"), -1, 'generic'); // Build file list @@ -135,7 +135,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'asset'; //$permission = $user->rights->asset->create; diff --git a/htdocs/asset/info.php b/htdocs/asset/info.php index 801a7c85b36..d211cf0dbad 100644 --- a/htdocs/asset/info.php +++ b/htdocs/asset/info.php @@ -62,7 +62,7 @@ $object->info($id); $head = asset_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic'); +print dol_get_fiche_head($head, 'info', $langs->trans("Asset"), -1, 'generic'); $linkback = ''.$langs->trans("BackToList").''; @@ -82,7 +82,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index f19249ce1d2..514e05bff72 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -85,7 +85,7 @@ if ($id > 0 || !empty($ref)) $head = asset_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans("Asset"), -1, 'generic'); + print dol_get_fiche_head($head, 'note', $langs->trans("Asset"), -1, 'generic'); // Object card // ------------------------------------------------------------ @@ -146,7 +146,7 @@ if ($id > 0 || !empty($ref)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 1045e9135ee..28f2ce59df0 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -196,7 +196,7 @@ llxHeader('', $langs->trans("AssetsTypeSetup"), $helpurl); // List of asset type if (!$rowid && $action != 'create' && $action != 'edit') { - //dol_fiche_head(''); + //print dol_get_fiche_head(''); $sql = "SELECT d.rowid, d.label as label, d.accountancy_code_asset, d.accountancy_code_depreciation_asset, d.accountancy_code_depreciation_expense, d.note"; $sql .= " FROM ".MAIN_DB_PREFIX."asset_type as d"; @@ -324,7 +324,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print ''; print ''; @@ -382,7 +382,7 @@ if ($action == 'create') print ''; print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -416,7 +416,7 @@ if ($rowid > 0) $head = asset_type_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("AssetType"), -1, 'setup'); + print dol_get_fiche_head($head, 'card', $langs->trans("AssetType"), -1, 'setup'); $linkback = ''.$langs->trans("BackToList").''; @@ -490,7 +490,7 @@ if ($rowid > 0) print ''; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Buttons @@ -533,7 +533,7 @@ if ($rowid > 0) print ''; print ''; - dol_fiche_head($head, 'card', $langs->trans("AssetsType"), -1, 'setup'); + print dol_get_fiche_head($head, 'card', $langs->trans("AssetsType"), -1, 'setup'); print ''; @@ -595,7 +595,7 @@ if ($rowid > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print '   '; diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 051f8bb049a..b6ce9cda1bc 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -89,7 +89,7 @@ print load_fiche_titre($langs->trans("ModuleSetup").' '.$langs->trans('BlockedLo if (GETPOST('withtab', 'alpha')) { $head = blockedlogadmin_prepare_head(); - dol_fiche_head($head, 'blockedlog', '', -1); + print dol_get_fiche_head($head, 'blockedlog', '', -1); } @@ -170,7 +170,7 @@ print ''; if (GETPOST('withtab', 'alpha')) { - dol_fiche_end(); + print dol_get_fiche_end(); } print '

'; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index d0bee7c613c..0a77c6ddf3b 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -286,7 +286,7 @@ print load_fiche_titre($title, $linkback); if (GETPOST('withtab', 'alpha')) { $head = blockedlogadmin_prepare_head(); - dol_fiche_head($head, 'fingerprints', '', -1); + print dol_get_fiche_head($head, 'fingerprints', '', -1); } print ''.$langs->trans("FingerprintsDesc")."
\n"; @@ -582,7 +582,7 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->glob if (GETPOST('withtab', 'alpha')) { - dol_fiche_end(); + print dol_get_fiche_end(); } print '

'; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d8361d30258..317fd6f9032 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -126,7 +126,7 @@ if ($object->id > 0) $head = bomPrepareHead($object); - dol_fiche_head($head, 'agenda', $langs->trans("BillOfMaterials"), -1, 'bom'); + print dol_get_fiche_head($head, 'agenda', $langs->trans("BillOfMaterials"), -1, 'bom'); // Object card // ------------------------------------------------------------ @@ -185,7 +185,7 @@ if ($object->id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 7daf29416c2..7970911d84d 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -263,7 +263,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(array(), ''); + print dol_get_fiche_head(array(), ''); print ''."\n"; @@ -275,7 +275,7 @@ if ($action == 'create') print '
'."\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -297,7 +297,7 @@ if (($id || $ref) && $action == 'edit') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); //$object->fields['keyfield']['disabled'] = 1; @@ -311,7 +311,7 @@ if (($id || $ref) && $action == 'edit') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print '   '; @@ -326,7 +326,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $res = $object->fetch_optionals(); $head = bomPrepareHead($object); - dol_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); + print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom'); $formconfirm = ''; @@ -535,7 +535,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 45aedbe8ee2..f6a34a9c25d 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -98,7 +98,7 @@ if ($object->id) */ $head = bomPrepareHead($object); - dol_fiche_head($head, 'document', $langs->trans("BillOfMaterials"), -1, 'bom'); + print dol_get_fiche_head($head, 'document', $langs->trans("BillOfMaterials"), -1, 'bom'); // Build file list @@ -130,7 +130,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'bom'; $permission = $user->rights->bom->write; diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index df1693e84b0..78b38732f7f 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -83,7 +83,7 @@ if ($id > 0 || !empty($ref)) $head = bomPrepareHead($object); - dol_fiche_head($head, 'note', $langs->trans("BillOfMaterials"), -1, 'bom'); + print dol_get_fiche_head($head, 'note', $langs->trans("BillOfMaterials"), -1, 'bom'); // Object card // ------------------------------------------------------------ @@ -144,7 +144,7 @@ if ($id > 0 || !empty($ref)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index bd67f311d19..4e5d28274a8 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -827,9 +827,9 @@ class BOM extends CommonObject { global $langs; //$langs->load("mrp"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled'); - $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled'); } $statusType = 'status'.$status; diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index 93926e4ba92..30ccc6cdd75 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -149,7 +149,7 @@ if ($action == 'create') print load_fiche_titre($langs->trans("NewBookmark")); - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), 0, 'bookmark'); print ''; @@ -177,7 +177,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print '   '; @@ -215,7 +215,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) } - dol_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark'); $linkback = ''.$langs->trans("BackToList").''; @@ -295,7 +295,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); if ($action == 'edit') { diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index eb8af1ee44a..f9127914059 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -81,7 +81,7 @@ print load_fiche_titre($langs->trans("CategoriesSetup"), $linkback, 'title_setup $head = categoriesadmin_prepare_head(); -dol_fiche_head($head, 'setup', $langs->trans("Categories"), -1, 'category'); +print dol_get_fiche_head($head, 'setup', $langs->trans("Categories"), -1, 'category'); print ''; diff --git a/htdocs/categories/admin/categorie_extrafields.php b/htdocs/categories/admin/categorie_extrafields.php index 72151abdcdb..9bc1dd685ff 100644 --- a/htdocs/categories/admin/categorie_extrafields.php +++ b/htdocs/categories/admin/categorie_extrafields.php @@ -68,11 +68,11 @@ print load_fiche_titre($langs->trans("CategoriesSetup"), $linkback, 'title_setup $head = categoriesadmin_prepare_head(); -dol_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), -1, 'category'); +print dol_get_fiche_head($head, 'attributes_categories', $langs->trans("Categories"), -1, 'category'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 096a5497efd..6598387c36a 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -41,8 +41,8 @@ if (!$user->rights->categorie->lire) accessforbidden(); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$catorigin = GETPOST('catorigin', 'int'); -$type = GETPOST('type', 'alpha'); +$catorigin = GETPOST('catorigin', 'int'); +$type = GETPOST('type', 'aZ09'); $urlfrom = GETPOST('urlfrom', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -73,6 +73,8 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categorycard')); +$error = 0; + /* * Actions @@ -127,7 +129,7 @@ if ($action == 'add' && $user->rights->categorie->creer) $object->label = $label; $object->color = $color; $object->description = dol_htmlcleanlastbr($description); - $object->socid = ($socid ? $socid : 'null'); + $object->socid = ($socid > 0 ? $socid : 0); $object->visible = $visible; $object->type = $type; @@ -233,7 +235,7 @@ if ($user->rights->categorie->creer) print load_fiche_titre($langs->trans("CreateCat")); - dol_fiche_head(''); + print dol_get_fiche_head(''); print '
'; @@ -270,7 +272,7 @@ if ($user->rights->categorie->creer) print '
'; - dol_fiche_end(''); + print dol_get_fiche_end(''); print '
'; print ''; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 1bc9f47ded4..086e14b27d0 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -208,6 +208,11 @@ class Categorie extends CommonObject */ public $color; + /** + * @var int Visible + */ + public $visible; + /** * @var int Id of thirdparty when CATEGORY_ASSIGNED_TO_A_CUSTOMER is set */ @@ -312,42 +317,38 @@ class Categorie extends CommonObject $sql = "SELECT rowid, fk_parent, entity, label, description, color, fk_soc, visible, type, ref_ext"; $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie"; - if ($id > 0) - { + if ($id > 0) { $sql .= " WHERE rowid = ".$id; - } elseif (!empty($ref_ext)) - { + } elseif (!empty($ref_ext)) { $sql .= " WHERE ref_ext LIKE '".$this->db->escape($ref_ext)."'"; } else { $sql .= " WHERE label = '".$this->db->escape($label)."' AND entity IN (".getEntity('category').")"; - if (!is_null($type)) $sql .= " AND type = ".$this->db->escape($type); + if (!is_null($type)) $sql .= " AND type = ".((int) $type); } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql) > 0) - { + if ($resql) { + if ($this->db->num_rows($resql) > 0) { $res = $this->db->fetch_array($resql); $this->id = $res['rowid']; //$this->ref = $res['rowid']; - $this->fk_parent = $res['fk_parent']; + $this->fk_parent = (int) $res['fk_parent']; $this->label = $res['label']; $this->description = $res['description']; $this->color = $res['color']; - $this->socid = $res['fk_soc']; - $this->visible = $res['visible']; - $this->type = $res['type']; + $this->socid = (int) $res['fk_soc']; + $this->visible = (int) $res['visible']; + $this->type = (int) $res['type']; $this->ref_ext = $res['ref_ext']; - $this->entity = $res['entity']; + $this->entity = (int) $res['entity']; $this->date_creation = $this->db->jdate($res['date_creation']); $this->date_modification = $this->db->jdate($res['tms']); - $this->user_creation = $res['fk_user_creat']; - $this->user_modification = $res['fk_user_modif']; + $this->user_creation = (int) $res['fk_user_creat']; + $this->user_modification = (int) $res['fk_user_modif']; - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -397,8 +398,7 @@ class Categorie extends CommonObject if (empty($this->visible)) $this->visible = 0; $this->fk_parent = ($this->fk_parent != "" ? intval($this->fk_parent) : 0); - if ($this->already_exists()) - { + if ($this->already_exists()) { $this->error = $langs->trans("ImpossibleAddCat", $this->label); $this->error .= " : ".$langs->trans("CategoryExistsAtSameLevel"); dol_syslog($this->error, LOG_WARNING); @@ -412,8 +412,7 @@ class Categorie extends CommonObject $sql .= " label,"; $sql .= " description,"; $sql .= " color,"; - if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) - { + if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql .= "fk_soc,"; } $sql .= " visible,"; @@ -424,54 +423,47 @@ class Categorie extends CommonObject $sql .= " date_creation,"; $sql .= " fk_user_creat"; $sql .= ") VALUES ("; - $sql .= $this->db->escape($this->fk_parent).","; - $sql .= "'".$this->db->escape($this->label)."',"; - $sql .= "'".$this->db->escape($this->description)."',"; - $sql .= "'".$this->db->escape($this->color)."',"; - if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) - { - $sql .= ($this->socid != -1 ? $this->socid : 'null').","; + $sql .= (int) $this->fk_parent.","; + $sql .= "'".$this->db->escape($this->label)."', "; + $sql .= "'".$this->db->escape($this->description)."', "; + $sql .= "'".$this->db->escape($this->color)."', "; + if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { + $sql .= ($this->socid > 0 ? $this->socid : 'null').", "; } - $sql .= "'".$this->db->escape($this->visible)."',"; - $sql .= $this->db->escape($type).","; - $sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').","; - $sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').","; - $sql .= $this->db->escape($conf->entity).","; + $sql .= "'".$this->db->escape($this->visible)."', "; + $sql .= $this->db->escape($type).", "; + $sql .= (!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : 'null').", "; + $sql .= (!empty($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : 'null').", "; + $sql .= (int) $conf->entity.", "; $sql .= "'".$this->db->idate($now)."', "; $sql .= (int) $user->id; $sql .= ")"; $res = $this->db->query($sql); - if ($res) - { + if ($res) { $id = $this->db->last_insert_id(MAIN_DB_PREFIX."categorie"); - if ($id > 0) - { + if ($id > 0) { $this->id = $id; $action = 'create'; // Actions on extra fields - if (!$error) - { + if (!$error) { $result = $this->insertExtraFields(); - if ($result < 0) - { + if ($result < 0) { $error++; } } - if (!$error) - { + if (!$error) { // Call trigger $result = $this->call_trigger('CATEGORY_CREATE', $user); if ($result < 0) { $error++; } // End call triggers } - if (!$error) - { + if (!$error) { $this->db->commit(); return $id; } else { @@ -510,8 +502,7 @@ class Categorie extends CommonObject $this->fk_parent = ($this->fk_parent != "" ? intval($this->fk_parent) : 0); $this->visible = ($this->visible != "" ? intval($this->visible) : 0); - if ($this->already_exists()) - { + if ($this->already_exists()) { $this->error = $langs->trans("ImpossibleUpdateCat"); $this->error .= " : ".$langs->trans("CategoryExistsAtSameLevel"); return -1; @@ -524,32 +515,27 @@ class Categorie extends CommonObject $sql .= " description = '".$this->db->escape($this->description)."',"; $sql .= " ref_ext = '".$this->db->escape($this->ref_ext)."',"; $sql .= " color = '".$this->db->escape($this->color)."'"; - if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) - { - $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); + if (!empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { + $sql .= ", fk_soc = ".($this->socid > 0 ? $this->socid : 'null'); } - $sql .= ", visible = '".$this->db->escape($this->visible)."'"; - $sql .= ", fk_parent = ".$this->fk_parent; + $sql .= ", visible = ".(int) $this->visible; + $sql .= ", fk_parent = ".(int) $this->fk_parent; $sql .= ", fk_user_modif = ".(int) $user->id; $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update", LOG_DEBUG); - if ($this->db->query($sql)) - { + if ($this->db->query($sql)) { $action = 'update'; // Actions on extra fields - if (!$error) - { + if (!$error) { $result = $this->insertExtraFields(); - if ($result < 0) - { + if ($result < 0) { $error++; } } - if (!$error) - { + if (!$error) { // Call trigger $result = $this->call_trigger('CATEGORY_MODIFY', $user); if ($result < 0) { $error++; $this->db->rollback(); return -1; } @@ -586,8 +572,7 @@ class Categorie extends CommonObject $this->db->begin(); - if (!$error && !$notrigger) - { + if (!$error && !$notrigger) { // Call trigger $result = $this->call_trigger('CATEGORY_DELETE', $user); if ($result < 0) $error++; @@ -595,14 +580,12 @@ class Categorie extends CommonObject } /* FIX #1317 : Check for child category and move up 1 level*/ - if (!$error) - { + if (!$error) { $sql = "UPDATE ".MAIN_DB_PREFIX."categorie"; $sql .= " SET fk_parent = ".$this->fk_parent; $sql .= " WHERE fk_parent = ".$this->id; - if (!$this->db->query($sql)) - { + if (!$this->db->query($sql)) { $this->error = $this->db->lasterror(); $error++; } @@ -630,18 +613,15 @@ class Categorie extends CommonObject } // Removed extrafields - if (!$error) - { + if (!$error) { $result = $this->deleteExtraFields(); - if ($result < 0) - { + if ($result < 0) { $error++; dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR); } } - if (!$error) - { + if (!$error) { $this->db->commit(); return 1; } else { @@ -676,29 +656,23 @@ class Categorie extends CommonObject $sql .= " VALUES (".$this->id.", ".$obj->id.")"; dol_syslog(get_class($this).'::add_type', LOG_DEBUG); - if ($this->db->query($sql)) - { - if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) - { + if ($this->db->query($sql)) { + if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) { $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie'; $sql .= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::add_type", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql) > 0) - { + if ($resql) { + if ($this->db->num_rows($resql) > 0) { $objparent = $this->db->fetch_object($resql); - if (!empty($objparent->fk_parent)) - { + if (!empty($objparent->fk_parent)) { $cat = new Categorie($this->db); $cat->id = $objparent->fk_parent; if (!$cat->containsObject($type, $obj->id)) { $result = $cat->add_type($obj, $type); - if ($result < 0) - { + if ($result < 0) { $this->error = $cat->error; $error++; } @@ -710,8 +684,7 @@ class Categorie extends CommonObject $this->error = $this->db->lasterror(); } - if ($error) - { + if ($error) { $this->db->rollback(); return -1; } @@ -725,8 +698,7 @@ class Categorie extends CommonObject if ($result < 0) { $error++; } // End call triggers - if (!$error) - { + if (!$error) { $this->db->commit(); return 1; } else { @@ -735,8 +707,7 @@ class Categorie extends CommonObject } } else { $this->db->rollback(); - if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') - { + if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $this->db->lasterrno(); return -3; } else { @@ -778,16 +749,14 @@ class Categorie extends CommonObject $sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".$obj->id; dol_syslog(get_class($this).'::del_type', LOG_DEBUG); - if ($this->db->query($sql)) - { + if ($this->db->query($sql)) { // Call trigger $this->context = array('unlinkoff'=>$obj); // Save object we want to link category to into category instance to provide information to trigger $result = $this->call_trigger('CATEGORY_UNLINK', $user); if ($result < 0) { $error++; } // End call triggers - if (!$error) - { + if (!$error) { $this->db->commit(); return 1; } else { @@ -829,8 +798,7 @@ class Categorie extends CommonObject $sql .= " AND c.fk_categorie = ".$this->id; $sql .= " AND c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = o.rowid"; // Protection for external users - if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) - { + if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) { $sql .= " AND o.rowid = ".$user->socid; } if ($limit > 0 || $offset > 0) $sql .= $this->db->plimit($limit + 1, $offset); @@ -838,10 +806,8 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { - while ($rec = $this->db->fetch_array($resql)) - { + if ($resql) { + while ($rec = $this->db->fetch_array($resql)) { if ($onlyids) { $objs[] = $rec['fk_'.(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])]; } else { @@ -927,20 +893,17 @@ class Categorie extends CommonObject $offset = 0; $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) - { + if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 - { + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } } if ($limit) { - if ($page < 0) - { + if ($page < 0) { $page = 0; } $offset = $limit * $page; @@ -949,17 +912,14 @@ class Categorie extends CommonObject } $result = $this->db->query($sql); - if ($result) - { + if ($result) { $i = 0; $num = $this->db->num_rows($result); $min = min($num, ($limit <= 0 ? $num : $limit)); - while ($i < $min) - { + while ($i < $min) { $obj = $this->db->fetch_object($result); $category_static = new Categorie($this->db); - if ($category_static->fetch($obj->rowid)) - { + if ($category_static->fetch($obj->rowid)) { $categories[$i]['id'] = $category_static->id; $categories[$i]['fk_parent'] = $category_static->fk_parent; $categories[$i]['label'] = $category_static->label; @@ -1004,11 +964,9 @@ class Categorie extends CommonObject $sql .= " AND entity IN (".getEntity('category').")"; $res = $this->db->query($sql); - if ($res) - { + if ($res) { $cats = array(); - while ($rec = $this->db->fetch_array($res)) - { + while ($rec = $this->db->fetch_array($res)) { $cat = new Categorie($this->db); $cat->fetch($rec['rowid']); $cats[] = $cat; @@ -1039,10 +997,8 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::load_motherof", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { - while ($obj = $this->db->fetch_object($resql)) - { + if ($resql) { + while ($obj = $this->db->fetch_object($resql)) { $this->motherof[$obj->id_son] = $obj->id_parent; } return 1; @@ -1083,19 +1039,15 @@ class Categorie extends CommonObject return -1; } - if (is_string($markafterid)) - { + if (is_string($markafterid)) { $markafterid = explode(',', $markafterid); - } elseif (is_numeric($markafterid)) - { - if ($markafterid > 0) - { + } elseif (is_numeric($markafterid)) { + if ($markafterid > 0) { $markafterid = array($markafterid); } else { $markafterid = array(); } - } elseif (!is_array($markafterid)) - { + } elseif (!is_array($markafterid)) { $markafterid = array(); } @@ -1115,11 +1067,9 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::get_full_arbo get category list", 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)) { $this->cats[$obj->rowid]['rowid'] = $obj->rowid; $this->cats[$obj->rowid]['id'] = $obj->rowid; $this->cats[$obj->rowid]['fk_parent'] = $obj->fk_parent; @@ -1137,15 +1087,13 @@ class Categorie extends CommonObject // We add the fullpath property to each elements of first level (no parent exists) dol_syslog(get_class($this)."::get_full_arbo call to build_path_from_id_categ", LOG_DEBUG); - foreach ($this->cats as $key => $val) - { + foreach ($this->cats as $key => $val) { //print 'key='.$key.'
'."\n"; $this->build_path_from_id_categ($key, 0); // Process a branch from the root category key (this category has no parent) } // Include or exclude leaf including $markafterid from tree - if (count($markafterid) > 0) - { + if (count($markafterid) > 0) { $keyfiltercatid = '('.implode('|', $markafterid).')'; //print "Look to discard category ".$markafterid."\n"; @@ -1153,13 +1101,11 @@ class Categorie extends CommonObject $keyfilter2 = '_'.$keyfiltercatid.'$'; $keyfilter3 = '^'.$keyfiltercatid.'_'; $keyfilter4 = '_'.$keyfiltercatid.'_'; - foreach ($this->cats as $key => $val) - { + foreach ($this->cats as $key => $val) { $test = (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath']) || preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])); - if (($test && !$include) || (!$test && $include)) - { + if (($test && !$include) || (!$test && $include)) { unset($this->cats[$key]); } } @@ -1189,8 +1135,7 @@ class Categorie extends CommonObject // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); - if (!empty($this->cats[$id_categ]['fullpath'])) - { + if (!empty($this->cats[$id_categ]['fullpath'])) { // Already defined dol_syslog(get_class($this)."::build_path_from_id_categ fullpath and fulllabel already defined", LOG_WARNING); return; @@ -1204,8 +1149,7 @@ class Categorie extends CommonObject $this->cats[$id_categ]['fulllabel'] = $this->cats[$id_categ]['label']; $i = 0; $cursor_categ = $id_categ; //print 'Work for id_categ='.$id_categ.'
'."\n"; - while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) - { + while ((empty($protection) || $i < $protection) && !empty($this->motherof[$cursor_categ])) { //print '  cursor_categ='.$cursor_categ.' i='.$i.' '.$this->motherof[$cursor_categ].'
'."\n"; $this->cats[$id_categ]['fullpath'] = '_'.$this->motherof[$cursor_categ].$this->cats[$id_categ]['fullpath']; $this->cats[$id_categ]['fulllabel'] = $this->cats[$this->motherof[$cursor_categ]]['label'].' >> '.$this->cats[$id_categ]['fulllabel']; @@ -1231,8 +1175,7 @@ class Categorie extends CommonObject { // phpcs:enable // Display $this->cats - foreach ($this->cats as $key => $val) - { + foreach ($this->cats as $key => $val) { print 'id: '.$this->cats[$key]['id']; print ' label: '.$this->cats[$key]['label']; print ' mother: '.$this->cats[$key]['fk_parent']; @@ -1260,16 +1203,14 @@ class Categorie extends CommonObject $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql .= " WHERE entity IN (".getEntity('category').")"; if (!is_null($type)) - $sql .= " AND type = ".$type; + $sql .= " AND type = ".(int) $type; if ($parent) $sql .= " AND fk_parent = 0"; $res = $this->db->query($sql); - if ($res) - { + if ($res) { $cats = array(); - while ($rec = $this->db->fetch_array($res)) - { + while ($rec = $this->db->fetch_array($res)) { $cat = new Categorie($this->db); $cat->fetch($rec['rowid']); $cats[$rec['rowid']] = $cat; @@ -1319,18 +1260,15 @@ class Categorie extends CommonObject dol_syslog(get_class($this)."::already_exists", LOG_DEBUG); $resql = $this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql) > 0) // Checking for empty resql - { + if ($resql) { + if ($this->db->num_rows($resql) > 0) { // Checking for empty resql $obj = $this->db->fetch_array($resql); /* If object called create, obj cannot have is id. * If object called update, he mustn't have the same label as an other category for this mother. * So if the result have the same id, update is not for label, and if result have an other one, * update may be for label. */ - if ($obj[0] > 0 && $obj[0] != $this->id) - { + if ($obj[0] > 0 && $obj[0] != $this->id) { dol_syslog(get_class($this)."::already_exists category with name=".$this->label." and parent ".$this->fk_parent." exists: rowid=".$obj[0]." current_id=".$this->id, LOG_DEBUG); return 1; } @@ -1361,24 +1299,19 @@ class Categorie extends CommonObject $ways = array(); $allways = $this->get_all_ways(); // Load array of categories - foreach ($allways as $way) - { + foreach ($allways as $way) { $w = array(); $i = 0; $forced_color = ''; - foreach ($way as $cat) - { + foreach ($way as $cat) { $i++; - if (empty($nocolor)) - { + if (empty($nocolor)) { $forced_color = 'toreplace'; - if ($i == count($way)) - { + if ($i == count($way)) { // Check contrast with background and correct text color $forced_color = 'categtextwhite'; - if ($cat->color) - { + if ($cat->color) { if (colorIsLight($cat->color)) $forced_color = 'categtextblack'; } } @@ -1421,12 +1354,9 @@ class Categorie extends CommonObject $res = $this->db->query($sql); - if ($res) - { - while ($rec = $this->db->fetch_array($res)) - { - if ($rec['fk_parent'] > 0) - { + if ($res) { + while ($rec = $this->db->fetch_array($res)) { + if ($rec['fk_parent'] > 0) { $cat = new Categorie($this->db); $cat->fetch($rec['fk_parent']); $parents[] = $cat; @@ -1452,13 +1382,10 @@ class Categorie extends CommonObject $ways = array(); $parents = $this->get_meres(); - if (!empty($parents)) - { - foreach ($parents as $parent) - { + if (!empty($parents)) { + foreach ($parents as $parent) { $allways = $parent->get_all_ways(); - foreach ($allways as $way) - { + foreach ($allways as $way) { $w = $way; $w[] = $this; $ways[] = $w; @@ -1488,8 +1415,7 @@ class Categorie extends CommonObject if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; - if ($type === Categorie::TYPE_BANK_LINE) // TODO Remove this with standard category code - { + if ($type === Categorie::TYPE_BANK_LINE) { // TODO Remove this with standard category code // Load bank groups $sql = "SELECT c.label, c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_class as a, ".MAIN_DB_PREFIX."bank_categ as c"; @@ -1497,10 +1423,8 @@ class Categorie extends CommonObject $sql .= " ORDER BY c.label"; $res = $this->db->query($sql); - if ($res) - { - while ($obj = $this->db->fetch_object($res)) - { + if ($res) { + while ($obj = $this->db->fetch_object($res)) { if ($mode == 'id') { $cats[] = $obj->rowid; } elseif ($mode == 'label') { @@ -1523,10 +1447,8 @@ class Categorie extends CommonObject $sql .= " AND c.entity IN (".getEntity('category').")"; $res = $this->db->query($sql); - if ($res) - { - while ($obj = $this->db->fetch_object($res)) - { + if ($res) { + while ($obj = $this->db->fetch_object($res)) { if ($mode == 'id') { $cats[] = $obj->rowid; } elseif ($mode == 'label') { @@ -1579,24 +1501,20 @@ class Categorie extends CommonObject $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql .= " WHERE type = ".$this->MAP_ID[$type]; $sql .= " AND entity IN (".getEntity('category').")"; - if ($nom) - { + if ($nom) { if (!$exact) $nom = '%'.str_replace('*', '%', $nom).'%'; if (!$case) $sql .= " AND label LIKE '".$this->db->escape($nom)."'"; else $sql .= " AND label LIKE BINARY '".$this->db->escape($nom)."'"; } - if ($id) - { + if ($id) { $sql .= " AND rowid = '".$id."'"; } $res = $this->db->query($sql); - if ($res) - { - while ($rec = $this->db->fetch_array($res)) - { + if ($res) { + while ($rec = $this->db->fetch_array($res)) { $cat = new Categorie($this->db); $cat->fetch($rec['rowid']); $cats[] = $cat; @@ -1628,8 +1546,7 @@ class Categorie extends CommonObject // Check contrast with background and correct text color $forced_color = 'categtextwhite'; - if ($this->color) - { + if ($this->color) { if (colorIsLight($this->color)) $forced_color = 'categtextblack'; } @@ -1662,14 +1579,12 @@ class Categorie extends CommonObject $dir = $sdir.'/'.get_exdir($this->id, 2, 0, 0, $this, 'category').$this->id."/"; $dir .= "photos/"; - if (!file_exists($dir)) - { + if (!file_exists($dir)) { dol_mkdir($dir); } if (file_exists($dir)) { - if (is_array($file['name']) && count($file['name']) > 0) - { + if (is_array($file['name']) && count($file['name']) > 0) { $nbfile = count($file['name']); for ($i = 0; $i <= $nbfile; $i++) { $originImage = $dir.$file['name'][$i]; @@ -1714,22 +1629,17 @@ class Categorie extends CommonObject $dirthumb = $dir.'thumbs/'; - if (file_exists($dir)) - { + if (file_exists($dir)) { $handle = opendir($dir); - if (is_resource($handle)) - { - while (($file = readdir($handle)) !== false) - { - if (dol_is_file($dir.$file) && preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) - { + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false) { + if (dol_is_file($dir.$file) && preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $dir.$file)) { $nbphoto++; $photo = $file; // On determine nom du fichier vignette $photo_vignette = ''; - if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) - { + if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $photo, $regs)) { $photo_vignette = preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0]; } @@ -1773,11 +1683,9 @@ class Categorie extends CommonObject dol_delete_file($file, 1); // Si elle existe, on efface la vignette - if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $filename, $regs)) - { + if (preg_match('/(\.jpeg|\.jpg|\.bmp|\.gif|\.png|\.tiff)$/i', $filename, $regs)) { $photo_vignette = preg_replace('/'.$regs[0].'/i', '', $filename).'_small'.$regs[0]; - if (file_exists($dirthumb.$photo_vignette)) - { + if (file_exists($dirthumb.$photo_vignette)) { dol_delete_file($dirthumb.$photo_vignette, 1); } } @@ -1812,8 +1720,7 @@ class Categorie extends CommonObject $langs_available = $langs->get_available_languages(); $current_lang = $langs->getDefaultLang(); - foreach ($langs_available as $key => $value) - { + foreach ($langs_available as $key => $value) { $sql = "SELECT rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang"; $sql .= " WHERE fk_category=".$this->id; @@ -1821,10 +1728,8 @@ class Categorie extends CommonObject $result = $this->db->query($sql); - if ($key == $current_lang) - { - if ($this->db->num_rows($result)) // si aucune ligne dans la base - { + if ($key == $current_lang) { + if ($this->db->num_rows($result)) { // si aucune ligne dans la base $sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang"; $sql2 .= " SET label='".$this->db->escape($this->label)."',"; $sql2 .= " description='".$this->db->escape($this->description)."'"; @@ -1835,15 +1740,12 @@ class Categorie extends CommonObject $sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')"; } dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG); - if (!$this->db->query($sql2)) - { + if (!$this->db->query($sql2)) { $this->error = $this->db->lasterror(); return -1; } - } elseif (isset($this->multilangs["$key"])) - { - if ($this->db->num_rows($result)) // si aucune ligne dans la base - { + } elseif (isset($this->multilangs["$key"])) { + if ($this->db->num_rows($result)) { // si aucune ligne dans la base $sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang"; $sql2 .= " SET label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; @@ -1857,8 +1759,7 @@ class Categorie extends CommonObject // on ne sauvegarde pas des champs vides if ($this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"] || $this->multilangs["$key"]["note"]) dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG); - if (!$this->db->query($sql2)) - { + if (!$this->db->query($sql2)) { $this->error = $this->db->lasterror(); return -1; } @@ -1892,13 +1793,10 @@ class Categorie extends CommonObject $sql .= " WHERE fk_category=".$this->id; $result = $this->db->query($sql); - if ($result) - { - while ($obj = $this->db->fetch_object($result)) - { + if ($result) { + while ($obj = $this->db->fetch_object($result)) { //print 'lang='.$obj->lang.' current='.$current_lang.'
'; - if ($obj->lang == $current_lang) // si on a les traduct. dans la langue courante on les charge en infos principales. - { + if ($obj->lang == $current_lang) { // si on a les traduct. dans la langue courante on les charge en infos principales. $this->label = $obj->label; $this->description = $obj->description; } @@ -1988,26 +1886,21 @@ class Categorie extends CommonObject { if ($type == 'bank_account') $type = 'account'; - if (empty($searchList) && !is_array($searchList)) - { + if (empty($searchList) && !is_array($searchList)) { return ""; } - foreach ($searchList as $searchCategory) - { - if (intval($searchCategory) == -2) - { + foreach ($searchList as $searchCategory) { + if (intval($searchCategory) == -2) { $searchCategorySqlList[] = " cp.fk_categorie IS NULL"; - } elseif (intval($searchCategory) > 0) - { + } elseif (intval($searchCategory) > 0) { $searchCategorySqlList[] = " ".$rowIdName ." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type ." WHERE fk_categorie = ".$searchCategory.")"; } } - if (!empty($searchCategorySqlList)) - { + if (!empty($searchCategorySqlList)) { return " AND (".implode(' AND ', $searchCategorySqlList).")"; } else { return ""; diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 7c8c683bf18..4b4eaffeb57 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -34,7 +34,7 @@ $langs->load("categories"); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alphanohtml'); -$type = GETPOST('type', 'alphanohtml'); +$type = (int) GETPOST('type', 'int'); $action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit'); $confirm = GETPOST('confirm'); $cancel = GETPOST('cancel', 'alpha'); @@ -43,11 +43,10 @@ $socid = GETPOST('socid', 'int'); $label = GETPOST('label', 'alphanohtml'); $description = GETPOST('description', 'restricthtml'); $color = preg_replace('/[^0-9a-f#]/i', '', GETPOST('color', 'alphanohtml')); -$visible = GETPOST('visible'); -$parent = GETPOST('parent'); +$visible = (int) GETPOST('visible', 'int'); +$parent = (int) GETPOST('parent', 'int'); -if ($id == "") -{ +if ($id == "") { dol_print_error('', 'Missing parameter id'); exit(); } @@ -56,8 +55,7 @@ if ($id == "") $result = restrictedArea($user, 'categorie', $id, '&category'); $object = new Categorie($db); -if ($id > 0) -{ +if ($id > 0) { $result = $object->fetch($id); } @@ -67,45 +65,39 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('categorycard')); +$error = 0; + /* * Actions */ -if ($cancel) -{ +if ($cancel) { header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); exit; } // Action mise a jour d'une categorie -if ($action == 'update' && $user->rights->categorie->creer) -{ +if ($action == 'update' && $user->rights->categorie->creer) { $object->oldcopy = dol_clone($object); $object->label = $label; $object->description = dol_htmlcleanlastbr($description); $object->color = $color; - $object->socid = ($socid ? $socid : 'null'); + $object->socid = ($socid > 0 ? $socid : 0); $object->visible = $visible; - - if ($parent != "-1") - $object->fk_parent = $parent; - else $object->fk_parent = ""; + $object->fk_parent = $parent != -1 ? $parent : 0; - if (empty($object->label)) - { + if (empty($object->label)) { $error++; $action = 'edit'; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } - if (!$error && empty($object->error)) - { + if (!$error && empty($object->error)) { $ret = $extrafields->setOptionalsFromPost(null, $object); if ($ret < 0) $error++; - if (!$error && $object->update($user) > 0) - { + if (!$error && $object->update($user) > 0) { header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type); exit; } else { @@ -139,7 +131,7 @@ print ''; print ''; print ''; -dol_fiche_head(''); +print dol_get_fiche_head(''); print ''; @@ -173,15 +165,14 @@ print ''; $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -if (empty($reshook)) -{ +if (empty($reshook)) { print $object->showOptionals($extrafields, 'edit', $parameters); } print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
 
'; diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index bef54f9dd6b..5bd8f6c9d24 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -64,7 +64,7 @@ $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; $head = categories_prepare_head($object, $type); -dol_fiche_head($head, 'info', $langs->trans($title), -1, 'category'); +print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$type; @@ -95,7 +95,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 866a98fd816..73c7664f6c2 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -117,7 +117,7 @@ if ($object->id) $head = categories_prepare_head($object, $type); - dol_fiche_head($head, 'photos', $langs->trans($title), -1, 'category'); + print dol_get_fiche_head($head, 'photos', $langs->trans($title), -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; @@ -161,7 +161,7 @@ if ($object->id) print "\n"; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index f4e073c4e1c..660dbf9317d 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -187,7 +187,7 @@ if (!empty($object->multilangs)) } } -dol_fiche_head($head, 'translation', $langs->trans($title), -1, 'category'); +print dol_get_fiche_head($head, 'translation', $langs->trans($title), -1, 'category'); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; @@ -223,7 +223,7 @@ print ''; print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 30b706a4b3a..280b278657c 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 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 @@ -160,12 +161,29 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi } } -if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' && ($user->rights->produit->creer || $user->rights->service->creer)) +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) + )) { - require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - $newobject = new Product($db); + if ($type == Categorie::TYPE_PRODUCT) + { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $newobject = new Product($db); + $elementtype = 'product'; + } elseif ($type == Categorie::TYPE_CUSTOMER) + { + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $newobject = new Societe($db); + $elementtype = 'customer'; + } elseif ($type == Categorie::TYPE_SUPPLIER) + { + require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $newobject = new Societe($db); + $elementtype = 'supplier'; + } $result = $newobject->fetch($elemid); - $elementtype = 'product'; // TODO Add into categ $result = $object->add_type($newobject, $elementtype); @@ -200,7 +218,7 @@ $title = Categorie::$MAP_TYPE_TITLE_AREA[$type]; $head = categories_prepare_head($object, $type); -dol_fiche_head($head, 'card', $langs->trans($title), -1, 'category'); +print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.$type); $linkback = ''.$langs->trans("BackToList").''; $object->next_prev_filter = ' type = '.$object->type; @@ -249,7 +267,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); /* @@ -513,6 +531,27 @@ if ($type == Categorie::TYPE_SUPPLIER) { 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("AddSupplierIntoCategory").'  '; + print $form->select_company('', 'elemid', 's.fournisseur = 1'); + print '
'; + print '
'; + } + print '
'; print ''; print ''; @@ -570,6 +609,27 @@ if ($type == Categorie::TYPE_CUSTOMER) { 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("AddCustomerIntoCategory").'  '; + print $form->select_company('', 'elemid', 's.client IN (1,3)'); + print '
'; + print '
'; + } + print '
'; print ''; print ''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 5b50958591f..a46e302bd4b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -935,7 +935,7 @@ if ($action == 'create') if (GETPOST("actioncode", 'aZ09') == 'AC_RDV') print load_fiche_titre($langs->trans("AddActionRendezVous"), '', 'title_agenda'); else print load_fiche_titre($langs->trans("AddAnAction"), '', 'title_agenda'); - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -1291,7 +1291,7 @@ if ($action == 'create') print ''."\n"; } - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -1410,7 +1410,7 @@ if ($id > 0) if ($backtopage) print ''; if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) print ''; - dol_fiche_head($head, 'card', $langs->trans("Action"), 0, 'action'); + print dol_get_fiche_head($head, 'card', $langs->trans("Action"), 0, 'action'); print '
'; @@ -1782,7 +1782,7 @@ if ($id > 0) print ''."\n"; } - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -1792,7 +1792,7 @@ if ($id > 0) print ''; } else { - dol_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action'); + print dol_get_fiche_head($head, 'card', $langs->trans("Action"), -1, 'action'); // Clone event @@ -2095,7 +2095,7 @@ if ($id > 0) print '
'; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 97896448a3f..fbe9891522c 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -626,7 +626,7 @@ class ActionComm extends CommonObject // Load source object $objFrom = clone $this; - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index bed4054e018..613ac76380e 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -120,7 +120,7 @@ if ($object->id > 0) $now = dol_now(); $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60; - dol_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); + print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"'); $linkback .= ''.$langs->trans("BackToList").''; @@ -254,7 +254,7 @@ if ($object->id > 0) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'actions'; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 7a52183b195..e62f411d786 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -415,9 +415,9 @@ print ''; print ''; -//dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); +//print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); //print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid); -//dol_fiche_end(); +//print dol_get_fiche_end(); $viewmode = ''; $viewmode .= ''; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 8575ac67653..292c0ea94ce 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -62,7 +62,7 @@ $object->fetch($id); $object->info($object->id); $head = actions_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action'); +print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action'); $linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"'); $linkback .= ''.$langs->trans("BackToList").''; @@ -112,7 +112,7 @@ print '
'; dol_print_object_info($object); print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 92975aafec0..582f1c538f0 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -452,9 +452,9 @@ if ($resql) if ($showbirthday) $nav .= ''; print $nav; - //dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); + //print dol_get_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); //print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); - //dol_fiche_end(); + //print dol_get_fiche_end(); // Add link to show birthdays $link = ''; diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php index d154dc7aafb..79836087775 100644 --- a/htdocs/comm/admin/propal_extrafields.php +++ b/htdocs/comm/admin/propal_extrafields.php @@ -68,11 +68,11 @@ print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), -1, 'propal'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Proposals"), -1, 'propal'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index 1acdbfa5ca1..fa12fe9b555 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -75,11 +75,11 @@ print load_fiche_titre($langs->trans("PropalSetup"), $linkback, 'title_setup'); $head = propal_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), -1, 'propal'); +print dol_get_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), -1, 'propal'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 9de895f0094..df7e96fc742 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -245,7 +245,7 @@ if ($object->id > 0) { $head = societe_prepare_head($object); - dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company'); + print dol_get_fiche_head($head, 'customer', $langs->trans("ThirdParty"), -1, 'company'); $linkback = ''.$langs->trans("BackToList").''; @@ -1256,7 +1256,7 @@ if ($object->id > 0) print '
'; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 64e7df053ea..eb6d29d12a5 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -415,7 +415,7 @@ $formother = new FormOther($db); if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); - dol_fiche_head($head, 'advtargets', $langs->trans("Mailing"), 0, 'email'); + print dol_get_fiche_head($head, 'advtargets', $langs->trans("Mailing"), 0, 'email'); print ''; diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 4fe46859dc7..bb74fb686aa 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -462,9 +462,9 @@ if (empty($reshook)) { $mesgs = array(); - $object->email_from = GETPOST("from"); - $object->email_replyto = GETPOST("replyto"); - $object->email_errorsto = GETPOST("errorsto"); + $object->email_from = GETPOST("from", "none"); // Must allow 'name ' + $object->email_replyto = GETPOST("replyto", "none"); // Must allow 'name ' + $object->email_errorsto = GETPOST("errorsto", "none"); // Must allow 'name ' $object->title = GETPOST("title"); $object->sujet = GETPOST("sujet"); $object->body = GETPOST("bodyemail", 'restricthtml'); @@ -491,7 +491,7 @@ if (empty($reshook)) $mesgs[] = $object->error; } - setEventMessages($mesg, $mesgs, 'errors'); + setEventMessages(null, $mesgs, 'errors'); $action = "create"; } @@ -501,11 +501,10 @@ if (empty($reshook)) $upload_dir = $conf->mailing->dir_output."/".get_exdir($object->id, 2, 0, 1, $object, 'mailing'); if ($action == 'settitle') $object->title = trim(GETPOST('title', 'alpha')); - elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'alpha')); - elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'alpha')); - elseif ($action == 'setemail_errorsto') { - $object->email_errorsto = trim(GETPOST('email_errorsto', 'alpha')); - } elseif ($action == 'settitle' && empty($object->title)) { + elseif ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from', 'none')); // Must allow 'name ' + elseif ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto', 'none')); // Must allow 'name ' + elseif ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto', 'none')); // Must allow 'name ' + elseif ($action == 'settitle' && empty($object->title)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle")); } elseif ($action == 'setfrom' && empty($object->email_from)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailFrom")); @@ -708,10 +707,10 @@ if ($action == 'create') // Print mail form print load_fiche_titre($langs->trans("NewMailing"), $availablelink, 'object_email'); - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; - print ''; + print ''; print ''; print ''; @@ -742,7 +741,7 @@ if ($action == 'create') $doleditor->Create(); print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; @@ -776,7 +775,7 @@ if ($action == 'create') if ($action != 'edit' && $action != 'edithtml') { - dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); + print dol_get_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); /* * View mode mailing @@ -868,7 +867,11 @@ if ($action == 'create') if ($email && !isValidEmail($email)) { $langs->load("errors"); print img_warning($langs->trans("ErrorBadEMail", $email)); + } elseif ($email && !isValidMailDomain($email)) { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadMXDomain", $email)); } + print ''; // Errors to @@ -880,6 +883,9 @@ if ($action == 'create') if ($email && !isValidEmail($email)) { $langs->load("errors"); print img_warning($langs->trans("ErrorBadEMail", $email)); + } elseif ($email && !isValidMailDomain($email)) { + $langs->load("errors"); + print img_warning($langs->trans("ErrorBadMXDomain", $email)); } print ''; @@ -917,7 +923,7 @@ if ($action == 'create') print ""; - dol_fiche_end(); + print dol_get_fiche_end(); // Clone confirmation @@ -1027,7 +1033,7 @@ if ($action == 'create') print '
'; print load_fiche_titre($langs->trans("TestMailing")); - dol_fiche_head(null, '', '', -1); + print dol_get_fiche_head(null, '', '', -1); // Create mail form object include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -1058,7 +1064,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print dol_set_focus('#sendto'); } @@ -1074,7 +1080,7 @@ if ($action == 'create') // Print mail content print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'helpclickable', '', 0, 2, 'emailsubstitionhelp'), 'generic'); - dol_fiche_head('', '', '', -1); + print dol_get_fiche_head('', '', '', -1); print '
'.$langs->trans("MailTitle").'
'.$langs->trans("MailTitle").'
'.$langs->trans("MailFrom").'
'.$langs->trans("MailErrorsTo").'
'; @@ -1116,13 +1122,13 @@ if ($action == 'create') } else print dol_htmlentitiesbr($object->body); print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } else { /* * Edition mode mailing (CKeditor or HTML source) */ - dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); + print dol_get_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email'); $linkback = ''.$langs->trans("BackToList").''; @@ -1189,7 +1195,7 @@ if ($action == 'create') print '
'; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); @@ -1210,7 +1216,7 @@ if ($action == 'create') // Print mail content print load_fiche_titre($langs->trans("EMail"), $form->textwithpicto($langs->trans("AvailableVariables"), $htmltext, 1, 'help', '', 0, 2, 'emailsubstitionhelp'), 'generic'); - dol_fiche_head(null, '', '', -1); + print dol_get_fiche_head(null, '', '', -1); print ''; @@ -1283,7 +1289,7 @@ if ($action == 'create') print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index ff9bb98f639..7c219cc448a 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -213,7 +213,7 @@ if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); - dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); + print dol_get_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email'); $linkback = ''.$langs->trans("BackToList").''; @@ -305,7 +305,7 @@ if ($object->fetch($id) >= 0) print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index f82ebec9d6f..b5e115d8463 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -451,7 +451,7 @@ class AdvanceTargetingMailing extends CommonObject /** - * Save query in database to retreive it + * Save query in database to retrieve it * * @param User $user User that deletes * @param array $arrayquery All element to Query diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 070d46f6104..199a5caad8b 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -52,7 +52,7 @@ if ($object->fetch($id) >= 0) { $head = emailing_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); + print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email'); $linkback = ''.$langs->trans("BackToList").''; @@ -81,7 +81,7 @@ if ($object->fetch($id) >= 0) //print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index cd5d5c9ace9..bd4c16f89ca 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -80,7 +80,7 @@ if ($_socid > 0) print ''; print ''; - dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company'); + print dol_get_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company'); print ''; @@ -105,7 +105,7 @@ if ($_socid > 0) print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 48c2bbbaa62..dd84fbd651a 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -287,7 +287,7 @@ if (empty($reshook)) dol_print_error($db, $object->error); } elseif ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); + $result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); if ($result < 0) dol_print_error($db, $object->error); } // Positionne ref client @@ -806,7 +806,7 @@ if (empty($reshook)) $tva_tx = ''; } - $qty = GETPOST('qty'.$predef); + $qty = price2num(GETPOST('qty'.$predef), 'MS'); $remise_percent = GETPOST('remise_percent'.$predef); if (empty($remise_percent)) $remise_percent = 0; @@ -1229,7 +1229,10 @@ if (empty($reshook)) } } } - $result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, $_POST["units"], $pu_ht_devise); + + $qty = price2num(GETPOST('qty'), 'MS'); + + $result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, $_POST["units"], $pu_ht_devise); if ($result >= 0) { $db->commit(); @@ -1321,7 +1324,7 @@ if (empty($reshook)) if ($ret < 0) $error++; if (!$error) { - $result = $object->insertExtraFields('PROPAL_MODIFY'); + $result = $object->updateExtraField(GETPOST('attribute', 'restricthtml'), 'PROPAL_MODIFY', $user); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1484,7 +1487,7 @@ if ($action == 'create') print ''; } - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -1771,7 +1774,7 @@ if ($action == 'create') print '
'; } - dol_fiche_end(); + print dol_get_fiche_end(); $langs->load("bills"); print '
'; @@ -1805,7 +1808,7 @@ if ($action == 'create') $soc->fetch($object->socid); $head = propal_prepare_head($object); - dol_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal'); + print dol_get_fiche_head($head, 'comm', $langs->trans('Proposal'), -1, 'propal'); $formconfirm = ''; @@ -2382,7 +2385,7 @@ if ($action == 'create') print "\n"; - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a09844da014..7496f98a394 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -152,9 +152,9 @@ class Propal extends CommonObject public $datep; /** - * @var integer|string $date_livraison; + * @var integer|string $delivery_date; */ - public $date_livraison; + public $delivery_date; public $fin_validite; @@ -1562,7 +1562,7 @@ class Propal extends CommonObject $this->brouillon = 1; } - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -1634,6 +1634,7 @@ class Propal extends CommonObject $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; + $sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "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 .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").","; @@ -2059,18 +2060,32 @@ class Propal extends CommonObject } } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Set delivery date * * @param User $user Object user that modify - * @param int $date_livraison Delivery date + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <0 if ko, >0 if ok + * @deprecated Use setDeliveryDate + */ + public function set_date_livraison($user, $delivery_date, $notrigger = 0) + { + // phpcs:enable + return $this->setDeliveryDate($user, $delivery_date, $notrigger); + } + + /** + * Set delivery date + * + * @param User $user Object user that modify + * @param int $delivery_date Delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - public function set_date_livraison($user, $date_livraison, $notrigger = 0) + public function setDeliveryDate($user, $delivery_date, $notrigger = 0) { - // phpcs:enable if (!empty($user->rights->propal->creer)) { $error = 0; @@ -2078,7 +2093,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal "; - $sql .= " SET date_livraison = ".($date_livraison != '' ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date != '' ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2092,7 +2107,7 @@ class Propal extends CommonObject if (!$error) { $this->oldcopy = clone $this; - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; } if (!$notrigger && empty($error)) @@ -3227,16 +3242,16 @@ class Propal extends CommonObject { global $langs; $langs->load("propal"); - $this->labelStatus[0] = $langs->trans("PropalStatusDraft"); - $this->labelStatus[1] = $langs->trans("PropalStatusValidated"); - $this->labelStatus[2] = $langs->trans("PropalStatusSigned"); - $this->labelStatus[3] = $langs->trans("PropalStatusNotSigned"); - $this->labelStatus[4] = $langs->trans("PropalStatusBilled"); - $this->labelStatusShort[0] = $langs->trans("PropalStatusDraftShort"); - $this->labelStatusShort[1] = $langs->trans("PropalStatusValidatedShort"); - $this->labelStatusShort[2] = $langs->trans("PropalStatusSignedShort"); - $this->labelStatusShort[3] = $langs->trans("PropalStatusNotSignedShort"); - $this->labelStatusShort[4] = $langs->trans("PropalStatusBilledShort"); + $this->labelStatus[0] = $langs->transnoentitiesnoconv("PropalStatusDraft"); + $this->labelStatus[1] = $langs->transnoentitiesnoconv("PropalStatusValidated"); + $this->labelStatus[2] = $langs->transnoentitiesnoconv("PropalStatusSigned"); + $this->labelStatus[3] = $langs->transnoentitiesnoconv("PropalStatusNotSigned"); + $this->labelStatus[4] = $langs->transnoentitiesnoconv("PropalStatusBilled"); + $this->labelStatusShort[0] = $langs->transnoentitiesnoconv("PropalStatusDraftShort"); + $this->labelStatusShort[1] = $langs->transnoentitiesnoconv("PropalStatusValidatedShort"); + $this->labelStatusShort[2] = $langs->transnoentitiesnoconv("PropalStatusSignedShort"); + $this->labelStatusShort[3] = $langs->transnoentitiesnoconv("PropalStatusNotSignedShort"); + $this->labelStatusShort[4] = $langs->transnoentitiesnoconv("PropalStatusBilledShort"); } $statusType = ''; @@ -3290,8 +3305,8 @@ class Propal extends CommonObject if ($mode == 'opened') { $delay_warning = $conf->propal->cloture->warning_delay; $status = self::STATUS_VALIDATED; - $label = $langs->trans("PropalsToClose"); - $labelShort = $langs->trans("ToAcceptRefuse"); + $label = $langs->transnoentitiesnoconv("PropalsToClose"); + $labelShort = $langs->transnoentitiesnoconv("ToAcceptRefuse"); } if ($mode == 'signed') { $delay_warning = $conf->propal->facturation->warning_delay; diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 16be5930e89..9c491c7227c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -136,7 +136,7 @@ $formother = new FormOther($db); if ($object->id > 0) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal'); + print dol_get_fiche_head($head, 'contact', $langs->trans("Proposal"), -1, 'propal'); // Proposal card @@ -188,7 +188,7 @@ if ($object->id > 0) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); // Contacts lines (modules that overwrite templates must declare this into descriptor) diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 70c67566091..309c2a44ad4 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -97,7 +97,7 @@ if ($object->id > 0) $upload_dir = $conf->propal->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $head = propal_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal'); + print dol_get_fiche_head($head, 'document', $langs->trans('Proposal'), -1, 'propal'); // Build file list $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); @@ -172,7 +172,7 @@ if ($object->id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'propal'; $permission = $user->rights->propal->creer; diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index 3bf82b4f728..e56a5129c5c 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -63,7 +63,7 @@ llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition $object->fetch_thirdparty(); $head = propal_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans('Proposal'), -1, 'propal'); +print dol_get_fiche_head($head, 'info', $langs->trans('Proposal'), -1, 'propal'); $object->info($object->id); @@ -126,7 +126,7 @@ dol_print_object_info($object); print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index ef35903fcd0..80b991a2526 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -76,7 +76,7 @@ if ($id > 0 || !empty($ref)) if ($object->fetch_thirdparty() > 0) { $head = propal_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans('Proposal'), -1, 'propal'); + print dol_get_fiche_head($head, 'note', $langs->trans('Proposal'), -1, 'propal'); $cssclass = 'titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; @@ -140,7 +140,7 @@ if ($id > 0 || !empty($ref)) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } } } diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index a59896c8ab6..e439056de5f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -240,7 +240,7 @@ $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'propal_stats'); -dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); +print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; @@ -355,7 +355,7 @@ print '
'; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index e393f5fce56..6302b7680ab 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -56,7 +56,7 @@ if ($socid > 0) */ $head = societe_prepare_head($societe); - dol_fiche_head($head, 'prospect', $langs->trans("ThirdParty"), 0, 'company'); + print dol_get_fiche_head($head, 'prospect', $langs->trans("ThirdParty"), 0, 'company'); print "\n"; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 284c248f1f0..9ac8062c156 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -56,7 +56,7 @@ if ($socid > 0) */ $head = societe_prepare_head($societe); - dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); + print dol_get_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); print "
\n"; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index cab1a311dbb..21f06e7bc1d 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -110,7 +110,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), -1, 'company'); + print dol_get_fiche_head($head, 'relativediscount', $langs->trans("ThirdParty"), -1, 'company'); dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -121,7 +121,7 @@ if ($socid > 0) if (!$isCustomer && !$isSupplier) { print '

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

'; - dol_fiche_end(); + print dol_get_fiche_end(); print ''; @@ -189,7 +189,7 @@ if ($socid > 0) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 16a7d362ba6..922e384af4d 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -250,7 +250,7 @@ if ($socid > 0) print ''; print ''; - dol_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), -1, 'company'); + print dol_get_fiche_head($head, 'absolutediscount', $langs->trans("ThirdParty"), -1, 'company'); dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom'); @@ -261,7 +261,7 @@ if ($socid > 0) if (!$isCustomer && !$isSupplier) { print '

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

'; - dol_fiche_end(); + print dol_get_fiche_end(); print ''; @@ -336,7 +336,7 @@ if ($socid > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); if ($user->rights->societe->creer) @@ -354,7 +354,7 @@ if ($socid > 0) print ''; } - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; if ($isCustomer && $isSupplier) { @@ -375,7 +375,7 @@ if ($socid > 0) print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); } if ($user->rights->societe->creer) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 3ee5b89e01a..eb93a125fb5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -541,7 +541,7 @@ if (empty($reshook)) $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->setDeliveryDate($user, $datedelivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1556,7 +1556,7 @@ if ($action == 'create' && $usercancreate) print ''; if (!empty($currency_tx)) print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print ''; @@ -1828,7 +1828,7 @@ if ($action == 'create' && $usercancreate) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); // Button "Create Draft" print '
'; @@ -1867,7 +1867,7 @@ if ($action == 'create' && $usercancreate) $res = $object->fetch_optionals(); $head = commande_prepare_head($object); - dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); + print dol_get_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); $formconfirm = ''; @@ -2474,7 +2474,7 @@ if ($action == 'create' && $usercancreate) print "\n"; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Buttons for actions @@ -2556,7 +2556,7 @@ if ($action == 'create' && $usercancreate) $numshipping = $object->nb_expedition(); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { - if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) { + if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { if ($user->rights->expedition->creer) { print ''.$langs->trans('CreateShipment').''; } else { @@ -2573,7 +2573,6 @@ if ($action == 'create' && $usercancreate) if (($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) { print ''; } - // Create bill and Classify billed // Note: Even if module invoice is not enabled, we should be able to use button "Classified billed" if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 70df565cd2b..fdc9ddaf646 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -180,7 +180,7 @@ class Commande extends CommonOrder */ public $date_commande; - public $date_livraison; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) /** * @var int ID @@ -478,7 +478,7 @@ class Commande extends CommonOrder $sql .= " fk_user_valid = ".$user->id; $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::valid()", LOG_DEBUG); + dol_syslog(get_class($this)."::valid", LOG_DEBUG); $resql = $this->db->query($sql); if (!$resql) { @@ -544,7 +544,7 @@ class Commande extends CommonOrder $dirdest = $conf->commande->multidir_output[$this->entity].'/'.$newref; if (!$error && file_exists($dirsource)) { - dol_syslog(get_class($this)."::valid() rename dir ".$dirsource." into ".$dirdest); + dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest); if (@rename($dirsource, $dirdest)) { @@ -745,6 +745,10 @@ class Commande extends CommonOrder if ($usercanclose) { $this->db->begin(); + if ($this->statut == self::STATUS_CLOSED) + { + return 0; + } $now = dol_now(); @@ -1885,7 +1889,7 @@ class Commande extends CommonOrder if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -2544,17 +2548,31 @@ class Commande extends CommonOrder } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Set delivery date + * + * @param User $user Object user that modify + * @param int $delivery_date Delivery date + * @param int $notrigger 1=Does not execute triggers, 0= execute triggers + * @return int <0 if ko, >0 if ok + * @deprecated Use setDeliveryDate + */ + public function set_date_livraison($user, $delivery_date, $notrigger = 0) + { + // phpcs:enable + return $this->setDeliveryDate($user, $delivery_date, $notrigger); + } + /** * Set the planned delivery date * * @param User $user Objet utilisateur qui modifie - * @param int $date_livraison Date de livraison + * @param int $delivery_date Delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - public function set_date_livraison($user, $date_livraison, $notrigger = 0) + public function setDeliveryDate($user, $delivery_date, $notrigger = 0) { - // phpcs:enable if ($user->rights->commande->creer) { $error = 0; @@ -2562,7 +2580,7 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; - $sql .= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2576,7 +2594,7 @@ class Commande extends CommonOrder if (!$error) { $this->oldcopy = clone $this; - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; } if (!$notrigger && empty($error)) @@ -2882,6 +2900,10 @@ class Commande extends CommonOrder $error = 0; $this->db->begin(); + if ($this->billed) + { + return 0; + } $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; @@ -3529,41 +3551,41 @@ class Commande extends CommonOrder global $langs, $conf; $billedtext = ''; - if (empty($donotshowbilled)) $billedtext .= ($billed ? ' - '.$langs->trans("Billed") : ''); + if (empty($donotshowbilled)) $billedtext .= ($billed ? ' - '.$langs->transnoentitiesnoconv("Billed") : ''); $labelTooltip = ''; if ($status == self::STATUS_CANCELED) { - $labelStatus = $langs->trans('StatusOrderCanceled'); - $labelStatusShort = $langs->trans('StatusOrderCanceledShort'); + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderCanceled'); + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderCanceledShort'); $statusType = 'status9'; } elseif ($status == self::STATUS_DRAFT) { - $labelStatus = $langs->trans('StatusOrderDraft'); - $labelStatusShort = $langs->trans('StatusOrderDraftShort'); + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderDraft'); + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderDraftShort'); $statusType = 'status0'; } elseif ($status == self::STATUS_VALIDATED) { - $labelStatus = $langs->trans('StatusOrderValidated').$billedtext; - $labelStatusShort = $langs->trans('StatusOrderValidatedShort').$billedtext; + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderValidated').$billedtext; + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderValidatedShort').$billedtext; $statusType = 'status1'; } elseif ($status == self::STATUS_SHIPMENTONPROCESS) { - $labelStatus = $langs->trans('StatusOrderSent').$billedtext; - $labelStatusShort = $langs->trans('StatusOrderSentShort').$billedtext; - $labelTooltip = $langs->trans("StatusOrderSent").' - '.$langs->trans("DateDeliveryPlanned").dol_print_date($this->date_livraison).$billedtext; + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderSent').$billedtext; + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderSentShort').$billedtext; + $labelTooltip = $langs->transnoentitiesnoconv("StatusOrderSent").' - '.$langs->transnoentitiesnoconv("DateDeliveryPlanned").dol_print_date($this->date_livraison).$billedtext; $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && (!$billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { - $labelStatus = $langs->trans('StatusOrderToBill'); - $labelStatusShort = $langs->trans('StatusOrderToBillShort'); + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderToBill'); + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderToBillShort'); $statusType = 'status4'; } elseif ($status == self::STATUS_CLOSED && ($billed && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { - $labelStatus = $langs->trans('StatusOrderProcessed').$billedtext; - $labelStatusShort = $langs->trans('StatusOrderProcessedShort').$billedtext; + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderProcessed').$billedtext; + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderProcessedShort').$billedtext; $statusType = 'status6'; } elseif ($status == self::STATUS_CLOSED && (!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) { - $labelStatus = $langs->trans('StatusOrderDelivered'); - $labelStatusShort = $langs->trans('StatusOrderDeliveredShort'); + $labelStatus = $langs->transnoentitiesnoconv('StatusOrderDelivered'); + $labelStatusShort = $langs->transnoentitiesnoconv('StatusOrderDeliveredShort'); $statusType = 'status6'; } else { - $labelStatus = $langs->trans('Unknown'); + $labelStatus = $langs->transnoentitiesnoconv('Unknown'); $labelStatusShort = ''; $statusType = ''; $mode = 0; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 2a1042c4347..84c4eb5626a 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) $object->fetch_thirdparty(); $head = commande_prepare_head($object); - dol_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); + print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); // Order card @@ -188,7 +188,7 @@ if ($id > 0 || !empty($ref)) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index ab4f3990b78..c3afff9e00d 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) $upload_dir = $conf->commande->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $head = commande_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), -1, 'order'); + print dol_get_fiche_head($head, 'documents', $langs->trans('CustomerOrder'), -1, 'order'); // Build file list $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); @@ -175,7 +175,7 @@ if ($id > 0 || !empty($ref)) print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'commande'; $permission = $user->rights->commande->creer; diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index d08e8148101..dd31e547569 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -65,7 +65,7 @@ $object->fetch_thirdparty(); $object->info($object->id); $head = commande_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order'); +print dol_get_fiche_head($head, 'info', $langs->trans("CustomerOrder"), -1, 'order'); // Order card @@ -127,7 +127,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 9922d3b0e3e..c996aea7601 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -77,7 +77,7 @@ if ($id > 0 || !empty($ref)) $head = commande_prepare_head($object); - dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order'); + print dol_get_fiche_head($head, 'note', $langs->trans("CustomerOrder"), -1, 'order'); // Order card @@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 2b2402fd9de..1da32f13e80 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -249,7 +249,7 @@ if ($mode == 'supplier') $type = 'supplier_order_stats'; complete_head_from_modules($conf, $langs, null, $head, $h, $type); -dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); +print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; @@ -388,7 +388,7 @@ print ''; print '
'; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 020b85bf06c..ac31d091833 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -519,7 +519,7 @@ $head[$h][0] = $_SERVER["PHP_SELF"]; $head[$h][1] = $langs->trans("AccountantFiles"); $head[$h][2] = 'AccountancyFiles'; -dol_fiche_head($head, 'AccountancyFiles'); +print dol_get_fiche_head($head, 'AccountancyFiles'); print '
'."\n"; @@ -567,7 +567,7 @@ print ' 0 || !empty($ref)) { // Onglets $head = account_statement_prepare_head($object, $numref); - dol_fiche_head($head, 'document', $langs->trans("AccountStatement"), -1, 'account'); + print dol_get_fiche_head($head, 'document', $langs->trans("AccountStatement"), -1, 'account'); // Build file list @@ -182,7 +182,7 @@ if ($id > 0 || !empty($ref)) { print ''; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'bank'; diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index cd82da0e1bd..f190ddb1471 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -138,7 +138,7 @@ if ($resql) // Onglets $head = bank_prepare_head($object); -dol_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account'); +print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account'); $title = $langs->trans("FinancialAccount")." : ".$object->label; $link = ($year_start ? "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"')."" : ""); @@ -166,7 +166,7 @@ if (!empty($id)) print $langs->trans("AllAccounts"); } -dol_fiche_end(); +print dol_get_fiche_end(); // Affiche tableau diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 0558f097121..5d0df32cd3e 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -430,13 +430,13 @@ if ($id > 0 || !empty($ref)) // Bank card $head = bank_prepare_head($object); - dol_fiche_head($head, 'journal', $langs->trans("FinancialAccount"), 0, 'account'); + print dol_get_fiche_head($head, 'journal', $langs->trans("FinancialAccount"), 0, 'account'); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); /* @@ -774,7 +774,7 @@ if ($resql) { if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) { - if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments + if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // Default is to record miscellaneous direct entries using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); } else // If direct entries is not done using miscellaneous payments diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index bac2f974def..8b086516351 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -331,7 +331,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print ''; @@ -544,7 +544,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -574,7 +574,7 @@ if ($action == 'create') // Show tabs $head = bank_prepare_head($object); - dol_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account'); + print dol_get_fiche_head($head, 'bankname', $langs->trans("FinancialAccount"), -1, 'account'); $formconfirm = ''; @@ -752,7 +752,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Barre d'actions @@ -810,7 +810,7 @@ if ($action == 'create') print ''; print ''."\n\n"; - dol_fiche_head(array(), 0, '', 0); + print dol_get_fiche_head(array(), 0, '', 0); //print '
'; @@ -1028,7 +1028,7 @@ if ($action == 'create') print ''; } - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index dffd62dc5a3..9e40a39c676 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -984,7 +984,7 @@ class Account extends CommonObject $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_update = $this->db->jdate($obj->date_update); - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 2bd95409827..896b91545db 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -96,7 +96,7 @@ if ($id > 0 || !empty($ref)) { // Onglets $head = bank_prepare_head($object); - dol_fiche_head($head, 'document', $langs->trans("FinancialAccount"), -1, 'account'); + print dol_get_fiche_head($head, 'document', $langs->trans("FinancialAccount"), -1, 'account'); // Build file list @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'bank'; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 686122f4d56..9350e211284 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -727,7 +727,7 @@ if ($result < 0) // Onglets $head = bank_prepare_head($object); -dol_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0, 'account'); +print dol_get_fiche_head($head, 'graph', $langs->trans("FinancialAccount"), 0, 'account'); $linkback = ''.$langs->trans("BackToList").''; @@ -762,7 +762,7 @@ if ($account) print $langs->trans("AllAccounts"); } -dol_fiche_end(); +print dol_get_fiche_end(); print ''; diff --git a/htdocs/compta/bank/info.php b/htdocs/compta/bank/info.php index e1adb0b5e41..a2a3260775a 100644 --- a/htdocs/compta/bank/info.php +++ b/htdocs/compta/bank/info.php @@ -55,7 +55,7 @@ $hselected = $h; $h++; -dol_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'accountline'); +print dol_get_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'accountline'); $linkback = ''.$langs->trans("BackToList").''; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 4e2998792d8..7ae7c995935 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -288,7 +288,7 @@ if ($result) print ''; print ''; - dol_fiche_head($head, 'bankline', $langs->trans('LineRecord'), 0, 'accountline', 0); + print dol_get_fiche_head($head, 'bankline', $langs->trans('LineRecord'), 0, 'accountline', 0); $linkback = ''.$langs->trans("BackToList").''; @@ -566,7 +566,7 @@ if ($result) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); print '

'; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index ba5e20c11c1..166d69fdd30 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -243,7 +243,7 @@ if (empty($numref)) // Onglets $head = bank_prepare_head($object); - dol_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), 0, 'account'); + print dol_get_fiche_head($head, 'statement', $langs->trans("FinancialAccount"), 0, 'account'); $linkback = ''.$langs->trans("BackToList").''; @@ -251,7 +251,7 @@ if (empty($numref)) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; @@ -361,7 +361,7 @@ if (empty($numref)) // Onglets $head = account_statement_prepare_head($object, $numref); - dol_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); + print dol_get_fiche_head($head, 'statement', $langs->trans("AccountStatement"), -1, 'account'); $morehtmlright = ''; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index cf494b77a90..03844897a15 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -90,13 +90,13 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) // Onglets $head = bank_prepare_head($object); - dol_fiche_head($head, 'cash', $langs->trans("FinancialAccount"), 0, 'account'); + print dol_get_fiche_head($head, 'cash', $langs->trans("FinancialAccount"), 0, 'account'); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 56843c9032f..8a7f5415339 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -330,7 +330,7 @@ if ($action == 'create') print load_fiche_titre($langs->trans("NewVariousPayment"), '', 'object_payment'); - dol_fiche_head('', ''); + print dol_get_fiche_head('', ''); print '
'; @@ -370,7 +370,7 @@ if ($action == 'create') { print ''; } @@ -454,7 +454,7 @@ if ($action == 'create') print '
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; - $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant + $form->select_comptes($accountid, "accountid", 0, '', 2); // Affiche liste des comptes courant print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -491,7 +491,7 @@ if ($id) print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneVariousPayment', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 300); } - dol_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto); + print dol_get_fiche_head($head, 'card', $langs->trans("VariousPayment"), -1, $object->picto); $morehtmlref = '
'; // Project @@ -603,7 +603,7 @@ if ($id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index 744daa939d5..14187bf51e3 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -83,7 +83,7 @@ if ($object->id) { $head = various_payment_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("VariousPayment"), -1, $object->picto); + print dol_get_fiche_head($head, 'documents', $langs->trans("VariousPayment"), -1, $object->picto); $morehtmlref = '
'; // Project @@ -143,7 +143,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'banque'; $permission = $user->rights->banque->modifier; diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index 05a7d28c8c8..5d401ede3c1 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -50,7 +50,7 @@ $object->info($id); $head = various_payment_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $object->picto); +print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $object->picto); $morehtmlref = '
'; diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index b14b77d5264..96299886070 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -28,6 +28,7 @@ */ require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'; @@ -594,7 +595,7 @@ if (empty($action) || $action == "view" || $action == "close") $head[0][1] = $langs->trans("CashControl"); $head[0][2] = 'cashcontrol'; - dol_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account'); + print dol_get_fiche_head($head, 'cashcontrol', $langs->trans("CashControl"), -1, 'account'); $linkback = ''.$langs->trans("BackToList").''; @@ -659,7 +660,7 @@ if (empty($action) || $action == "view" || $action == "close") print '
'; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); if ($action != 'close') { print '
'; diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 02299788794..5df55ab7849 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2016 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Vinícius Nogueira * Copyright (C) 2014 Florian Henry @@ -29,13 +29,16 @@ * \brief List of bank transactions */ +if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification + 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'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php'; -$langs->load("bills"); +$langs->loadLangs(array("bills", "banks")); $id = GETPOST('id', 'int'); @@ -127,8 +130,9 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; + print "\n"; print "

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

"; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index fcd7c542eb2..00b5c3dc025 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -291,7 +291,7 @@ if ($action == 'create') { $head = trip_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); + print dol_get_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); if ($action == 'edit' && $user->rights->deplacement->creer) { diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 47b1709ff60..4768e082431 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -89,7 +89,7 @@ if ($object->id) $head = trip_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip'); + print dol_get_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip'); // Build file list diff --git a/htdocs/compta/deplacement/info.php b/htdocs/compta/deplacement/info.php index a63494451cf..08c3ca768ee 100644 --- a/htdocs/compta/deplacement/info.php +++ b/htdocs/compta/deplacement/info.php @@ -50,7 +50,7 @@ if ($id) $head = trip_prepare_head($object); - dol_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip'); + print dol_get_fiche_head($head, 'info', $langs->trans("TripCard"), 0, 'trip'); print '
'; dol_print_object_info($object); diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 7707cb40786..e9a2a3a93a7 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -217,7 +217,7 @@ $h++; complete_head_from_modules($conf, $langs, null, $head, $h, 'trip_stats'); -dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); +print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; @@ -306,7 +306,7 @@ print '
'; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/compta/facture/admin/facture_cust_extrafields.php b/htdocs/compta/facture/admin/facture_cust_extrafields.php index df5cb39f9e4..54234b4a10c 100644 --- a/htdocs/compta/facture/admin/facture_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_cust_extrafields.php @@ -69,11 +69,11 @@ print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Invoices"), -1, 'invoice'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php index a8d073958ad..3f85d7ba074 100644 --- a/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facture_rec_cust_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); -dol_fiche_head($head, 'attributesrec', $langs->trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'attributesrec', $langs->trans("Invoices"), -1, 'invoice'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php index ebe2a437a92..5b1daff5913 100644 --- a/htdocs/compta/facture/admin/facturedet_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_cust_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), -1, 'invoice'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php index a09b0380f59..539fb89e675 100644 --- a/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php +++ b/htdocs/compta/facture/admin/facturedet_rec_cust_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); -dol_fiche_head($head, 'attributeslinesrec', $langs->trans("Invoices"), -1, 'invoice'); +print dol_get_fiche_head($head, 'attributeslinesrec', $langs->trans("Invoices"), -1, 'invoice'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 3ab212a62bd..0d483665e40 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -945,7 +945,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(null, '', '', 0); + print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; if (!empty($conf->projet->enabled)) $rowspan++; @@ -1056,14 +1056,14 @@ if ($action == 'create') print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); // Autogeneration $title = $langs->trans("Recurrence"); print load_fiche_titre(' '.$title, '', ''); - dol_fiche_head(null, '', '', 0); + print dol_get_fiche_head(null, '', '', 0); print ''; @@ -1102,7 +1102,7 @@ if ($action == 'create') print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); $title = $langs->trans("ProductsAndServices"); @@ -1176,7 +1176,7 @@ if ($action == 'create') $head = invoice_rec_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("RepeatableInvoice"), -1, 'bill'); // Add a div + print dol_get_fiche_head($head, 'card', $langs->trans("RepeatableInvoice"), -1, 'bill'); // Add a div // Recurring invoice content @@ -1641,7 +1641,7 @@ if ($action == 'create') print "\n"; - dol_fiche_end(); + print dol_get_fiche_end(); /** diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8a2b5b150e4..74947b7c591 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -414,16 +414,35 @@ if (empty($reshook)) $object->fetch($id); $object->cond_reglement_code = 0; // To clean property $object->cond_reglement_id = 0; // To clean property - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); - if ($result < 0) dol_print_error($db, $object->error); - $old_date_lim_reglement = $object->date_lim_reglement; - $new_date_lim_reglement = $object->calculate_date_lim_reglement(); - if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement; - if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date; - $result = $object->update($user); - if ($result < 0) { - dol_print_error($db, $object->error); + $error = 0; + + $db->begin(); + + if (! $error) { + $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + if (! $error) { + $old_date_lim_reglement = $object->date_lim_reglement; + $new_date_lim_reglement = $object->calculate_date_lim_reglement(); + if ($new_date_lim_reglement > $old_date_lim_reglement) $object->date_lim_reglement = $new_date_lim_reglement; + if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement = $object->date; + $result = $object->update($user); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + + if ($error) { + $db->rollback(); + } else { + $db->commit(); } } elseif ($action == 'setpaymentterm' && $usercancreate) { @@ -952,6 +971,7 @@ if (empty($reshook)) elseif ($action == 'add' && $usercancreate) { if ($socid > 0) $object->socid = GETPOST('socid', 'int'); + $selectedLines = GETPOST('toselect', 'array'); $db->begin(); @@ -1552,8 +1572,11 @@ if (empty($reshook)) $fk_parent_line = 0; $num = count($lines); + for ($i = 0; $i < $num; $i++) { + if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + // Don't add lines with qty 0 when coming from a shipment including all order lines if ($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue; // Don't add closed lines when coming from a contract (Set constant to '0,5' to exclude also inactive lines) @@ -2879,7 +2902,7 @@ if ($action == 'create') print ''; if (!empty($currency_tx)) print ''; - dol_fiche_head(''); + print dol_get_fiche_head(''); print ''; @@ -3382,7 +3405,7 @@ if ($action == 'create') } }); - $("[name=\'type\']").trigger("change"); + $("[name=\'type\']:checked").trigger("change"); }); '; } @@ -3595,7 +3618,7 @@ if ($action == 'create') print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); // Button "Create Draft" print '
'; @@ -3604,8 +3627,6 @@ if ($action == 'create') print ''; print '
'; - print "\n"; - // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { print '
'; @@ -3615,12 +3636,12 @@ if ($action == 'create') print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } - print '
'; + print ''; } elseif ($id > 0 || !empty($ref)) { /* @@ -3687,7 +3708,7 @@ if ($action == 'create') $head = facture_prepare_head($object); - dol_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), -1, 'bill'); + print dol_get_fiche_head($head, 'compta', $langs->trans('InvoiceCustomer'), -1, 'bill'); $formconfirm = ''; @@ -5009,7 +5030,7 @@ if ($action == 'create') print "\n"; - dol_fiche_end(); + print dol_get_fiche_end(); // Actions buttons diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index d1a6abcdec3..5771ead70f1 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -97,7 +97,7 @@ class FactureRec extends CommonInvoice */ public $frequency; - /** + /** * @var string Unit frequency */ public $unit_frequency; @@ -317,46 +317,46 @@ class FactureRec extends CommonInvoice $tva_tx = $facsrc->lines[$i]->tva_tx; if (!empty($facsrc->lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$facsrc->lines[$i]->vat_src_code.')'; - $result_insert = $this->addline( - $facsrc->lines[$i]->desc, - $facsrc->lines[$i]->subprice, - $facsrc->lines[$i]->qty, + $result_insert = $this->addline( + $facsrc->lines[$i]->desc, + $facsrc->lines[$i]->subprice, + $facsrc->lines[$i]->qty, $tva_tx, - $facsrc->lines[$i]->localtax1_tx, - $facsrc->lines[$i]->localtax2_tx, - $facsrc->lines[$i]->fk_product, - $facsrc->lines[$i]->remise_percent, - 'HT', + $facsrc->lines[$i]->localtax1_tx, + $facsrc->lines[$i]->localtax2_tx, + $facsrc->lines[$i]->fk_product, + $facsrc->lines[$i]->remise_percent, + 'HT', $facsrc->lines[$i]->info_bits, - '', - 0, - $facsrc->lines[$i]->product_type, - $facsrc->lines[$i]->rang, - $facsrc->lines[$i]->special_code, - $facsrc->lines[$i]->label, + '', + 0, + $facsrc->lines[$i]->product_type, + $facsrc->lines[$i]->rang, + $facsrc->lines[$i]->special_code, + $facsrc->lines[$i]->label, $facsrc->lines[$i]->fk_unit, $facsrc->lines[$i]->multicurrency_subprice - ); + ); if ($result_insert < 0) { $error++; } else { - $objectline = new FactureLigneRec($this->db); - if ($objectline->fetch($result_insert)) - { - // Extrafields - if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { - $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); - $objectline->array_options = $facsrc->lines[$i]->array_options; - } + $objectline = new FactureLigneRec($this->db); + if ($objectline->fetch($result_insert)) + { + // Extrafields + if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { + $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); + $objectline->array_options = $facsrc->lines[$i]->array_options; + } - $result = $objectline->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + $result = $objectline->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } } } @@ -370,27 +370,27 @@ class FactureRec extends CommonInvoice { foreach ($this->linked_objects as $origin => $tmp_origin_id) { - if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...)) - { - foreach ($tmp_origin_id as $origin_id) - { - $ret = $this->add_object_linked($origin, $origin_id); - if (!$ret) - { - $this->error = $this->db->lasterror(); - $error++; - } - } - } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) - { - $origin_id = $tmp_origin_id; - $ret = $this->add_object_linked($origin, $origin_id); - if (!$ret) - { - $this->error = $this->db->lasterror(); - $error++; - } - } + if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...)) + { + foreach ($tmp_origin_id as $origin_id) + { + $ret = $this->add_object_linked($origin, $origin_id); + if (!$ret) + { + $this->error = $this->db->lasterror(); + $error++; + } + } + } else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + { + $origin_id = $tmp_origin_id; + $ret = $this->add_object_linked($origin, $origin_id); + if (!$ret) + { + $this->error = $this->db->lasterror(); + $error++; + } + } } } @@ -422,7 +422,7 @@ class FactureRec extends CommonInvoice return $this->id; } } else { - $this->error = $this->db->lasterror(); + $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } @@ -442,46 +442,46 @@ class FactureRec extends CommonInvoice */ public function update(User $user, $notrigger = 0) { - global $conf; + global $conf; - $error = 0; + $error = 0; - $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; - $sql .= " fk_soc = ".$this->fk_soc; - // TODO Add missing fields - $sql .= " WHERE rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; + $sql .= " fk_soc = ".$this->fk_soc; + // TODO Add missing fields + $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - if (!$error) - { - $result = $this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + if (!$error) + { + $result = $this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } - if (!$error && !$notrigger) - { - // Call trigger - $result = $this->call_trigger('BILLREC_UPDATE', $user); - if ($result < 0) - { - $this->db->rollback(); - return -2; - } - // End call triggers - } - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return -2; - } + if (!$error && !$notrigger) + { + // Call trigger + $result = $this->call_trigger('BILLREC_UPDATE', $user); + if ($result < 0) + { + $this->db->rollback(); + return -2; + } + // End call triggers + } + $this->db->commit(); + return 1; + } else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -2; + } } /** @@ -498,13 +498,13 @@ class FactureRec extends CommonInvoice $sql .= ', f.remise_percent, f.remise_absolue, f.remise'; $sql .= ', f.date_lim_reglement as dlr'; $sql .= ', f.note_private, f.note_public, f.fk_user_author'; - $sql .= ', f.modelpdf'; + $sql .= ', f.modelpdf'; $sql .= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet as fk_project'; $sql .= ', f.fk_account'; $sql .= ', f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.usenewprice, f.auto_validate'; - $sql .= ', f.generate_pdf'; - $sql .= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; - $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; + $sql .= ', f.generate_pdf'; + $sql .= ", f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc"; + $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; //$sql.= ', el.fk_source'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_rec as f'; @@ -585,7 +585,7 @@ class FactureRec extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -618,24 +618,24 @@ class FactureRec extends CommonInvoice */ public function getLinesArray() { - return $this->fetch_lines(); + return $this->fetch_lines(); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Get lines of template invoices into this->lines * * @return int 1 if OK, < 0 if KO - */ + */ public function fetch_lines() { global $extrafields; - // phpcs:enable + // phpcs:enable $this->lines = array(); - // Retreive all extrafield for line + // Retrieve all extrafield for line // fetch optionals attributes and labels if (!is_object($extrafields)) { @@ -710,7 +710,7 @@ class FactureRec extends CommonInvoice $line->rang = $objp->rang; $line->special_code = $objp->special_code; $line->fk_unit = $objp->fk_unit; - $line->fk_contract_line = $objp->fk_contract_line; + $line->fk_contract_line = $objp->fk_contract_line; // Ne plus utiliser $line->price = $objp->price; @@ -750,17 +750,17 @@ class FactureRec extends CommonInvoice */ public function delete(User $user, $notrigger = 0, $idwarehouse = -1) { - $rowid = $this->id; + $rowid = $this->id; - dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); + dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG); - $error = 0; + $error = 0; $this->db->begin(); $main = MAIN_DB_PREFIX.'facturedet_rec'; - $ef = $main."_extrafields"; - $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)"; - dol_syslog($sqlef); + $ef = $main."_extrafields"; + $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture = $rowid)"; + dol_syslog($sqlef); $sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid; dol_syslog($sql); if ($this->db->query($sqlef) && $this->db->query($sql)) @@ -773,8 +773,8 @@ class FactureRec extends CommonInvoice $res = $this->deleteObjectLinked(); if ($res < 0) $error = -3; // Delete extrafields - $res = $this->deleteExtraFields(); - if ($res < 0) $error = -4; + $res = $this->deleteExtraFields(); + if ($res < 0) $error = -4; } else { $this->error = $this->db->lasterror(); $error = -1; @@ -786,11 +786,11 @@ class FactureRec extends CommonInvoice if (!$error) { - $this->db->commit(); - return 1; + $this->db->commit(); + return 1; } else { - $this->db->rollback(); - return $error; + $this->db->rollback(); + return $error; } } @@ -798,33 +798,33 @@ class FactureRec extends CommonInvoice /** * Add a line to invoice * - * @param string $desc Description de la ligne - * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) - * @param double $qty Quantite - * @param double $txtva Taux de tva force, sinon -1 + * @param string $desc Description de la ligne + * @param double $pu_ht Prix unitaire HT (> 0 even for credit note) + * @param double $qty Quantite + * @param double $txtva Taux de tva force, sinon -1 * @param double $txlocaltax1 Local tax 1 rate (deprecated) * @param double $txlocaltax2 Local tax 2 rate (deprecated) - * @param int $fk_product Product/Service ID predefined - * @param double $remise_percent Percentage discount of the line - * @param string $price_base_type HT or TTC - * @param int $info_bits VAT npr or not ? - * @param int $fk_remise_except Id remise - * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) - * @param int $type Type of line (0=product, 1=service) - * @param int $rang Position of line - * @param int $special_code Special code - * @param string $label Label of the line - * @param string $fk_unit Unit + * @param int $fk_product Product/Service ID predefined + * @param double $remise_percent Percentage discount of the line + * @param string $price_base_type HT or TTC + * @param int $info_bits VAT npr or not ? + * @param int $fk_remise_except Id remise + * @param double $pu_ttc Prix unitaire TTC (> 0 even for credit note) + * @param int $type Type of line (0=product, 1=service) + * @param int $rang Position of line + * @param int $special_code Special code + * @param string $label Label of the line + * @param string $fk_unit Unit * @param double $pu_ht_devise Unit price in currency * @param int $date_start_fill 1=Flag to fill start date when generating invoice * @param int $date_end_fill 1=Flag to fill end date when generating invoice * @param int $fk_fournprice Supplier price id (to calculate margin) or '' * @param int $pa_ht Buying price of line (to calculate margin) or '' - * @return int <0 if KO, Id of line if OK + * @return int <0 if KO, Id of line if OK */ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0) { - global $mysoc; + global $mysoc; $facid = $this->id; @@ -1008,131 +1008,131 @@ class FactureRec extends CommonInvoice */ public function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $rang = -1, $special_code = 0, $label = '', $fk_unit = null, $pu_ht_devise = 0, $notrigger = 0, $date_start_fill = 0, $date_end_fill = 0, $fk_fournprice = null, $pa_ht = 0) { - global $mysoc; + global $mysoc; - $facid = $this->id; + $facid = $this->id; - dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, type=$type, fk_unit=$fk_unit, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, type=$type, fk_unit=$fk_unit, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - // Clean parameters - if (empty($remise_percent)) $remise_percent = 0; + // Clean parameters + if (empty($remise_percent)) $remise_percent = 0; - // Check parameters - if ($type < 0) return -1; + // Check parameters + if ($type < 0) return -1; - if ($this->brouillon) - { - // Clean parameters - $remise_percent = price2num($remise_percent); - $qty = price2num($qty); - if (empty($info_bits)) $info_bits = 0; - $pu_ht = price2num($pu_ht); - $pu_ttc = price2num($pu_ttc); - $pu_ht_devise = price2num($pu_ht_devise); - $txtva = price2num($txtva); - $txlocaltax1 = price2num($txlocaltax1); - $txlocaltax2 = price2num($txlocaltax2); - if (empty($txlocaltax1)) $txlocaltax1 = 0; - if (empty($txlocaltax2)) $txlocaltax2 = 0; + if ($this->brouillon) + { + // Clean parameters + $remise_percent = price2num($remise_percent); + $qty = price2num($qty); + if (empty($info_bits)) $info_bits = 0; + $pu_ht = price2num($pu_ht); + $pu_ttc = price2num($pu_ttc); + $pu_ht_devise = price2num($pu_ht_devise); + $txtva = price2num($txtva); + $txlocaltax1 = price2num($txlocaltax1); + $txlocaltax2 = price2num($txlocaltax2); + if (empty($txlocaltax1)) $txlocaltax1 = 0; + if (empty($txlocaltax2)) $txlocaltax2 = 0; - if (empty($this->multicurrency_subprice)) $this->multicurrency_subprice = 0; - if (empty($this->multicurrency_total_ht)) $this->multicurrency_total_ht = 0; - if (empty($this->multicurrency_total_tva)) $this->multicurrency_total_tva = 0; - if (empty($this->multicurrency_total_ttc)) $this->multicurrency_total_ttc = 0; + if (empty($this->multicurrency_subprice)) $this->multicurrency_subprice = 0; + if (empty($this->multicurrency_total_ht)) $this->multicurrency_total_ht = 0; + if (empty($this->multicurrency_total_tva)) $this->multicurrency_total_tva = 0; + if (empty($this->multicurrency_total_ttc)) $this->multicurrency_total_ttc = 0; - if ($price_base_type == 'HT') - { - $pu = $pu_ht; - } else { - $pu = $pu_ttc; - } + if ($price_base_type == 'HT') + { + $pu = $pu_ht; + } else { + $pu = $pu_ttc; + } - // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva - // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker - // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. + // Calculate total with, without tax and tax from qty, pu, remise_percent and txtva + // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker + // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); + $localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc); - // Clean vat code - $vat_src_code = ''; - if (preg_match('/\((.*)\)/', $txtva, $reg)) - { - $vat_src_code = $reg[1]; - $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. - } + // Clean vat code + $vat_src_code = ''; + if (preg_match('/\((.*)\)/', $txtva, $reg)) + { + $vat_src_code = $reg[1]; + $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. + } - $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); + $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); - $total_ht = $tabprice[0]; - $total_tva = $tabprice[1]; - $total_ttc = $tabprice[2]; - $total_localtax1 = $tabprice[9]; - $total_localtax2 = $tabprice[10]; - $pu_ht = $tabprice[3]; - $pu_tva = $tabprice[4]; - $pu_ttc = $tabprice[5]; + $total_ht = $tabprice[0]; + $total_tva = $tabprice[1]; + $total_ttc = $tabprice[2]; + $total_localtax1 = $tabprice[9]; + $total_localtax2 = $tabprice[10]; + $pu_ht = $tabprice[3]; + $pu_tva = $tabprice[4]; + $pu_ttc = $tabprice[5]; - // MultiCurrency - $multicurrency_total_ht = $tabprice[16]; - $multicurrency_total_tva = $tabprice[17]; - $multicurrency_total_ttc = $tabprice[18]; - $pu_ht_devise = $tabprice[19]; + // MultiCurrency + $multicurrency_total_ht = $tabprice[16]; + $multicurrency_total_tva = $tabprice[17]; + $multicurrency_total_ttc = $tabprice[18]; + $pu_ht_devise = $tabprice[19]; - $product_type = $type; - if ($fk_product) - { - $product = new Product($this->db); - $result = $product->fetch($fk_product); - $product_type = $product->type; - } + $product_type = $type; + if ($fk_product) + { + $product = new Product($this->db); + $result = $product->fetch($fk_product); + $product_type = $product->type; + } - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; - $sql .= "fk_facture = ".((int) $facid); - $sql .= ", label=".(!empty($label) ? "'".$this->db->escape($label)."'" : "null"); - $sql .= ", description='".$this->db->escape($desc)."'"; - $sql .= ", price=".price2num($pu_ht); - $sql .= ", qty=".price2num($qty); - $sql .= ", tva_tx=".price2num($txtva); - $sql .= ", vat_src_code='".$this->db->escape($vat_src_code)."'"; - $sql .= ", localtax1_tx=".$txlocaltax1; - $sql .= ", localtax1_type='".$this->db->escape($localtaxes_type[0])."'"; - $sql .= ", localtax2_tx=".$txlocaltax2; - $sql .= ", localtax2_type='".$this->db->escape($localtaxes_type[2])."'"; - $sql .= ", fk_product=".(!empty($fk_product) ? "'".$this->db->escape($fk_product)."'" : "null"); - $sql .= ", product_type=".$product_type; - $sql .= ", remise_percent='".price2num($remise_percent)."'"; - $sql .= ", subprice='".price2num($pu_ht)."'"; - $sql .= ", total_ht='".price2num($total_ht)."'"; - $sql .= ", total_tva='".price2num($total_tva)."'"; - $sql .= ", total_localtax1='".price2num($total_localtax1)."'"; - $sql .= ", total_localtax2='".price2num($total_localtax2)."'"; - $sql .= ", total_ttc='".price2num($total_ttc)."'"; - $sql .= ", date_start_fill=".((int) $date_start_fill); - $sql .= ", date_end_fill=".((int) $date_end_fill); - $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : 'null'); - $sql .= ", buy_price_ht=".($pa_ht ? price2num($pa_ht) : 0); - $sql .= ", info_bits=".$info_bits; - $sql .= ", rang=".$rang; - $sql .= ", special_code=".$special_code; - $sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); - $sql .= ', multicurrency_subprice = '.$pu_ht_devise; - $sql .= ', multicurrency_total_ht = '.$multicurrency_total_ht; - $sql .= ', multicurrency_total_tva = '.$multicurrency_total_tva; - $sql .= ', multicurrency_total_ttc = '.$multicurrency_total_ttc; - $sql .= " WHERE rowid = ".$rowid; + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET "; + $sql .= "fk_facture = ".((int) $facid); + $sql .= ", label=".(!empty($label) ? "'".$this->db->escape($label)."'" : "null"); + $sql .= ", description='".$this->db->escape($desc)."'"; + $sql .= ", price=".price2num($pu_ht); + $sql .= ", qty=".price2num($qty); + $sql .= ", tva_tx=".price2num($txtva); + $sql .= ", vat_src_code='".$this->db->escape($vat_src_code)."'"; + $sql .= ", localtax1_tx=".$txlocaltax1; + $sql .= ", localtax1_type='".$this->db->escape($localtaxes_type[0])."'"; + $sql .= ", localtax2_tx=".$txlocaltax2; + $sql .= ", localtax2_type='".$this->db->escape($localtaxes_type[2])."'"; + $sql .= ", fk_product=".(!empty($fk_product) ? "'".$this->db->escape($fk_product)."'" : "null"); + $sql .= ", product_type=".$product_type; + $sql .= ", remise_percent='".price2num($remise_percent)."'"; + $sql .= ", subprice='".price2num($pu_ht)."'"; + $sql .= ", total_ht='".price2num($total_ht)."'"; + $sql .= ", total_tva='".price2num($total_tva)."'"; + $sql .= ", total_localtax1='".price2num($total_localtax1)."'"; + $sql .= ", total_localtax2='".price2num($total_localtax2)."'"; + $sql .= ", total_ttc='".price2num($total_ttc)."'"; + $sql .= ", date_start_fill=".((int) $date_start_fill); + $sql .= ", date_end_fill=".((int) $date_end_fill); + $sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : 'null'); + $sql .= ", buy_price_ht=".($pa_ht ? price2num($pa_ht) : 0); + $sql .= ", info_bits=".$info_bits; + $sql .= ", rang=".$rang; + $sql .= ", special_code=".$special_code; + $sql .= ", fk_unit=".($fk_unit ? "'".$this->db->escape($fk_unit)."'" : "null"); + $sql .= ', multicurrency_subprice = '.$pu_ht_devise; + $sql .= ', multicurrency_total_ht = '.$multicurrency_total_ht; + $sql .= ', multicurrency_total_tva = '.$multicurrency_total_tva; + $sql .= ', multicurrency_total_ttc = '.$multicurrency_total_ttc; + $sql .= " WHERE rowid = ".$rowid; - dol_syslog(get_class($this)."::updateline", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->id = $facid; - $this->update_price(); - return 1; - } else { - $this->error = $this->db->lasterror(); - return -1; - } - } + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->id = $facid; + $this->update_price(); + return 1; + } else { + $this->error = $this->db->lasterror(); + return -1; + } + } } @@ -1328,8 +1328,8 @@ class FactureRec extends CommonInvoice * @param int $max Maxlength of ref * @param int $short 1=Return just URL * @param string $moretitle Add more text to title tooltip - * @param int $notooltip 1=Disable tooltip - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @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 = '', $max = 0, $short = 0, $moretitle = '', $notooltip = '', $save_lastsearch_value = -1) @@ -1356,17 +1356,17 @@ class FactureRec extends CommonInvoice } } - $url = DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$this->id; + $url = DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$this->id; - if ($short) return $url; + if ($short) return $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'; - } + 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'; + } $linkstart = ''; $linkend = ''; @@ -1391,7 +1391,7 @@ class FactureRec extends CommonInvoice return $this->LibStatut($this->frequency ? 1 : 0, $this->suspended, $mode, $alreadypaid, empty($this->type) ? 0 : $this->type); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return label of a status * @@ -1404,7 +1404,7 @@ class FactureRec extends CommonInvoice */ public function LibStatut($recur, $status, $mode = 0, $alreadypaid = -1, $type = 0) { - // phpcs:enable + // phpcs:enable global $langs; $langs->load('bills'); @@ -1553,7 +1553,7 @@ class FactureRec extends CommonInvoice $arraynow = dol_getdate($now); $nownotime = dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']); - // Load array of products prodids + // Load array of products prodids $num_prods = 0; $prodids = array(); @@ -1690,190 +1690,190 @@ class FactureRec extends CommonInvoice } /** - * Update frequency and unit - * - * @param int $frequency value of frequency - * @param string $unit unit of frequency (d, m, y) - * @return int <0 if KO, >0 if OK - */ - public function setFrequencyAndUnit($frequency, $unit) - { - if (!$this->table_element) { - dol_syslog(get_class($this)."::setFrequencyAndUnit was called on objet with property table_element not defined", LOG_ERR); - return -1; - } - - if (!empty($frequency) && empty($unit)) { - dol_syslog(get_class($this)."::setFrequencyAndUnit was called on objet with params frequency defined but unit not defined", LOG_ERR); - return -2; - } - - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET frequency = '.($frequency ? $this->db->escape($frequency) : 'null'); - if (!empty($unit)) { - $sql .= ', unit_frequency = \''.$this->db->escape($unit).'\''; + * Update frequency and unit + * + * @param int $frequency value of frequency + * @param string $unit unit of frequency (d, m, y) + * @return int <0 if KO, >0 if OK + */ + public function setFrequencyAndUnit($frequency, $unit) + { + if (!$this->table_element) { + dol_syslog(get_class($this)."::setFrequencyAndUnit was called on objet with property table_element not defined", LOG_ERR); + return -1; } - $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); - if ($this->db->query($sql)) { - $this->frequency = $frequency; - if (!empty($unit)) $this->unit_frequency = $unit; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + if (!empty($frequency) && empty($unit)) { + dol_syslog(get_class($this)."::setFrequencyAndUnit was called on objet with params frequency defined but unit not defined", LOG_ERR); + return -2; + } + + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= ' SET frequency = '.($frequency ? $this->db->escape($frequency) : 'null'); + if (!empty($unit)) { + $sql .= ', unit_frequency = \''.$this->db->escape($unit).'\''; + } + $sql .= ' WHERE rowid = '.$this->id; + + dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG); + if ($this->db->query($sql)) { + $this->frequency = $frequency; + if (!empty($unit)) $this->unit_frequency = $unit; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } /** - * Update the next date of execution - * - * @param datetime $date date of execution - * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done - * @return int <0 if KO, >0 if OK - */ - public function setNextDate($date, $increment_nb_gen_done = 0) - { - if (!$this->table_element) - { - dol_syslog(get_class($this)."::setNextDate was called on objet with property table_element not defined", LOG_ERR); - return -1; - } - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= " SET date_when = ".($date ? "'".$this->db->idate($date)."'" : "null"); - if ($increment_nb_gen_done > 0) $sql .= ', nb_gen_done = nb_gen_done + 1'; - $sql .= ' WHERE rowid = '.$this->id; + * Update the next date of execution + * + * @param datetime $date date of execution + * @param int $increment_nb_gen_done 0 do nothing more, >0 increment nb_gen_done + * @return int <0 if KO, >0 if OK + */ + public function setNextDate($date, $increment_nb_gen_done = 0) + { + if (!$this->table_element) + { + dol_syslog(get_class($this)."::setNextDate was called on objet with property table_element not defined", LOG_ERR); + return -1; + } + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= " SET date_when = ".($date ? "'".$this->db->idate($date)."'" : "null"); + if ($increment_nb_gen_done > 0) $sql .= ', nb_gen_done = nb_gen_done + 1'; + $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setNextDate", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->date_when = $date; - if ($increment_nb_gen_done > 0) $this->nb_gen_done++; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + dol_syslog(get_class($this)."::setNextDate", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->date_when = $date; + if ($increment_nb_gen_done > 0) $this->nb_gen_done++; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } /** - * Update the maximum period - * - * @param int $nb number of maximum period - * @return int <0 if KO, >0 if OK - */ - public function setMaxPeriod($nb) - { - if (!$this->table_element) - { - dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined", LOG_ERR); - return -1; - } + * Update the maximum period + * + * @param int $nb number of maximum period + * @return int <0 if KO, >0 if OK + */ + public function setMaxPeriod($nb) + { + if (!$this->table_element) + { + dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined", LOG_ERR); + return -1; + } - if (empty($nb)) $nb = 0; + if (empty($nb)) $nb = 0; - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET nb_gen_max = '.$nb; - $sql .= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= ' SET nb_gen_max = '.$nb; + $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->nb_gen_max = $nb; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->nb_gen_max = $nb; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } /** - * Update the auto validate flag of invoice - * - * @param int $validate 0 to create in draft, 1 to create and validate invoice - * @return int <0 if KO, >0 if OK - */ - public function setAutoValidate($validate) - { - if (!$this->table_element) - { - dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined", LOG_ERR); - return -1; - } + * Update the auto validate flag of invoice + * + * @param int $validate 0 to create in draft, 1 to create and validate invoice + * @return int <0 if KO, >0 if OK + */ + public function setAutoValidate($validate) + { + if (!$this->table_element) + { + dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined", LOG_ERR); + return -1; + } - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET auto_validate = '.$validate; - $sql .= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= ' SET auto_validate = '.$validate; + $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->auto_validate = $validate; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->auto_validate = $validate; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } - /** - * Update the auto generate documents - * - * @param int $validate 0 no document, 1 to generate document - * @return int <0 if KO, >0 if OK - */ - public function setGeneratePdf($validate) - { - if (!$this->table_element) - { - dol_syslog(get_class($this)."::setGeneratePdf was called on objet with property table_element not defined", LOG_ERR); - return -1; - } + /** + * Update the auto generate documents + * + * @param int $validate 0 no document, 1 to generate document + * @return int <0 if KO, >0 if OK + */ + public function setGeneratePdf($validate) + { + if (!$this->table_element) + { + dol_syslog(get_class($this)."::setGeneratePdf was called on objet with property table_element not defined", LOG_ERR); + return -1; + } - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET generate_pdf = '.$validate; - $sql .= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= ' SET generate_pdf = '.$validate; + $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setGeneratePdf", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->generate_pdf = $validate; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + dol_syslog(get_class($this)."::setGeneratePdf", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->generate_pdf = $validate; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } - /** - * Update the model for documents - * - * @param string $model model of document generator - * @return int <0 if KO, >0 if OK - */ - public function setModelPdf($model) - { - if (!$this->table_element) - { - dol_syslog(get_class($this)."::setModelPdf was called on objet with property table_element not defined", LOG_ERR); - return -1; - } + /** + * Update the model for documents + * + * @param string $model model of document generator + * @return int <0 if KO, >0 if OK + */ + public function setModelPdf($model) + { + if (!$this->table_element) + { + dol_syslog(get_class($this)."::setModelPdf was called on objet with property table_element not defined", LOG_ERR); + return -1; + } - $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; - $sql .= ' SET modelpdf = "'.$model.'"'; - $sql .= ' WHERE rowid = '.$this->id; + $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; + $sql .= ' SET modelpdf = "'.$model.'"'; + $sql .= ' WHERE rowid = '.$this->id; - dol_syslog(get_class($this)."::setModelPdf", LOG_DEBUG); - if ($this->db->query($sql)) - { - $this->modelpdf = $model; - return 1; - } else { - dol_print_error($this->db); - return -1; - } - } + dol_syslog(get_class($this)."::setModelPdf", LOG_DEBUG); + if ($this->db->query($sql)) + { + $this->modelpdf = $model; + return 1; + } else { + dol_print_error($this->db); + return -1; + } + } } @@ -1898,206 +1898,206 @@ class FactureLigneRec extends CommonInvoiceLine public $date_end_fill; - /** - * Delete line in database - * - * @param User $user Object user - * @param int $notrigger Disable triggers - * @return int <0 if KO, >0 if OK - */ - public function delete(User $user, $notrigger = false) - { - $error = 0; + /** + * Delete line in database + * + * @param User $user Object user + * @param int $notrigger Disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + $error = 0; - $this->db->begin(); + $this->db->begin(); - if (!$error) { - if (!$notrigger) { - // Call triggers - $result = $this->call_trigger('LINEBILLREC_DELETE', $user); - if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail - // End call triggers - } - } + if (!$error) { + if (!$notrigger) { + // Call triggers + $result = $this->call_trigger('LINEBILLREC_DELETE', $user); + if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail + // End call triggers + } + } if (!$error) - { - $result = $this->deleteExtraFields(); - if ($result < 0) { - $error++; - } - } - - if (!$error) - { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; - - $res = $this->db->query($sql); - if ($res === false) { - $error++; - $this->errors[] = $this->db->lasterror(); - } - } - - // Commit or rollback - if ($error) { - $this->db->rollback(); - return -1; - } else { - $this->db->commit(); - return 1; + { + $result = $this->deleteExtraFields(); + if ($result < 0) { + $error++; + } } - } + + if (!$error) + { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.$this->id; + + $res = $this->db->query($sql); + if ($res === false) { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + + // Commit or rollback + if ($error) { + $this->db->rollback(); + return -1; + } else { + $this->db->commit(); + return 1; + } + } - /** - * Get line of template invoice - * - * @param int $rowid Id of invoice - * @return int 1 if OK, < 0 if KO - */ - public function fetch($rowid) - { - $sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; - $sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; - $sql .= ' l.date_start_fill, l.date_end_fill, l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; - $sql .= ' l.rang, l.special_code,'; - $sql .= ' l.fk_unit, l.fk_contract_line,'; - $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; - $sql .= ' FROM '.MAIN_DB_PREFIX.'facturedet_rec as l'; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; - $sql .= ' WHERE l.rowid = '.$rowid; - $sql .= ' ORDER BY l.rang'; + /** + * Get line of template invoice + * + * @param int $rowid Id of invoice + * @return int 1 if OK, < 0 if KO + */ + public function fetch($rowid) + { + $sql = 'SELECT l.rowid, l.fk_facture ,l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; + $sql .= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; + $sql .= ' l.date_start_fill, l.date_end_fill, l.info_bits, l.total_ht, l.total_tva, l.total_ttc,'; + $sql .= ' l.rang, l.special_code,'; + $sql .= ' l.fk_unit, l.fk_contract_line,'; + $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; + $sql .= ' FROM '.MAIN_DB_PREFIX.'facturedet_rec as l'; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; + $sql .= ' WHERE l.rowid = '.$rowid; + $sql .= ' ORDER BY l.rang'; - dol_syslog('FactureRec::fetch', LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - $objp = $this->db->fetch_object($result); + dol_syslog('FactureRec::fetch', LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + $objp = $this->db->fetch_object($result); - $this->id = $objp->rowid; - $this->label = $objp->custom_label; // Label line - $this->desc = $objp->description; // Description line - $this->description = $objp->description; // Description line - $this->product_type = $objp->product_type; // Type of line - $this->ref = $objp->product_ref; // Ref product - $this->product_ref = $objp->product_ref; // Ref product - $this->libelle = $objp->product_label; // deprecated - $this->product_label = $objp->product_label; // Label product - $this->product_desc = $objp->product_desc; // Description product - $this->fk_product_type = $objp->fk_product_type; // Type of product - $this->qty = $objp->qty; - $this->price = $objp->price; - $this->subprice = $objp->subprice; - $this->fk_facture = $objp->fk_facture; - $this->vat_src_code = $objp->vat_src_code; - $this->tva_tx = $objp->tva_tx; - $this->localtax1_tx = $objp->localtax1_tx; - $this->localtax2_tx = $objp->localtax2_tx; - $this->localtax1_type = $objp->localtax1_type; - $this->localtax2_type = $objp->localtax2_type; - $this->remise_percent = $objp->remise_percent; - $this->fk_remise_except = $objp->fk_remise_except; - $this->fk_product = $objp->fk_product; - $this->date_start_fill = $objp->date_start_fill; - $this->date_end_fill = $objp->date_end_fill; - $this->info_bits = $objp->info_bits; - $this->total_ht = $objp->total_ht; - $this->total_tva = $objp->total_tva; - $this->total_ttc = $objp->total_ttc; - $this->code_ventilation = $objp->fk_code_ventilation; - $this->rang = $objp->rang; - $this->special_code = $objp->special_code; - $this->fk_unit = $objp->fk_unit; - $this->fk_contract_line = $objp->fk_contract_line; + $this->id = $objp->rowid; + $this->label = $objp->custom_label; // Label line + $this->desc = $objp->description; // Description line + $this->description = $objp->description; // Description line + $this->product_type = $objp->product_type; // Type of line + $this->ref = $objp->product_ref; // Ref product + $this->product_ref = $objp->product_ref; // Ref product + $this->libelle = $objp->product_label; // deprecated + $this->product_label = $objp->product_label; // Label product + $this->product_desc = $objp->product_desc; // Description product + $this->fk_product_type = $objp->fk_product_type; // Type of product + $this->qty = $objp->qty; + $this->price = $objp->price; + $this->subprice = $objp->subprice; + $this->fk_facture = $objp->fk_facture; + $this->vat_src_code = $objp->vat_src_code; + $this->tva_tx = $objp->tva_tx; + $this->localtax1_tx = $objp->localtax1_tx; + $this->localtax2_tx = $objp->localtax2_tx; + $this->localtax1_type = $objp->localtax1_type; + $this->localtax2_type = $objp->localtax2_type; + $this->remise_percent = $objp->remise_percent; + $this->fk_remise_except = $objp->fk_remise_except; + $this->fk_product = $objp->fk_product; + $this->date_start_fill = $objp->date_start_fill; + $this->date_end_fill = $objp->date_end_fill; + $this->info_bits = $objp->info_bits; + $this->total_ht = $objp->total_ht; + $this->total_tva = $objp->total_tva; + $this->total_ttc = $objp->total_ttc; + $this->code_ventilation = $objp->fk_code_ventilation; + $this->rang = $objp->rang; + $this->special_code = $objp->special_code; + $this->fk_unit = $objp->fk_unit; + $this->fk_contract_line = $objp->fk_contract_line; - $this->db->free($result); - return 1; - } else { - $this->error = $this->db->lasterror(); - return -3; - } - } + $this->db->free($result); + return 1; + } else { + $this->error = $this->db->lasterror(); + return -3; + } + } - /** - * Update a line to invoice_rec. - * - * @param User $user User - * @param int $notrigger No trigger - * @return int <0 if KO, Id of line if OK - */ - public function update(User $user, $notrigger = 0) - { - global $conf; + /** + * Update a line to invoice_rec. + * + * @param User $user User + * @param int $notrigger No trigger + * @return int <0 if KO, Id of line if OK + */ + public function update(User $user, $notrigger = 0) + { + global $conf; - $error = 0; + $error = 0; - include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; - $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET"; - $sql .= " fk_facture = ".$this->fk_facture; - $sql .= ", label=".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); - $sql .= ", description='".$this->db->escape($this->desc)."'"; - $sql .= ", price=".price2num($this->price); - $sql .= ", qty=".price2num($this->qty); - $sql .= ", tva_tx=".price2num($this->tva_tx); - $sql .= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'"; - $sql .= ", localtax1_tx=".price2num($this->localtax1_tx); - $sql .= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'"; - $sql .= ", localtax2_tx=".price2num($this->localtax2_tx); - $sql .= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'"; - $sql .= ", fk_product=".($this->fk_product > 0 ? $this->fk_product : "null"); - $sql .= ", product_type=".$this->product_type; - $sql .= ", remise_percent='".price2num($this->remise_percent)."'"; - $sql .= ", subprice='".price2num($this->subprice)."'"; - $sql .= ", info_bits='".price2num($this->info_bits)."'"; - $sql .= ", date_start_fill=".(int) $this->date_start_fill; - $sql .= ", date_end_fill=".(int) $this->date_end_fill; - if (empty($this->skip_update_total)) { - $sql .= ", total_ht=".price2num($this->total_ht); - $sql .= ", total_tva=".price2num($this->total_tva); - $sql .= ", total_localtax1=".price2num($this->total_localtax1); - $sql .= ", total_localtax2=".price2num($this->total_localtax2); - $sql .= ", total_ttc=".price2num($this->total_ttc); - } - $sql .= ", rang=".$this->rang; - $sql .= ", special_code=".$this->special_code; - $sql .= ", fk_unit=".($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : "null"); - $sql .= ", fk_contract_line=".($this->fk_contract_line ? $this->fk_contract_line : "null"); - $sql .= " WHERE rowid = ".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET"; + $sql .= " fk_facture = ".$this->fk_facture; + $sql .= ", label=".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : "null"); + $sql .= ", description='".$this->db->escape($this->desc)."'"; + $sql .= ", price=".price2num($this->price); + $sql .= ", qty=".price2num($this->qty); + $sql .= ", tva_tx=".price2num($this->tva_tx); + $sql .= ", vat_src_code='".$this->db->escape($this->vat_src_code)."'"; + $sql .= ", localtax1_tx=".price2num($this->localtax1_tx); + $sql .= ", localtax1_type='".$this->db->escape($this->localtax1_type)."'"; + $sql .= ", localtax2_tx=".price2num($this->localtax2_tx); + $sql .= ", localtax2_type='".$this->db->escape($this->localtax2_type)."'"; + $sql .= ", fk_product=".($this->fk_product > 0 ? $this->fk_product : "null"); + $sql .= ", product_type=".$this->product_type; + $sql .= ", remise_percent='".price2num($this->remise_percent)."'"; + $sql .= ", subprice='".price2num($this->subprice)."'"; + $sql .= ", info_bits='".price2num($this->info_bits)."'"; + $sql .= ", date_start_fill=".(int) $this->date_start_fill; + $sql .= ", date_end_fill=".(int) $this->date_end_fill; + if (empty($this->skip_update_total)) { + $sql .= ", total_ht=".price2num($this->total_ht); + $sql .= ", total_tva=".price2num($this->total_tva); + $sql .= ", total_localtax1=".price2num($this->total_localtax1); + $sql .= ", total_localtax2=".price2num($this->total_localtax2); + $sql .= ", total_ttc=".price2num($this->total_ttc); + } + $sql .= ", rang=".$this->rang; + $sql .= ", special_code=".$this->special_code; + $sql .= ", fk_unit=".($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : "null"); + $sql .= ", fk_contract_line=".($this->fk_contract_line ? $this->fk_contract_line : "null"); + $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::updateline", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - if (!$error) - { - $result = $this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + dol_syslog(get_class($this)."::updateline", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + if (!$error) + { + $result = $this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } - if (!$error && !$notrigger) - { - // Call trigger - $result = $this->call_trigger('LINEBILLREC_UPDATE', $user); - if ($result < 0) - { - $this->db->rollback(); - return -2; - } - // End call triggers - } - $this->db->commit(); - return 1; - } else { - $this->error = $this->db->lasterror(); - $this->db->rollback(); - return -2; - } - } + if (!$error && !$notrigger) + { + // Call trigger + $result = $this->call_trigger('LINEBILLREC_UPDATE', $user); + if ($result < 0) + { + $this->db->rollback(); + return -2; + } + // End call triggers + } + $this->db->commit(); + return 1; + } else { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -2; + } + } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 0c6b438b376..16309d31658 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1026,7 +1026,7 @@ class Facture extends CommonInvoice // Charge facture source $facture = new Facture($this->db); - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -1625,7 +1625,7 @@ class Facture extends CommonInvoice if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 459543dfc74..fc66715dd3d 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -133,7 +133,7 @@ if ($id > 0 || !empty($ref)) $totalpaye = $object->getSommePaiement(); - dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), -1, 'bill'); + print dol_get_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), -1, 'bill'); // Invoice content @@ -185,7 +185,7 @@ if ($id > 0 || !empty($ref)) dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index 722286044cc..e001b203296 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -101,7 +101,7 @@ if ($id > 0 || !empty($ref)) $upload_dir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $head = facture_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); + print dol_get_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'facture'; $permission = $user->rights->facture->creer; diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index bad63cf1f61..f26f4ea0255 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -56,7 +56,7 @@ $object->fetch_thirdparty(); $object->info($object->id); $head = facture_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'); +print dol_get_fiche_head($head, 'info', $langs->trans("InvoiceCustomer"), -1, 'bill'); $totalpaye = $object->getSommePaiement(); @@ -120,7 +120,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 4f795274ad2..ba902c4b773 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -206,10 +206,10 @@ $arrayfields = array( 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>200), 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>210), 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>220), // Not enabled by default because slow - 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled)?0:1)), - 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled)?0:1)), - 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)), - 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || empty($conf->global->DISPLAY_MARK_RATES)?0:1)), + 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), + 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous?0:1)), + 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES)?0:1)), + 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES)?0:1)), 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))), diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 249d2dd9b8c..a2343171d66 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref)) $totalpaye = $object->getSommePaiement(); - dol_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'); + print dol_get_fiche_head($head, 'note', $langs->trans("InvoiceCustomer"), -1, 'bill'); // Invoice content @@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) $cssclass = "titlefield"; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - dol_fiche_end(); + print dol_get_fiche_end(); } // End of page diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index f69517c1037..eea3b29aa36 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -213,7 +213,7 @@ if ($object->id > 0) $head = facture_prepare_head($object); } - dol_fiche_head($head, 'standingorders', $title, -1, 'bill'); + print dol_get_fiche_head($head, 'standingorders', $title, -1, 'bill'); // Invoice content if ($type == 'bank-transfer') { @@ -573,7 +573,7 @@ if ($object->id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $numopen = 0; $pending = 0; $numclosed = 0; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 81466651856..fb1002d45a5 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -233,7 +233,7 @@ if ($mode == 'supplier') $type = 'supplier_invoice_stats'; complete_head_from_modules($conf, $langs, null, $head, $h, $type); -dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); +print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); // We use select_thirdparty_list instead of select_company so we can use $filter and share same code for customer and supplier. $tmp_companies = $form->select_thirdparty_list($socid, 'socid', $filter, 1, 0, 0, array(), '', 1); @@ -381,7 +381,7 @@ print '
'; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 0591d75d5a3..31352ee1bc9 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -8,6 +8,7 @@ * Copyright (C) 2016 Marcos García * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 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 @@ -143,8 +144,9 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid, s.email"; $sql .= ", s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; + $sql .= ", cc.rowid as country_id, cc.code as country_code"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = ".Facture::STATUS_DRAFT; $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -161,6 +163,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, "; $sql .= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; + $sql .= ", cc.rowid, cc.code"; // Add Group from hooks $parameters = array(); @@ -207,6 +210,8 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $companystatic->id = $obj->socid; $companystatic->name = $obj->name; $companystatic->email = $obj->email; + $companystatic->country_id = $obj->country_id; + $companystatic->country_code = $obj->country_code; $companystatic->client = 1; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 6353d394f20..c3700d9e994 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -61,44 +61,44 @@ if ($_POST["cancel"] == $langs->trans("Cancel") && !$id) if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) { - $db->begin(); + $db->begin(); - $datev = dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); - $datep = dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); + $datev = dol_mktime(12, 0, 0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]); + $datep = dol_mktime(12, 0, 0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]); - $object->accountid = GETPOST("accountid"); - $object->paymenttype = GETPOST("paiementtype"); - $object->datev = $datev; - $object->datep = $datep; - $object->amount = price2num(GETPOST("amount")); + $object->accountid = GETPOST("accountid"); + $object->paymenttype = GETPOST("paiementtype"); + $object->datev = $datev; + $object->datep = $datep; + $object->amount = price2num(GETPOST("amount")); $object->label = GETPOST("label"); $object->ltt = $lttype; - $ret = $object->addPayment($user); - if ($ret > 0) - { - $db->commit(); - header("Location: list.php?localTaxType=".$lttype); - exit; - } else { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - $_GET["action"] = "create"; - } + $ret = $object->addPayment($user); + if ($ret > 0) + { + $db->commit(); + header("Location: list.php?localTaxType=".$lttype); + exit; + } else { + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + $_GET["action"] = "create"; + } } //delete payment of localtax if ($action == 'delete') { - $result = $object->fetch($id); + $result = $object->fetch($id); if ($object->rappro == 0) { - $db->begin(); + $db->begin(); - $ret = $object->delete($user); - if ($ret > 0) - { + $ret = $object->delete($user); + if ($ret > 0) + { if ($object->fk_bank) { $accountline = new AccountLine($db); @@ -116,13 +116,13 @@ if ($action == 'delete') $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } - } else { - $db->rollback(); - setEventMessages($object->error, $object->errors, 'errors'); - } + } else { + $db->rollback(); + setEventMessages($object->error, $object->errors, 'errors'); + } } else { - $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; - setEventMessages($mesg, null, 'errors'); + $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; + setEventMessages($mesg, null, 'errors'); } } @@ -149,25 +149,25 @@ llxHeader("", $title, $helpurl); if ($action == 'create') { - print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code)); + print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code)); - print '
'."\n"; - print ''; - print ''; - print ''; + print ''."\n"; + print ''; + print ''; + print ''; - dol_fiche_head(); + print dol_get_fiche_head(); - print ''; + print '
'; - print ""; - print ''; + print ""; + print ''; - print ''; + print ''; // Label print ''; @@ -178,7 +178,7 @@ if ($action == 'create') if (!empty($conf->banque->enabled)) { print ''; print '
'.$langs->trans("DatePayment").''; - print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); - print '
'.$langs->trans("DatePayment").''; + print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); + print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; - print $form->selectDate($datev, "datev", '', '', '', 'add', 1, 1); - print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; + print $form->selectDate($datev, "datev", '', '', '', 'add', 1, 1); + print '
'.$langs->trans("Label").'transcountry(($lttype == 2 ? "LT2Payment" : "LT1Payment"), $mysoc->country_code)).'">
'.$langs->trans("Account").''; - $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant + $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 2); // Affiche liste des comptes courant print '
'.$langs->trans("PaymentMode").''; @@ -198,7 +198,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -219,7 +219,7 @@ if ($id) $head[$h][2] = 'card'; $h++; - dol_fiche_head($head, 'card', $langs->transcountry("LT".$object->ltt, $mysoc->country_code), -1, 'payment'); + print dol_get_fiche_head($head, 'card', $langs->transcountry("LT".$object->ltt, $mysoc->country_code), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -271,7 +271,7 @@ if ($id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index efe102c48b2..d1da6de0c3e 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -469,7 +469,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -528,7 +528,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 84cb8c1dc6f..db942328d13 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -177,7 +177,7 @@ $form = new Form($db); $head = payment_prepare_head($object); -dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); +print dol_get_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); // Confirmation of payment delete if ($action == 'delete') @@ -299,7 +299,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); /* diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index de672af203b..49a8cf5d61b 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2015-2016 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * 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 @@ -309,7 +309,7 @@ if ($action == 'new') // $head[$h][1] = $langs->trans("Info"); // $h++; - dol_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Cheques"), -1, 'payment'); /* * Confirmation of slip's delete @@ -357,7 +357,7 @@ if ($action == 'new') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; //print ''; @@ -370,7 +370,7 @@ if ($action == 'new') print ''; print '
'.$langs->trans('Date').''.dol_print_date($now,'day').'
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -385,7 +385,7 @@ if ($action == 'new') $sql = "SELECT ba.rowid as bid, b.datec as datec, b.dateo as date, b.rowid as transactionid, "; $sql .= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque,"; - $sql .= " p.rowid as paymentid"; + $sql .= " p.rowid as paymentid, p.ref as paymentref"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (b.fk_account = ba.rowid)"; @@ -411,6 +411,7 @@ if ($action == 'new') $lines[$obj->bid][$i]["banque"] = $obj->banque; $lines[$obj->bid][$i]["id"] = $obj->transactionid; $lines[$obj->bid][$i]["paymentid"] = $obj->paymentid; + $lines[$obj->bid][$i]["paymentref"] = $obj->paymentref; $i++; } @@ -482,7 +483,7 @@ if ($action == 'new') // Link to payment print ''; $paymentstatic->id = $value["paymentid"]; - $paymentstatic->ref = $value["paymentid"]; + $paymentstatic->ref = $value["paymentref"]; if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); @@ -616,7 +617,7 @@ if ($action == 'new') // List of bank checks $sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,"; $sql .= " b.dateo as date, b.datec as datec, b.banque,"; - $sql .= " p.rowid as pid, ba.rowid as bid, p.statut"; + $sql .= " p.rowid as pid, p.ref as pref, ba.rowid as bid, p.statut"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON (b.fk_account = ba.rowid)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.fk_bank = b.rowid"; @@ -662,9 +663,8 @@ if ($action == 'new') // Link to payment print ''; $paymentstatic->id = $objp->pid; - $paymentstatic->ref = $objp->pid; - if ($paymentstatic->id) - { + $paymentstatic->ref = $objp->pref; + if ($paymentstatic->id) { print $paymentstatic->getNomUrl(1); } else { print ' '; @@ -673,8 +673,7 @@ if ($action == 'new') // Link to bank transaction print ''; $accountlinestatic->rowid = $objp->rowid; - if ($accountlinestatic->rowid) - { + if ($accountlinestatic->rowid) { print $accountlinestatic->getNomUrl(1); } else { print ' '; @@ -720,7 +719,7 @@ if ($action == 'new') dol_print_error($db); } - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 68d987b06ff..208d74a316f 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -55,7 +55,7 @@ $object->info($object->id); $head = payment_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); +print dol_get_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -74,7 +74,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); // End of page llxFooter(); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index f3ea57ea084..b6dbd8195d1 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -78,7 +78,7 @@ $pagenext = $page + 1; if (!$sortorder) $sortorder = "DESC"; if (!$sortfield) $sortfield = "p.ref"; -$search_all = trim(GETPOSTISSET("search_all") ? GETPOSTISSET("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 706151c5b81..e5941624910 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -197,7 +197,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head('', ''); + print dol_get_fiche_head('', ''); print ''; @@ -236,7 +236,7 @@ if ($action == 'create') print ''; print ''; print ''; // Number @@ -252,7 +252,7 @@ if ($action == 'create') print '
'.$langs->trans('AccountToDebit').''; - $form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $charge->accountid, "accountid", 0, '', 1); // Show opend bank account list + $form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Other unpaid charges diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index a42d2471adf..5ee71863dd2 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -96,7 +96,7 @@ $h++; */ -dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); +print dol_get_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1, 'payment'); /* * Deletion confirmation of payment @@ -158,7 +158,7 @@ print ''; print ''; -dol_fiche_end(); +print dol_get_fiche_end(); /* diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 2691e14504d..5d87303236a 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -166,7 +166,7 @@ llxHeader('', $langs->trans("WithdrawalsReceipts")); if ($id > 0 || $ref) { $head = prelevement_prepare_head($object); - dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); + print dol_get_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); if (GETPOST('error', 'alpha') != '') { @@ -225,7 +225,7 @@ if ($id > 0 || $ref) print ''; $acc = new Account($db); - $result = $acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT); + $result = $acc->fetch(($object->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT)); print ''; @@ -428,7 +428,7 @@ if ($id > 0 || $ref) if ($user->rights->prelevement->bons->credit) { //print ''.$langs->trans("StandingOrderReject").''; - print ''.$langs->trans("StandingOrderReject").''; + print ''.$langs->trans("StandingOrderReject").''; } else { //print ''.$langs->trans("StandingOrderReject").''; } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9d3c5bef7a8..bcf0ce8aa5a 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -449,7 +449,7 @@ class BonPrelevement extends CommonObject $message = $langs->trans("InfoCreditMessage", $this->ref, dol_print_date($date, 'dayhour')); //Add payment of withdrawal into bank - $bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT; + $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $facs = array(); $amounts = array(); $amountsperthirdparty = array(); @@ -1699,7 +1699,7 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$conf->global->PAYMENTBYBANKTRANSFER_ICS.''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); @@ -2114,7 +2114,8 @@ class BonPrelevement extends CommonObject $dateTime_YMDHMS = dol_print_date($ladate, '%Y-%m-%dT%H:%M:%S'); // Get data of bank account - $id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT; + //$id = $configuration->global->PRELEVEMENT_ID_BANKACCOUNT; + $id = ($type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $account = new Account($this->db); if ($account->fetch($id) > 0) { diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index d4f76548363..3f95d18e38b 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -15,7 +15,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /** @@ -40,19 +39,23 @@ class RejetPrelevement */ public $db; + public $type; //prelevement or bank transfer + /** * Constructor * * @param DoliDb $db Database handler * @param User $user Objet user + * @param string $type Type ('direct-debit' for direct debit or 'bank-transfer' for credit transfer) */ - public function __construct($db, $user) + public function __construct($db, $user, $type) { global $langs; $this->db = $db; $this->user = $user; + $this->type = $type; $this->motifs = array(); $this->facturer = array(); @@ -92,7 +95,7 @@ class RejetPrelevement $now = dol_now(); dol_syslog("RejetPrelevement::Create id $id"); - $bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT; + $bankaccount = ($this->type == 'bank-transfer' ? $conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT : $conf->global->PRELEVEMENT_ID_BANKACCOUNT); $facs = $this->getListInvoices(1); $this->db->begin(); @@ -135,13 +138,19 @@ class RejetPrelevement } $num = count($facs); - for ($i = 0; $i < $num; $i++) - { - $fac = new Facture($this->db); + for ($i = 0; $i < $num; $i++) { + if ($this->type == 'bank-transfer') { + $fac = new FactureFournisseur($this->db); + $pai = new PaiementFourn($this->db); + } else { + $fac = new Facture($this->db); + $pai = new Paiement($this->db); + } + $fac->fetch($facs[$i][0]); // Make a negative payment - $pai = new Paiement($this->db); + //$pai = new Paiement($this->db); $pai->amounts = array(); @@ -150,26 +159,24 @@ class RejetPrelevement * PHP installs sends only the part integer negative */ - $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1); + $pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * ($this->type == 'bank-transfer' ? 1: -1)); $pai->datepaye = $date_rejet; $pai->paiementid = 3; // type of payment: withdrawal $pai->num_payment = $fac->ref; - if ($pai->create($this->user) < 0) // we call with no_commit - { + if ($pai->create($this->user) < 0) { + // we call with no_commit $error++; dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); } else { $result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', ''); - if ($result < 0) - { + if ($result < 0) { dol_syslog("RejetPrelevement::Create AddPaymentToBan Error"); $error++; } // Payment validation - if ($pai->validate($user) < 0) - { + if ($pai->validate($user) < 0) { $error++; dol_syslog("RejetPrelevement::Create Error payment validation"); } @@ -211,7 +218,7 @@ class RejetPrelevement $sql = "SELECT fk_user_demande"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " WHERE pfd.fk_prelevement_bons = ".$this->bon_id; - $sql .= " AND pfd.fk_facture = ".$fac->id; + $sql .= " AND pfd.fk_facture".($this->type == 'bank-transfer' ? '_fourn=': '=').$fac->id; $resql = $this->db->query($sql); if ($resql) @@ -255,8 +262,7 @@ class RejetPrelevement $mailfile = new CMailFile($subject, $sendto, $from, $message, $arr_file, $arr_mime, $arr_name, '', '', 0, $msgishtml, $this->user->email, '', $trackid); $result = $mailfile->sendfile(); - if ($result) - { + if ($result) { dol_syslog("RejetPrelevement::_send_email email envoye"); } else { dol_syslog("RejetPrelevement::_send_email Erreur envoi email"); @@ -282,7 +288,8 @@ class RejetPrelevement //Returns all invoices of a withdrawal $sql = "SELECT f.rowid as facid, pl.amount"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture as pf"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)"; + if ($this->type == 'bank-transfer') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON (pf.fk_facture_fourn = f.rowid)"; + else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON (pf.fk_facture = f.rowid)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."prelevement_lignes as pl ON (pf.fk_prelevement_lignes = pl.rowid)"; $sql .= " WHERE pf.fk_prelevement_lignes = ".$this->id; $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -298,8 +305,9 @@ class RejetPrelevement while ($i < $num) { $row = $this->db->fetch_row($resql); - if (!$amounts) $arr[$i] = $row[0]; - else { + if (!$amounts) { + $arr[$i] = $row[0]; + } else { $arr[$i] = array( $row[0], $row[1] @@ -336,9 +344,9 @@ class RejetPrelevement { $obj = $this->db->fetch_object($resql); - $this->id = $rowid; - $this->date_rejet = $this->db->jdate($obj->dr); - $this->motif = $this->motifs[$obj->motif]; + $this->id = $rowid; + $this->date_rejet = $this->db->jdate($obj->dr); + $this->motif = $this->motifs[$obj->motif]; $this->invoicing = $this->facturer[$obj->afacturer]; $this->db->free($resql); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 8c8dc01a22c..b68fd5d983b 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -141,7 +141,7 @@ $head[$h][2] = 'payment'; $hselected = 'payment'; $h++; -dol_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); +print dol_get_fiche_head($head, $hselected, $langs->trans("StandingOrders"), 0, 'payment'); */ $title = $langs->trans("NewStandingOrder"); @@ -151,7 +151,7 @@ if ($type == 'bank-transfer') { print load_fiche_titre($title); -dol_fiche_head(); +print dol_get_fiche_head(); $nb = $bprev->nbOfInvoiceToPay($type); $pricetowithdraw = $bprev->SommeAPrelever($type); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 4e3d191fdfa..1f8ecdaeced 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -84,7 +84,7 @@ if ($id > 0 || $ref) if ($object->fetch($id, $ref) >= 0) { $head = prelevement_prepare_head($object); - dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); + print dol_get_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -150,7 +150,7 @@ if ($id > 0 || $ref) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 7783edd4673..fb1a9451aed 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -78,7 +78,7 @@ if ($prev_id > 0 || $ref) if ($object->fetch($prev_id, $ref) >= 0) { $head = prelevement_prepare_head($object); - dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); + print dol_get_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -144,14 +144,14 @@ if ($prev_id > 0 || $ref) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } else { dol_print_error($db); } } -$rej = new RejetPrelevement($db, $user); +$rej = new RejetPrelevement($db, $user, $type); /* * List errors diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index df5118df0cf..81e854ef5a0 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -77,7 +77,7 @@ if ($prev_id > 0 || $ref) if ($object->fetch($prev_id, $ref) >= 0) { $head = prelevement_prepare_head($object); - dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); + print dol_get_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment'); $linkback = ''.$langs->trans("BackToList").''; @@ -143,7 +143,7 @@ if ($prev_id > 0 || $ref) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); } else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 3c8d80d4931..ccb60486c76 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -95,18 +95,18 @@ if ($action == 'confirm_rejet') if ($lipre->fetch($id) == 0) { - $rej = new RejetPrelevement($db, $user); + $rej = new RejetPrelevement($db, $user, $type); $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); - header("Location: line.php?id=".$id); + header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); exit; } } else { $action = "rejet"; } } else { - header("Location: line.php?id=".$id); + header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); exit; } } @@ -128,7 +128,7 @@ llxHeader('', $title); $head = array(); $h = 0; -$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id; +$head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$id.'&type='.$type; $head[$h][1] = $title; $hselected = $h; $h++; @@ -142,7 +142,7 @@ if ($id) $bon = new BonPrelevement($db); $bon->fetch($lipre->bon_rowid); - dol_fiche_head($head, $hselected, $title); + print dol_get_fiche_head($head, $hselected, $title); print '
'; $labelofbankfield = "BankToReceiveWithdraw"; @@ -250,7 +250,7 @@ if ($id > 0 || $ref) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); $formconfirm = ''; @@ -404,7 +404,7 @@ if ($id > 0 || $ref) print ""; print $ligne->LibStatut($obj->statut, 2); print " "; - print ''; + print ''; print sprintf("%06s", $obj->rowid); print '
'; @@ -158,7 +158,7 @@ if ($id) if ($lipre->statut == 3) { - $rej = new RejetPrelevement($db, $user); + $rej = new RejetPrelevement($db, $user, $type); $resf = $rej->fetch($lipre->id); if ($resf == 0) { @@ -179,7 +179,7 @@ if ($id) } print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } else { dol_print_error($db); } @@ -191,11 +191,12 @@ if ($id) $soc = new Societe($db); $soc->fetch($lipre->socid); - $rej = new RejetPrelevement($db, $user); + $rej = new RejetPrelevement($db, $user, $type); print ''; print ''; print ''; + print ''; print ''; print ''; @@ -246,7 +247,7 @@ if ($id) if ($lipre->statut == 2) { if ($user->rights->prelevement->bons->credit) { - print ''.$langs->trans("StandingOrderReject").''; + print ''.$langs->trans("StandingOrderReject").''; } else { print ''.$langs->trans("StandingOrderReject").''; } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index da2420aed3f..8a16f4ecb76 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -65,7 +65,7 @@ llxHeader('', $title); if ($sortorder == "") $sortorder = "DESC"; if ($sortfield == "") $sortfield = "p.datec"; -$rej = new RejetPrelevement($db, $user); +$rej = new RejetPrelevement($db, $user, $type); $line = new LignePrelevement($db); $hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist')); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 1d6e1c2a183..c046f2f278e 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -214,7 +214,7 @@ if ($resql) print ''; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; - $Rejet = new RejetPrelevement($db, $user); + $Rejet = new RejetPrelevement($db, $user, $type); while ($i < $num) { diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 63368fa94e8..3930d711a1c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -95,9 +95,9 @@ if ($id > 0) $head = societe_prepare_head($object); - dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); + print dol_get_fiche_head($head, 'customer', $langs->trans("ThirdParty"), 0, 'company'); dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); - dol_fiche_end(); + print dol_get_fiche_end(); if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 9ae666cb01a..754c84350af 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -449,7 +449,7 @@ if (!empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } else { dol_print_error($db); } - // TVA retreived + // TVA retrieved $sql = "SELECT sum(t.amount) as amount, date_format(t.datev,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as t"; $sql .= " WHERE amount < 0"; @@ -915,7 +915,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) print ''; print ''; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index c744bcc90e8..8af8c54752b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -296,7 +296,7 @@ if ($action == 'create') print ''; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print '
%'.$langs->trans("Amount").'%
'; $htmlhelp = ''; - // if ($modecompta == 'RECETTES-DEPENSES') $htmlhelp=$langs->trans("SalesPlusVATToRetreive"); + // if ($modecompta == 'RECETTES-DEPENSES') $htmlhelp=$langs->trans("SalesPlusVATToRetrieve"); print $form->textwithpicto($langs->trans("Income"), $htmlhelp); print '
'; @@ -370,13 +370,13 @@ if ($action == 'create') if (!empty($conf->banque->enabled)) { print ''; } print '
'.$langs->trans('BankAccount').''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + $form->select_comptes($fk_account, 'fk_account', 0, '', 2); print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -440,7 +440,7 @@ if ($id > 0) print ''; } - dol_fiche_head($head, 'card', $langs->trans("SocialContribution"), -1, 'bill'); + print dol_get_fiche_head($head, 'card', $langs->trans("SocialContribution"), -1, 'bill'); $morehtmlref = '
'; // Ref customer @@ -681,7 +681,7 @@ if ($id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); if ($action == 'edit') { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 81ae1e28f20..6e018e0bb84 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur - * Copyright (C) 2016-2019 Frédéric France + * Copyright (C) 2016-2020 Frédéric France * Copyright (C) 2017 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -32,79 +32,79 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - /** + /** * @var string ID to identify managed object */ public $element = 'chargesociales'; - public $table = 'chargesociales'; + public $table = 'chargesociales'; - /** + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'chargesociales'; - /** - * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png - */ - public $picto = 'bill'; - - /** - * {@inheritdoc} - */ - protected $table_ref_field = 'ref'; - - /** - * @var integer|string $date_ech - */ - public $date_ech; - - - public $label; - public $type; - public $type_label; - public $amount; - public $paye; - public $periode; - - /** - * @var integer|string date_creation - */ - public $date_creation; - - /** - * @var integer|string $date_modification - */ - public $date_modification; - - /** - * @var integer|string $date_validation - */ - public $date_validation; - - /** - * @deprecated Use label instead - */ - public $lib; - - /** - * @var int account ID - */ - public $fk_account; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bill'; /** - * @var int account ID (identical to fk_account) - */ - public $accountid; + * {@inheritdoc} + */ + protected $table_ref_field = 'ref'; - /** - * @var int payment type (identical to mode_reglement_id in commonobject class) - */ - public $paiementtype; + /** + * @var integer|string $date_ech + */ + public $date_ech; - /** - * @var int ID - */ + + public $label; + public $type; + public $type_label; + public $amount; + public $paye; + public $periode; + + /** + * @var integer|string date_creation + */ + public $date_creation; + + /** + * @var integer|string $date_modification + */ + public $date_modification; + + /** + * @var integer|string $date_validation + */ + public $date_validation; + + /** + * @deprecated Use label instead + */ + public $lib; + + /** + * @var int account ID + */ + public $fk_account; + + /** + * @var int account ID (identical to fk_account) + */ + public $accountid; + + /** + * @var int payment type (identical to mode_reglement_id in commonobject class) + */ + public $paiementtype; + + /** + * @var int ID + */ public $fk_project; @@ -112,73 +112,73 @@ class ChargeSociales extends CommonObject const STATUS_PAID = 1; - /** - * Constructor - * - * @param DoliDB $db Database handler - */ - public function __construct($db) - { - $this->db = $db; - } + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + } - /** - * Retrouve et charge une charge sociale - * - * @param int $id Id - * @param string $ref Ref - * @return int <0 KO >0 OK - */ - public function fetch($id, $ref = '') - { - $sql = "SELECT cs.rowid, cs.date_ech"; - $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; - $sql .= ", cs.fk_account, cs.fk_mode_reglement"; - $sql .= ", c.libelle"; - $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; - $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as c ON cs.fk_type = c.id"; - $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON cs.fk_mode_reglement = p.id'; - $sql .= ' WHERE cs.entity IN ('.getEntity('tax').')'; - if ($ref) $sql .= " AND cs.rowid = ".$ref; - else $sql .= " AND cs.rowid = ".$id; + /** + * Retrouve et charge une charge sociale + * + * @param int $id Id + * @param string $ref Ref + * @return int <0 KO >0 OK + */ + public function fetch($id, $ref = '') + { + $sql = "SELECT cs.rowid, cs.date_ech"; + $sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key"; + $sql .= ", cs.fk_account, cs.fk_mode_reglement"; + $sql .= ", c.libelle"; + $sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; + $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_chargesociales as c ON cs.fk_type = c.id"; + $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON cs.fk_mode_reglement = p.id'; + $sql .= ' WHERE cs.entity IN ('.getEntity('tax').')'; + if ($ref) $sql .= " AND cs.rowid = ".$ref; + else $sql .= " AND cs.rowid = ".$id; - dol_syslog(get_class($this)."::fetch", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) - { - if ($this->db->num_rows($resql)) - { - $obj = $this->db->fetch_object($resql); + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) + { + if ($this->db->num_rows($resql)) + { + $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->date_ech = $this->db->jdate($obj->date_ech); - $this->lib = $obj->label; - $this->label = $obj->label; - $this->type = $obj->fk_type; - $this->type_label = $obj->libelle; - $this->fk_account = $obj->fk_account; - $this->mode_reglement_id = $obj->fk_mode_reglement; - $this->mode_reglement_code = $obj->mode_reglement_code; - $this->mode_reglement = $obj->mode_reglement_libelle; - $this->amount = $obj->amount; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->date_ech = $this->db->jdate($obj->date_ech); + $this->lib = $obj->label; + $this->label = $obj->label; + $this->type = $obj->fk_type; + $this->type_label = $obj->libelle; + $this->fk_account = $obj->fk_account; + $this->mode_reglement_id = $obj->fk_mode_reglement; + $this->mode_reglement_code = $obj->mode_reglement_code; + $this->mode_reglement = $obj->mode_reglement_libelle; + $this->amount = $obj->amount; $this->fk_project = $obj->fk_project; - $this->paye = $obj->paye; - $this->periode = $this->db->jdate($obj->periode); - $this->import_key = $this->import_key; + $this->paye = $obj->paye; + $this->periode = $this->db->jdate($obj->periode); + $this->import_key = $this->import_key; - $this->db->free($resql); + $this->db->free($resql); - return 1; - } else { - return 0; - } - } else { - $this->error = $this->db->lasterror(); - return -1; - } - } + return 1; + } else { + return 0; + } + } else { + $this->error = $this->db->lasterror(); + return -1; + } + } /** * Check if a social contribution can be created into database @@ -189,59 +189,59 @@ class ChargeSociales extends CommonObject { $newamount = price2num($this->amount, 'MT'); - // Validation parametres - if (!$newamount > 0 || empty($this->date_ech) || empty($this->periode)) - { - return false; - } + // Validation parametres + if (!$newamount > 0 || empty($this->date_ech) || empty($this->periode)) + { + return false; + } return true; } - /** - * Create a social contribution into database - * - * @param User $user User making creation - * @return int <0 if KO, id if OK - */ - public function create($user) - { - global $conf; + /** + * Create a social contribution into database + * + * @param User $user User making creation + * @return int <0 if KO, id if OK + */ + public function create($user) + { + global $conf; $error = 0; - $now = dol_now(); + $now = dol_now(); - // Nettoyage parametres - $newamount = price2num($this->amount, 'MT'); + // Nettoyage parametres + $newamount = price2num($this->amount, 'MT'); if (!$this->check()) { $this->error = "ErrorBadParameter"; return -2; } - $this->db->begin(); + $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)"; - $sql .= " VALUES (".$this->type; - $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); - $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : "NULL"); - $sql .= ", '".$this->db->escape($this->label ? $this->label : $this->lib)."'"; - $sql .= ", '".$this->db->idate($this->date_ech)."'"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, fk_account, fk_mode_reglement, libelle, date_ech, periode, amount, fk_projet, entity, fk_user_author, date_creation)"; + $sql .= " VALUES (".$this->type; + $sql .= ", ".($this->fk_account > 0 ? $this->fk_account : 'NULL'); + $sql .= ", ".($this->mode_reglement_id > 0 ? $this->mode_reglement_id : "NULL"); + $sql .= ", '".$this->db->escape($this->label ? $this->label : $this->lib)."'"; + $sql .= ", '".$this->db->idate($this->date_ech)."'"; $sql .= ", '".$this->db->idate($this->periode)."'"; - $sql .= ", '".price2num($newamount)."'"; + $sql .= ", '".price2num($newamount)."'"; $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 'NULL'); - $sql .= ", ".$conf->entity; - $sql .= ", ".$user->id; - $sql .= ", '".$this->db->idate($now)."'"; - $sql .= ")"; + $sql .= ", ".$conf->entity; + $sql .= ", ".$user->id; + $sql .= ", '".$this->db->idate($now)."'"; + $sql .= ")"; - dol_syslog(get_class($this)."::create", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales"); + dol_syslog(get_class($this)."::create", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."chargesociales"); - //dol_syslog("ChargesSociales::create this->id=".$this->id); + //dol_syslog("ChargesSociales::create this->id=".$this->id); $result = $this->call_trigger('SOCIALCONTRIBUTION_CREATE', $user); if ($result < 0) $error++; @@ -252,429 +252,429 @@ class ChargeSociales extends CommonObject $this->db->rollback(); return -1 * $error; } - } else { - $this->error = $this->db->error(); - $this->db->rollback(); - return -1; - } - } + } else { + $this->error = $this->db->error(); + $this->db->rollback(); + return -1; + } + } - /** - * Delete a social contribution - * - * @param User $user Object user making delete - * @return int <0 if KO, >0 if OK - */ - public function delete($user) - { - $error = 0; + /** + * Delete a social contribution + * + * @param User $user Object user making delete + * @return int <0 if KO, >0 if OK + */ + public function delete($user) + { + $error = 0; - $this->db->begin(); + $this->db->begin(); - // Get bank transaction lines for this social contributions - include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $account = new Account($this->db); - $lines_url = $account->get_url('', $this->id, 'sc'); + // Get bank transaction lines for this social contributions + include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $account = new Account($this->db); + $lines_url = $account->get_url('', $this->id, 'sc'); - // Delete bank urls - foreach ($lines_url as $line_url) - { - if (!$error) - { - $accountline = new AccountLine($this->db); - $accountline->fetch($line_url['fk_bank']); - $result = $accountline->delete_urls($user); - if ($result < 0) - { - $error++; - } - } - } + // Delete bank urls + foreach ($lines_url as $line_url) + { + if (!$error) + { + $accountline = new AccountLine($this->db); + $accountline->fetch($line_url['fk_bank']); + $result = $accountline->delete_urls($user); + if ($result < 0) + { + $error++; + } + } + } - // Delete payments - if (!$error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge WHERE fk_charge=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) - { - $error++; - $this->error = $this->db->lasterror(); - } - } + // Delete payments + if (!$error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge WHERE fk_charge=".$this->id; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) + { + $error++; + $this->error = $this->db->lasterror(); + } + } - if (!$error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) - { - $error++; - $this->error = $this->db->lasterror(); - } - } + if (!$error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales WHERE rowid=".$this->id; + dol_syslog(get_class($this)."::delete", LOG_DEBUG); + $resql = $this->db->query($sql); + if (!$resql) + { + $error++; + $this->error = $this->db->lasterror(); + } + } - if (!$error) - { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - return -1; - } - } + if (!$error) + { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + return -1; + } + } - /** - * Update social or fiscal contribution - * - * @param User $user User that modify - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int <0 if KO, >0 if OK - */ - public function update($user, $notrigger = 0) - { - $error = 0; - $this->db->begin(); + /** + * Update social or fiscal contribution + * + * @param User $user User that modify + * @param int $notrigger 0=launch triggers after, 1=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update($user, $notrigger = 0) + { + $error = 0; + $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; - $sql .= " SET libelle='".$this->db->escape($this->label ? $this->label : $this->lib)."'"; - $sql .= ", date_ech='".$this->db->idate($this->date_ech)."'"; - $sql .= ", periode='".$this->db->idate($this->periode)."'"; - $sql .= ", amount='".price2num($this->amount, 'MT')."'"; - $sql .= ", fk_projet=".($this->fk_project > 0 ? $this->db->escape($this->fk_project) : "NULL"); - $sql .= ", fk_user_modif=".$user->id; - $sql .= " WHERE rowid=".$this->id; + $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales"; + $sql .= " SET libelle='".$this->db->escape($this->label ? $this->label : $this->lib)."'"; + $sql .= ", date_ech='".$this->db->idate($this->date_ech)."'"; + $sql .= ", periode='".$this->db->idate($this->periode)."'"; + $sql .= ", amount='".price2num($this->amount, 'MT')."'"; + $sql .= ", fk_projet=".($this->fk_project > 0 ? $this->db->escape($this->fk_project) : "NULL"); + $sql .= ", fk_user_modif=".$user->id; + $sql .= " WHERE rowid=".$this->id; - dol_syslog(get_class($this)."::update", LOG_DEBUG); - $resql = $this->db->query($sql); + dol_syslog(get_class($this)."::update", LOG_DEBUG); + $resql = $this->db->query($sql); - if (!$resql) { - $error++; $this->errors[] = "Error ".$this->db->lasterror(); - } + if (!$resql) { + $error++; $this->errors[] = "Error ".$this->db->lasterror(); + } - if (!$error) - { - if (!$notrigger) - { - // Call trigger - $result = $this->call_trigger('SOCIALCHARGES_MODIFY', $user); - if ($result < 0) $error++; - // End call triggers - } - } + if (!$error) + { + if (!$notrigger) + { + // Call trigger + $result = $this->call_trigger('SOCIALCHARGES_MODIFY', $user); + if ($result < 0) $error++; + // End call triggers + } + } - // Commit or rollback - if ($error) - { - foreach ($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } else { - $this->db->commit(); - return 1; - } - } + // Commit or rollback + if ($error) + { + foreach ($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } + $this->db->rollback(); + return -1 * $error; + } else { + $this->db->commit(); + return 1; + } + } - /** - * Calculate amount remaining to pay by year - * - * @param int $year Year - * @return number - */ - public function solde($year = 0) - { - global $conf; + /** + * Calculate amount remaining to pay by year + * + * @param int $year Year + * @return number + */ + public function solde($year = 0) + { + global $conf; - $sql = "SELECT SUM(f.amount) as amount"; - $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f"; - $sql .= " WHERE f.entity = ".$conf->entity; - $sql .= " AND paye = 0"; + $sql = "SELECT SUM(f.amount) as amount"; + $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as f"; + $sql .= " WHERE f.entity = ".$conf->entity; + $sql .= " AND paye = 0"; - if ($year) { - $sql .= " AND f.datev >= '$y-01-01' AND f.datev <= '$y-12-31' "; - } + if ($year) { + $sql .= " AND f.datev >= '".((int) $year)."-01-01' AND f.datev <= '".((int) $year)."-12-31' "; + } - $result = $this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); - $this->db->free($result); - return $obj->amount; - } else { - return 0; - } - } else { - print $this->db->error(); - return -1; - } - } + $result = $this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->db->free($result); + return $obj->amount; + } else { + return 0; + } + } else { + print $this->db->error(); + return -1; + } + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Tag social contribution as payed completely - * - * @param User $user Object user making change - * @return int <0 if KO, >0 if OK - */ - public function set_paid($user) - { - // phpcs:enable - $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; - $sql .= " paye = 1"; - $sql .= " WHERE rowid = ".$this->id; - $return = $this->db->query($sql); - if ($return) return 1; - else return -1; - } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Tag social contribution as payed completely + * + * @param User $user Object user making change + * @return int <0 if KO, >0 if OK + */ + public function set_paid($user) + { + // phpcs:enable + $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; + $sql .= " paye = 1"; + $sql .= " WHERE rowid = ".$this->id; + $return = $this->db->query($sql); + if ($return) return 1; + else return -1; + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Remove tag payed on social contribution - * - * @param User $user Object user making change - * @return int <0 if KO, >0 if OK - */ - public function set_unpaid($user) - { - // phpcs:enable - $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; - $sql .= " paye = 0"; - $sql .= " WHERE rowid = ".$this->id; - $return = $this->db->query($sql); - if ($return) return 1; - else return -1; - } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Remove tag payed on social contribution + * + * @param User $user Object user making change + * @return int <0 if KO, >0 if OK + */ + public function set_unpaid($user) + { + // phpcs:enable + $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; + $sql .= " paye = 0"; + $sql .= " WHERE rowid = ".$this->id; + $return = $this->db->query($sql); + if ($return) return 1; + else return -1; + } - /** - * Retourne le libelle du statut d'une charge (impaye, payee) - * - * @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 + /** + * Retourne le libelle du statut d'une charge (impaye, payee) + * + * @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 * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) - * @return string Label - */ - public function getLibStatut($mode = 0, $alreadypaid = -1) - { - return $this->LibStatut($this->paye, $mode, $alreadypaid); - } + * @return string Label + */ + public function getLibStatut($mode = 0, $alreadypaid = -1) + { + return $this->LibStatut($this->paye, $mode, $alreadypaid); + } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Renvoi le libelle d'un statut donne - * - * @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 + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Renvoi le libelle d'un statut donne + * + * @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 * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) - * @return string Label - */ - public function LibStatut($status, $mode = 0, $alreadypaid = -1) - { - // phpcs:enable - global $langs; + * @return string Label + */ + public function LibStatut($status, $mode = 0, $alreadypaid = -1) + { + // phpcs:enable + global $langs; - // Load translation files required by the page - $langs->loadLangs(array("customers", "bills")); + // Load translation files required by the page + $langs->loadLangs(array("customers", "bills")); - // We reinit status array to force to redefine them because label may change according to properties values. - $this->labelStatus = array(); - $this->labelStatusShort = array(); + // We reinit status array to force to redefine them because label may change according to properties values. + $this->labelStatus = array(); + $this->labelStatusShort = array(); - if (empty($this->labelStatus) || empty($this->labelStatusShort)) - { - global $langs; - //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); - if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); - $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid'); - $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Paid'); - if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); - } + if (empty($this->labelStatus) || empty($this->labelStatusShort)) + { + global $langs; + //$langs->load("mymodule"); + $this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid'); + $this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid'); + if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid'); + $this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Paid'); + if ($status == self::STATUS_UNPAID && $alreadypaid > 0) $this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted"); + } - $statusType = 'status1'; - if ($status == 0 && $alreadypaid > 0) $statusType = 'status3'; - if ($status == 1) $statusType = 'status6'; + $statusType = 'status1'; + if ($status == 0 && $alreadypaid > 0) $statusType = 'status3'; + if ($status == 1) $statusType = 'status6'; - return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); - } + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } - /** + /** * 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 int $maxlen Max length of label - * @param int $notooltip 1=Disable tooltip + * @param int $maxlen Max length of label + * @param int $notooltip 1=Disable tooltip * @param int $short 1=Return just URL - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @return string String with link - */ - public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $short = 0, $save_lastsearch_value = -1) - { - global $langs, $conf, $user, $form; + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with link + */ + public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $short = 0, $save_lastsearch_value = -1) + { + global $langs, $conf, $user, $form; - if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips + if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips - $result = ''; + $result = ''; - $url = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id; + $url = DOL_URL_ROOT.'/compta/sociales/card.php?id='.$this->id; - if ($short) return $url; + if ($short) return $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'; - } + 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'; + } - if (empty($this->ref)) $this->ref = $this->label; + if (empty($this->ref)) $this->ref = $this->label; - $label = ''.$langs->trans("SocialContribution").''; - if (!empty($this->ref)) - $label .= '
'.$langs->trans('Ref').': '.$this->ref; - if (!empty($this->label)) - $label .= '
'.$langs->trans('Label').': '.$this->label; - if (!empty($this->type_label)) - $label .= '
'.$langs->trans('Type').': '.$this->type_label; + $label = ''.$langs->trans("SocialContribution").''; + if (!empty($this->ref)) + $label .= '
'.$langs->trans('Ref').': '.$this->ref; + if (!empty($this->label)) + $label .= '
'.$langs->trans('Label').': '.$this->label; + if (!empty($this->type_label)) + $label .= '
'.$langs->trans('Type').': '.$this->type_label; - $linkclose = ''; - if (empty($notooltip) && $user->rights->facture->lire) - { - if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $label = $langs->trans("SocialContribution"); - $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; - } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip"'; - } + $linkclose = ''; + if (empty($notooltip) && $user->rights->facture->lire) + { + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label = $langs->trans("SocialContribution"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip"'; + } - $linkstart = ''; - $linkend = ''; + $linkstart = ''; + $linkend = ''; - $result .= $linkstart; - if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); - if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref); - $result .= $linkend; + $result .= $linkstart; + if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); + if ($withpicto != 2) $result .= ($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref); + $result .= $linkend; - return $result; - } + return $result; + } - /** - * Return amount of payments already done - * - * @return int Amount of payment already done, <0 if KO - */ - public function getSommePaiement() - { - $table = 'paiementcharge'; - $field = 'fk_charge'; + /** + * Return amount of payments already done + * + * @return int Amount of payment already done, <0 if KO + */ + public function getSommePaiement() + { + $table = 'paiementcharge'; + $field = 'fk_charge'; - $sql = 'SELECT sum(amount) as amount'; - $sql .= ' FROM '.MAIN_DB_PREFIX.$table; - $sql .= ' WHERE '.$field.' = '.$this->id; + $sql = 'SELECT sum(amount) as amount'; + $sql .= ' FROM '.MAIN_DB_PREFIX.$table; + $sql .= ' WHERE '.$field.' = '.$this->id; - dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); - $resql = $this->db->query($sql); - if ($resql) { - $amount = 0; + dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); + $resql = $this->db->query($sql); + if ($resql) { + $amount = 0; - $obj = $this->db->fetch_object($resql); - if ($obj) $amount = $obj->amount ? $obj->amount : 0; + $obj = $this->db->fetch_object($resql); + if ($obj) $amount = $obj->amount ? $obj->amount : 0; - $this->db->free($resql); - return $amount; - } else { - return -1; - } - } + $this->db->free($resql); + return $amount; + } else { + return -1; + } + } - /** - * Charge les informations d'ordre info dans l'objet entrepot - * - * @param int $id Id of social contribution - * @return int <0 if KO, >0 if OK - */ - public function info($id) - { - $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,"; - $sql .= " e.fk_user_author, e.fk_user_modif, e.fk_user_valid"; + /** + * Charge les informations d'ordre info dans l'objet entrepot + * + * @param int $id Id of social contribution + * @return int <0 if KO, >0 if OK + */ + public function info($id) + { + $sql = "SELECT e.rowid, e.tms as datem, e.date_creation as datec, e.date_valid as datev, e.import_key,"; + $sql .= " e.fk_user_author, e.fk_user_modif, e.fk_user_valid"; $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as e"; - $sql .= " WHERE e.rowid = ".$id; + $sql .= " WHERE e.rowid = ".$id; - dol_syslog(get_class($this)."::info", LOG_DEBUG); - $result = $this->db->query($sql); - if ($result) - { - if ($this->db->num_rows($result)) - { - $obj = $this->db->fetch_object($result); + dol_syslog(get_class($this)."::info", LOG_DEBUG); + $result = $this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; + $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_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } - if ($obj->fk_user_modif) { - $muser = new User($this->db); - $muser->fetch($obj->fk_user_modif); - $this->user_modification = $muser; - } + if ($obj->fk_user_modif) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_modification = $muser; + } - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } + if ($obj->fk_user_valid) { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } - $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->import_key = $obj->import_key; - } + $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->import_key = $obj->import_key; + } - $this->db->free($result); - } else { - dol_print_error($this->db); - } - } + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } - /** - * Initialise an instance with random values. - * Used to build previews or test instances. - * id must be 0 if object instance is a specimen. - * - * @return void - */ - public function initAsSpecimen() - { - // Initialize parameters - $this->id = 0; - $this->ref = 'SPECIMEN'; - $this->specimen = 1; - $this->paye = 0; - $this->date = dol_now(); - $this->date_ech = $this->date + 3600 * 24 * 30; - $this->periode = $this->date + 3600 * 24 * 30; - $this->amount = 100; - $this->label = 'Social contribution label'; - $this->type = 1; - $this->type_label = 'Type of social contribution'; - } + /** + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void + */ + public function initAsSpecimen() + { + // Initialize parameters + $this->id = 0; + $this->ref = 'SPECIMEN'; + $this->specimen = 1; + $this->paye = 0; + $this->date = dol_now(); + $this->date_ech = $this->date + 3600 * 24 * 30; + $this->periode = $this->date + 3600 * 24 * 30; + $this->amount = 100; + $this->label = 'Social contribution label'; + $this->type = 1; + $this->type_label = 'Type of social contribution'; + } } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index e7d76b94a76..eea97c13a1d 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -105,7 +105,7 @@ if ($object->id) $head = tax_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("SocialContribution"), -1, 'bill'); + print dol_get_fiche_head($head, 'documents', $langs->trans("SocialContribution"), -1, 'bill'); $morehtmlref = '
'; // Label of social contribution @@ -156,7 +156,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'tax'; $permission = $user->rights->tax->charges->creer; diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index d577792023c..71e49486888 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -75,7 +75,7 @@ $object->info($id); $head = tax_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill'); +print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill'); $morehtmlref = '
'; // Label of social contribution diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 8b6caa89a8f..33e69c3cf4c 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -281,7 +281,7 @@ if ($modecompta != 'CREANCES-DETTES') { } } -$morefilter = ''; +$moreforfilter = ''; print '
'; print ''."\n"; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index a39e14466eb..7e7f236b3ab 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -244,7 +244,7 @@ if ($action == 'create') print ''; print "
\n"; - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; @@ -293,7 +293,7 @@ if ($action == 'create') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -309,7 +309,7 @@ if ($id) { $head = vat_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); $morehtmlref = '
'; // Label of social contribution @@ -369,7 +369,7 @@ if ($id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); /* * Action buttons diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 830dfb78d3a..10efd84288c 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -106,7 +106,7 @@ if ($object->id) $head = vat_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'documents', $langs->trans("VATPayment"), -1, 'payment'); $morehtmlref = '
'; // Label of social contribution @@ -142,7 +142,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $permission = $user->rights->tax->charges->creer; $permtoedit = $user->rights->fournisseur->facture->creer; diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index 5ef3956bd35..ddabf6e2b49 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -68,7 +68,7 @@ $object->info($id); $head = vat_prepare_head($object); -dol_fiche_head($head, 'info', $langs->trans("VATPayment"), -1, 'payment'); +print dol_get_fiche_head($head, 'info', $langs->trans("VATPayment"), -1, 'payment'); $morehtmlref = '
'; // Label of social contribution @@ -89,7 +89,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); llxFooter(); diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 23a6042fbf9..95ec50be24f 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -200,7 +200,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) dol_htmloutput_errors($error, $errors); - dol_fiche_head($head, 'agenda', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'agenda', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -227,7 +227,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); // Actions buttons diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index e4e7ecaf5fb..b4406207977 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -611,7 +611,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; } - dol_fiche_head($head, 'card', '', 0, ''); + print dol_get_fiche_head($head, 'card', '', 0, ''); print ''; @@ -873,7 +873,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -940,7 +940,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print ''; if (!empty($backtopage)) print ''; - dol_fiche_head($head, 'card', $title, 0, 'contact'); + print dol_get_fiche_head($head, 'card', $title, 0, 'contact'); print ''; @@ -1237,7 +1237,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -1263,7 +1263,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) // Show errors dol_htmloutput_errors(is_numeric($error) ? '' : $error, $errors); - dol_fiche_head($head, 'card', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'card', $title, -1, 'contact'); if ($action == 'create_user') { @@ -1482,7 +1482,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) print '
'; print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); // Barre d'actions print '
'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 91a32f39f26..ab6e3c732c9 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -987,7 +987,7 @@ class Contact extends CommonObject return -1; } - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 7655e00ea3f..d3992296aec 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -106,7 +106,7 @@ if (empty($id)) } $head = contact_prepare_head($object); -dol_fiche_head($head, 'consumption', $langs->trans("ContactsAddresses"), -1, 'contact'); +print dol_get_fiche_head($head, 'consumption', $langs->trans("ContactsAddresses"), -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -158,7 +158,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); print '
'; diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index f8498ddae9a..8a70ec6e2df 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -99,7 +99,7 @@ if ($object->id) $head = contact_prepare_head($object); $title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses")); - dol_fiche_head($head, 'documents', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'documents', $title, -1, 'contact'); // Build file list @@ -162,7 +162,7 @@ if ($object->id) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'contact'; $permission = $user->rights->societe->contact->creer; diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index 68fe24d0044..c39c20d3d25 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -60,7 +60,7 @@ if ($id > 0) $head = contact_prepare_head($object); - dol_fiche_head($head, 'info', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'info', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -77,7 +77,7 @@ if ($id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } llxFooter(); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index f601086ad05..68d810967ad 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -86,7 +86,7 @@ llxHeader('', $title, 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Módulo_ $head = contact_prepare_head($object); -dol_fiche_head($head, 'ldap', $title, -1, 'contact'); +print dol_get_fiche_head($head, 'ldap', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -130,7 +130,7 @@ print ''; print '
'; -dol_fiche_end(); +print dol_get_fiche_end(); /* diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 572664890e1..478288046e1 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -74,7 +74,7 @@ if ($id > 0) $head = contact_prepare_head($object); - dol_fiche_head($head, 'note', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'note', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -114,7 +114,7 @@ if ($id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } llxFooter(); diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 1710b4dda6a..bbaf013efa1 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2018 Frédéric France + * 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 @@ -66,9 +66,9 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- if ($file_OK) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; if (GETPOST('deletephoto')) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $fileimg = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/'.$object->photo; $dirthumbs = $conf->societe->dir_output.'/contact/'.get_exdir($object->id, 0, 0, 1, $object, 'contact').'/photos/thumbs'; dol_delete_file($fileimg); @@ -134,12 +134,12 @@ if ($action == 'edit') * Fiche en mode edition */ - print ''; + print ''; print ''; print ''; print ''; - dol_fiche_head($head, 'perso', $title, 0, 'contact'); + print dol_get_fiche_head($head, 'perso', $title, 0, 'contact'); print ''; @@ -204,7 +204,7 @@ if ($action == 'edit') print "
"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -216,7 +216,7 @@ if ($action == 'edit') } else { // View mode - dol_fiche_head($head, 'perso', $title, -1, 'contact'); + print dol_get_fiche_head($head, 'perso', $title, -1, 'contact'); $linkback = ''.$langs->trans("BackToList").''; @@ -296,7 +296,7 @@ if ($action == 'edit') print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 5343ab8f349..8571856362a 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup' $head = contract_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("Contracts"), -1, 'contract'); +print dol_get_fiche_head($head, 'attributes', $langs->trans("Contracts"), -1, 'contract'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index bd0c7b132d0..4b3f03ffedf 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -70,11 +70,11 @@ print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup' $head = contract_admin_prepare_head(); -dol_fiche_head($head, 'attributeslines', $langs->trans("Contracts"), -1, 'contract'); +print dol_get_fiche_head($head, 'attributeslines', $langs->trans("Contracts"), -1, 'contract'); require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php'; -dol_fiche_end(); +print dol_get_fiche_end(); // Buttons diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index d016cb23d75..f88b470215c 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -132,7 +132,7 @@ if ($id > 0) if (!empty($conf->notification->enabled)) $langs->load("mails"); $head = contract_prepare_head($object); - dol_fiche_head($head, 'agenda', $langs->trans("Contract"), -1, 'contract'); + print dol_get_fiche_head($head, 'agenda', $langs->trans("Contract"), -1, 'contract'); $linkback = ''.$langs->trans("BackToList").''; @@ -204,7 +204,7 @@ if ($id > 0) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index b6e77e69dca..1187571d2d0 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1092,7 +1092,7 @@ if ($action == 'create') print ''."\n"; print ''; - dol_fiche_head(); + print dol_get_fiche_head(); print ''; @@ -1197,7 +1197,7 @@ if ($action == 'create') print "
\n"; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; print ''; @@ -1252,7 +1252,7 @@ if ($action == 'create') $hselected = 0; $formconfirm = ''; - dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); if ($action == 'delete') { @@ -2015,7 +2015,7 @@ if ($action == 'create') print ''; } - dol_fiche_end(); + print dol_get_fiche_end(); /* diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 671ac1177f6..b5a9bd91cf4 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -438,7 +438,7 @@ class Contracts extends DolibarrApi * * @url DELETE {id}/lines/{lineid} * - * @return int + * @return array|mixed * * @throws RestException 401 * @throws RestException 404 @@ -474,7 +474,7 @@ class Contracts extends DolibarrApi * @param int $id Id of contract to update * @param array $request_data Datas * - * @return int + * @return array|mixed */ public function put($id, $request_data = null) { @@ -495,8 +495,7 @@ class Contracts extends DolibarrApi $this->contract->$field = $value; } - if ($this->contract->update(DolibarrApiAccess::$user) > 0) - { + if ($this->contract->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); } else { throw new RestException(500, $this->contract->error); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f25d0ba69ef..f31901c5ccd 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -891,7 +891,7 @@ class Contrat extends CommonObject $line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); $line->date_fin_reel = $this->db->jdate($objp->date_cloture); - // Retreive all extrafields for contract + // Retrieve all extrafields for contract // fetch optionals attributes and labels $line->fetch_optionals(); @@ -928,7 +928,7 @@ class Contrat extends CommonObject $this->nbofservices = count($this->lines); $this->total_ttc = price2num($total_ttc); // TODO For the moment value is false as value is not stored in database for line linked to products - $this->total_vat = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products + $this->total_tva = price2num($total_vat); // TODO For the moment value is false as value is not stored in database for line linked to products $this->total_ht = price2num($total_ht); // TODO For the moment value is false as value is not stored in database for line linked to products return $this->lines; @@ -1905,12 +1905,12 @@ class Contrat extends CommonObject { global $langs; $langs->load("contracts"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('ContractStatusDraft'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('ContractStatusValidated'); - $this->labelStatus[self::STATUS_CLOSED] = $langs->trans('ContractStatusClosed'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('ContractStatusDraft'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('ContractStatusValidated'); - $this->labelStatusShort[self::STATUS_CLOSED] = $langs->trans('ContractStatusClosed'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ContractStatusDraft'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('ContractStatusValidated'); + $this->labelStatus[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('ContractStatusClosed'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ContractStatusDraft'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('ContractStatusValidated'); + $this->labelStatusShort[self::STATUS_CLOSED] = $langs->transnoentitiesnoconv('ContractStatusClosed'); } $statusType = 'status'.$status; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 38a97d0aaa8..4f69d5a2c56 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -134,7 +134,7 @@ if ($id > 0 || !empty($ref)) $hselected = 1; - dol_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); + print dol_get_fiche_head($head, $hselected, $langs->trans("Contract"), -1, 'contract'); // Contract card @@ -230,7 +230,7 @@ if ($id > 0 || !empty($ref)) print '
'; - dol_fiche_end(); + print dol_get_fiche_end(); print '
'; diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index d60d54258bb..759c2080930 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -101,7 +101,7 @@ if ($object->id) { $head = contract_prepare_head($object); - dol_fiche_head($head, 'documents', $langs->trans("Contract"), -1, 'contract'); + print dol_get_fiche_head($head, 'documents', $langs->trans("Contract"), -1, 'contract'); // Build file list @@ -186,7 +186,7 @@ if ($object->id) print ''; - dol_fiche_end(); + print dol_get_fiche_end(); $modulepart = 'contract'; $permission = $user->rights->contrat->creer; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index d9eb8e3ccdc..0368340bffd 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -78,7 +78,7 @@ if ($id > 0 || !empty($ref)) $hselected = 2; - dol_fiche_head($head, 'note', $langs->trans("Contract"), -1, 'contract'); + print dol_get_fiche_head($head, 'note', $langs->trans("Contract"), -1, 'contract'); // Contract card @@ -176,7 +176,7 @@ if ($id > 0 || !empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - dol_fiche_end(); + print dol_get_fiche_end(); } diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 219d35e46fb..45f0fb8613e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -75,6 +75,9 @@ if ($action == 'add' && !empty($permissiontoadd)) $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { $value = ((GETPOST($key) == '1' || GETPOST($key) == 'on') ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $tmparraykey = array_keys($object->param_list); + $value = $tmparraykey[GETPOST($key)].','.GETPOST($key.'2'); } else { $value = GETPOST($key, 'alphanohtml'); } @@ -162,6 +165,8 @@ if ($action == 'update' && !empty($permissiontoadd)) $value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($object->fields[$key]['type'] == 'boolean') { $value = ((GETPOST($key, 'aZ09') == 'on' || GETPOST($key, 'aZ09') == '1') ? 1 : 0); + } elseif ($object->fields[$key]['type'] == 'reference') { + $value = array_keys($object->param_list)[GETPOST($key)].','.GETPOST($key.'2'); } else { $value = GETPOST($key, 'alpha'); } diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index e88fc937e38..3137c93a9c5 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -33,18 +33,24 @@ if ($action == 'print_file' && $user->rights->printing->read) { require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/modules_printing.php'; $objectprint = new PrintingDriver($db); $list = $objectprint->listDrivers($db, 10); + $dirmodels = array_merge(array('/core/modules/printing/'), (array) $conf->modules_parts['printing']); if (!empty($list)) { $errorprint = 0; $printerfound = 0; foreach ($list as $driver) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; - $langs->load($driver); + foreach ($dirmodels as $dir) { + if (file_exists(dol_buildpath($dir, 0).$driver.'.modules.php')) { + $classfile = dol_buildpath($dir, 0).$driver.'.modules.php'; + break; + } + } + require_once $classfile; $classname = 'printing_'.$driver; $printer = new $classname($db); + $langs->load($printer::LANGFILE); //print '
'.print_r($printer, true).'
'; - if (!empty($conf->global->{$printer->active})) - { + if (!empty($conf->global->{$printer->active})) { $printerfound++; $subdir = ''; diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 196656b983f..f3c72257670 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -473,12 +473,16 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST } else { $langs->load("other"); $mesg = '
'; - if ($mailfile->error) - { + if ($mailfile->error) { $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto)); $mesg .= '
'.$mailfile->error; } else { - $mesg .= 'No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto));; + if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { + $mesg .= '
Feature is disabled by option MAIN_DISABLE_ALL_MAILS'; + } else { + $mesg .= '
Unkown Error, please refers to your administrator'; + } } $mesg .= '
'; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 87b3a903343..69dd65b868e 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -82,7 +82,7 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); + $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index 2b2d8418e47..2ca1fb3ae25 100644 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -86,10 +86,10 @@ class box_members extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max)); - if ($user->rights->adherent->lire) - { + if ($user->rights->adherent->lire) { $sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,"; $sql .= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,"; + $sql .= ' a.photo, a.email, a.gender, a.morphy,'; $sql .= " t.subscription"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t"; $sql .= " WHERE a.entity IN (".getEntity('member').")"; @@ -98,13 +98,11 @@ class box_members extends ModeleBoxes $sql .= $this->db->plimit($max, 0); $result = $this->db->query($sql); - if ($result) - { + if ($result) { $num = $this->db->num_rows($result); $line = 0; - while ($line < $num) - { + while ($line < $num) { $objp = $this->db->fetch_object($result); $datec = $this->db->jdate($objp->datec); $datem = $this->db->jdate($objp->tms); @@ -113,6 +111,10 @@ class box_members extends ModeleBoxes $memberstatic->firstname = $objp->firstname; $memberstatic->id = $objp->rowid; $memberstatic->ref = $objp->rowid; + $memberstatic->photo = $objp->photo; + $memberstatic->gender = $objp->gender; + $memberstatic->email = $objp->email; + $memberstatic->morphy = $objp->morphy; $memberstatic->company = $objp->company; if (!empty($objp->fk_soc)) { @@ -125,7 +127,7 @@ class box_members extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"', - 'text' => $memberstatic->getNomUrl(1), + 'text' => $memberstatic->getNomUrl(-1), 'asis' => 1, ); diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index f87fbd7b282..a5a1c4bea8a 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -125,8 +125,7 @@ class box_services_contracts extends ModeleBoxes $contractlinestatic->type = $objp->type; $contractlinestatic->product_id = $objp->product_id; $contractlinestatic->product_ref = $objp->product_ref; - $contratlignestatic->product_type = $objp->product_type; - + $contractlinestatic->product_type = $objp->product_type; $contractlinestatic->statut = $objp->contractline_status; $contractstatic->id = $objp->rowid; diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 54b8955d519..bc86591fc22 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -112,10 +112,10 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $date = $this->db->jdate($objp->date_commande); - $date_livraison = $this->db->jdate($objp->date_livraison); + $delivery_date = $this->db->jdate($objp->date_livraison); $datem = $this->db->jdate($objp->tms); - $supplierorderstatic->date_livraison = $date_livraison; + $supplierorderstatic->date_livraison = $delivery_date; $supplierorderstatic->statut = $objp->fk_statut; $supplierorderstatic->id = $objp->rowid; @@ -152,7 +152,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.dol_print_date($date_livraison, 'day').'', + 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day').'', 'asis' => 1 ); diff --git a/htdocs/core/class/commonincoterm.class.php b/htdocs/core/class/commonincoterm.class.php index b2d5491684e..f98f3aaabad 100644 --- a/htdocs/core/class/commonincoterm.class.php +++ b/htdocs/core/class/commonincoterm.class.php @@ -105,7 +105,7 @@ trait CommonIncoterm * * @param int $id_incoterm Id of incoterm to set or '' to remove * @param string $location location of incoterm - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ public function setIncoterms($id_incoterm, $location) { diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 920dd42f515..c278eaeedb7 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -33,36 +33,36 @@ abstract class CommonInvoice extends CommonObject { use CommonIncoterm; - /** - * Standard invoice - */ - const TYPE_STANDARD = 0; + /** + * Standard invoice + */ + const TYPE_STANDARD = 0; - /** - * Replacement invoice - */ - const TYPE_REPLACEMENT = 1; + /** + * Replacement invoice + */ + const TYPE_REPLACEMENT = 1; - /** - * Credit note invoice - */ - const TYPE_CREDIT_NOTE = 2; + /** + * Credit note invoice + */ + const TYPE_CREDIT_NOTE = 2; - /** - * Deposit invoice - */ - const TYPE_DEPOSIT = 3; + /** + * Deposit invoice + */ + const TYPE_DEPOSIT = 3; - /** - * Proforma invoice. - * @deprectad Remove this. A "proforma invoice" is an order with a look of invoice, not an invoice ! - */ - const TYPE_PROFORMA = 4; + /** + * Proforma invoice. + * @deprectad Remove this. A "proforma invoice" is an order with a look of invoice, not an invoice ! + */ + const TYPE_PROFORMA = 4; - /** - * Situation invoice - */ - const TYPE_SITUATION = 5; + /** + * Situation invoice + */ + const TYPE_SITUATION = 5; /** * Draft status @@ -98,20 +98,20 @@ abstract class CommonInvoice extends CommonObject * This does not include open direct debit requests. * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return double Remain of amount to pay + * @return float Remain of amount to pay */ public function getRemainToPay($multicurrency = 0) { - $alreadypaid = 0; - $alreadypaid += $this->getSommePaiement($multicurrency); - $alreadypaid += $this->getSumDepositsUsed($multicurrency); - $alreadypaid += $this->getSumCreditNotesUsed($multicurrency); + $alreadypaid = 0.0; + $alreadypaid += $this->getSommePaiement($multicurrency); + $alreadypaid += $this->getSumDepositsUsed($multicurrency); + $alreadypaid += $this->getSumCreditNotesUsed($multicurrency); - $remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT'); - if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment - $remaintopay = 0; - } - return $remaintopay; + $remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT'); + if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment + $remaintopay = 0.0; + } + return $remaintopay; } /** @@ -119,7 +119,7 @@ abstract class CommonInvoice extends CommonObject * Payments dones using discounts, credit notes, etc are not included. * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return int Amount of payment already done, <0 if KO + * @return float Amount of payment already done, <0 if KO */ public function getSommePaiement($multicurrency = 0) { @@ -151,72 +151,69 @@ abstract class CommonInvoice extends CommonObject /** * Return amount (with tax) of all deposits invoices used by invoice. - * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). + * Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended). * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return int <0 if KO, Sum of deposits amount otherwise + * @return float <0 if KO, Sum of deposits amount otherwise */ public function getSumDepositsUsed($multicurrency = 0) { if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') - { - // TODO - return 0; - } + { + // TODO + return 0.0; + } - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $discountstatic = new DiscountAbsolute($this->db); - $result = $discountstatic->getSumDepositsUsed($this, $multicurrency); - if ($result >= 0) - { - return $result; - } else { - $this->error = $discountstatic->error; - return -1; - } + $discountstatic = new DiscountAbsolute($this->db); + $result = $discountstatic->getSumDepositsUsed($this, $multicurrency); + if ($result >= 0) { + return $result; + } else { + $this->error = $discountstatic->error; + return -1; + } } /** * Return amount (with tax) of all credit notes invoices + excess received used by invoice * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + * @return float <0 if KO, Sum of credit notes and deposits amount otherwise */ public function getSumCreditNotesUsed($multicurrency = 0) { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $discountstatic = new DiscountAbsolute($this->db); - $result = $discountstatic->getSumCreditNotesUsed($this, $multicurrency); - if ($result >= 0) - { - return $result; - } else { - $this->error = $discountstatic->error; - return -1; - } + $discountstatic = new DiscountAbsolute($this->db); + $result = $discountstatic->getSumCreditNotesUsed($this, $multicurrency); + if ($result >= 0) { + return $result; + } else { + $this->error = $discountstatic->error; + return -1; + } } /** * Return amount (with tax) of all converted amount for this credit note * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return int <0 if KO, Sum of credit notes and deposits amount otherwise + * @return float <0 if KO, Sum of credit notes and deposits amount otherwise */ public function getSumFromThisCreditNotesNotUsed($multicurrency = 0) { - require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; - $discountstatic = new DiscountAbsolute($this->db); - $result = $discountstatic->getSumFromThisCreditNotesNotUsed($this, $multicurrency); - if ($result >= 0) - { - return $result; - } else { - $this->error = $discountstatic->error; - return -1; - } + $discountstatic = new DiscountAbsolute($this->db); + $result = $discountstatic->getSumFromThisCreditNotesNotUsed($this, $multicurrency); + if ($result >= 0) { + return $result; + } else { + $this->error = $discountstatic->error; + return -1; + } } /** @@ -332,7 +329,7 @@ abstract class CommonInvoice extends CommonObject $obj = $this->db->fetch_object($resql); $tmp = array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref); if (!empty($field3)) { - $tmp['ref_ext'] = $obj->ref_ext; + $tmp['ref_ext'] = $obj->ref_ext; } $retarray[]=$tmp; $i++; @@ -388,7 +385,7 @@ abstract class CommonInvoice extends CommonObject } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return if an invoice can be deleted * Rule is: @@ -402,9 +399,9 @@ abstract class CommonInvoice extends CommonObject * * @return int <=0 if no, >0 if yes */ - public function is_erasable() - { - // phpcs:enable + public function is_erasable() + { + // phpcs:enable global $conf; // We check if invoice is a temporary number (PROVxxxx) @@ -489,15 +486,15 @@ abstract class CommonInvoice extends CommonObject * * @return string Label of type of invoice */ - public function getLibType() + public function getLibType() { global $langs; - if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); - elseif ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); - elseif ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); - elseif ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); - elseif ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); // Not used. - elseif ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); + if ($this->type == CommonInvoice::TYPE_STANDARD) return $langs->trans("InvoiceStandard"); + elseif ($this->type == CommonInvoice::TYPE_REPLACEMENT) return $langs->trans("InvoiceReplacement"); + elseif ($this->type == CommonInvoice::TYPE_CREDIT_NOTE) return $langs->trans("InvoiceAvoir"); + elseif ($this->type == CommonInvoice::TYPE_DEPOSIT) return $langs->trans("InvoiceDeposit"); + elseif ($this->type == CommonInvoice::TYPE_PROFORMA) return $langs->trans("InvoiceProForma"); // Not used. + elseif ($this->type == CommonInvoice::TYPE_SITUATION) return $langs->trans("InvoiceSituation"); return $langs->trans("Unknown"); } @@ -513,7 +510,7 @@ abstract class CommonInvoice extends CommonObject return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return label of a status * @@ -526,52 +523,52 @@ abstract class CommonInvoice extends CommonObject */ public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = 0) { - // phpcs:enable + // phpcs:enable global $langs; $langs->load('bills'); $statusType = 'status0'; $prefix = 'Short'; if (!$paye) { - if ($status == 0) { - $labelStatus = $langs->trans('BillStatusDraft'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusDraft'); - } elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) { - $labelStatus = $langs->trans('BillStatusClosedUnpaid'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusClosedUnpaid'); - $statusType = 'status5'; - } elseif (($status == 3 || $status == 2) && $alreadypaid > 0) { - $labelStatus = $langs->trans('BillStatusClosedPaidPartially'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusClosedPaidPartially'); - $statusType = 'status9'; - } elseif ($alreadypaid == 0) { - $labelStatus = $langs->trans('BillStatusNotPaid'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusNotPaid'); - $statusType = 'status1'; - } else { - $labelStatus = $langs->trans('BillStatusStarted'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusStarted'); - $statusType = 'status3'; - } + if ($status == 0) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusDraft'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusDraft'); + } elseif (($status == 3 || $status == 2) && $alreadypaid <= 0) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusClosedUnpaid'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusClosedUnpaid'); + $statusType = 'status5'; + } elseif (($status == 3 || $status == 2) && $alreadypaid > 0) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusClosedPaidPartially'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusClosedPaidPartially'); + $statusType = 'status9'; + } elseif ($alreadypaid == 0) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusNotPaid'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusNotPaid'); + $statusType = 'status1'; + } else { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusStarted'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusStarted'); + $statusType = 'status3'; + } } else { - $statusType = 'status6'; + $statusType = 'status6'; - if ($type == self::TYPE_CREDIT_NOTE) { - $labelStatus = $langs->trans('BillStatusPaidBackOrConverted'); // credit note - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note - } elseif ($type == self::TYPE_DEPOSIT) { - $labelStatus = $langs->trans('BillStatusConverted'); // deposit invoice - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusConverted'); // deposit invoice - } else { - $labelStatus = $langs->trans('BillStatusPaid'); - $labelStatusShort = $langs->trans('Bill'.$prefix.'StatusPaid'); - } + if ($type == self::TYPE_CREDIT_NOTE) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusPaidBackOrConverted'); // credit note + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusPaidBackOrConverted'); // credit note + } elseif ($type == self::TYPE_DEPOSIT) { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusConverted'); // deposit invoice + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusConverted'); // deposit invoice + } else { + $labelStatus = $langs->transnoentitiesnoconv('BillStatusPaid'); + $labelStatusShort = $langs->transnoentitiesnoconv('Bill'.$prefix.'StatusPaid'); + } } return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); } - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Returns an invoice payment deadline based on the invoice settlement * conditions and billing date. @@ -579,15 +576,15 @@ abstract class CommonInvoice extends CommonObject * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return integer Date limite de reglement si ok, <0 si ko */ - public function calculate_date_lim_reglement($cond_reglement = 0) + public function calculate_date_lim_reglement($cond_reglement = 0) { - // phpcs:enable + // phpcs:enable if (!$cond_reglement) $cond_reglement = $this->cond_reglement_code; if (!$cond_reglement) $cond_reglement = $this->cond_reglement_id; $cdr_nbjour = 0; - $cdr_type = 0; - $cdr_decalage = 0; + $cdr_type = 0; + $cdr_decalage = 0; $sqltemp = 'SELECT c.type_cdr, c.nbjour, c.decalage'; $sqltemp .= ' FROM '.MAIN_DB_PREFIX.'c_payment_term as c'; @@ -646,7 +643,7 @@ abstract class CommonInvoice extends CommonObject // 2 : application of the rule, the N of the current or next month elseif ($cdr_type == 2 && !empty($cdr_decalage)) { - include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $datelim = $this->date + ($cdr_nbjour * 3600 * 24); $date_piece = dol_mktime(0, 0, 0, date('m', $datelim), date('d', $datelim), date('Y', $datelim)); // Sans les heures minutes et secondes diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ea38df7a826..58b36ac3643 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2785,9 +2785,9 @@ abstract class CommonObject */ public function line_max($fk_parent_line = 0) { - // phpcs:enable - $positionfield = 'rang'; - if ($this->table_element == 'bom') $positionfield = 'position'; + // phpcs:enable + $positionfield = 'rang'; + if ($this->table_element == 'bom_bom') $positionfield = 'position'; // Search the last rang with fk_parent_line if ($fk_parent_line) @@ -3356,7 +3356,7 @@ abstract class CommonObject } elseif ($objecttype == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; } elseif ($objecttype == 'delivery') { - $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; + $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note'; } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; } elseif ($objecttype == 'fichinter') { @@ -5195,7 +5195,7 @@ abstract class CommonObject $extrafields = new ExtraFields($this->db); $target_extrafields = $extrafields->fetch_name_optionals_label($this->table_element); - //Eliminate copied source object extra_fields that do not exist in target object + // Eliminate copied source object extra fields that do not exist in target object $new_array_options = array(); foreach ($this->array_options as $key => $value) { if (in_array(substr($key, 8), array_keys($target_extrafields))) // We remove the 'options_' from $key for test @@ -5213,7 +5213,8 @@ abstract class CommonObject $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$attributeKey]; $attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$attributeKey]; - if ($attributeRequired) + // Similar code than into insertExtraFields + if ($attributeRequired) { $mandatorypb = false; if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true; @@ -5241,7 +5242,7 @@ abstract class CommonObject } } - switch ($attributeType) + switch ($attributeType) { case 'int': if (!is_numeric($value) && $value != '') @@ -5325,11 +5326,10 @@ abstract class CommonObject if ($value == '-1') // -1 is key for no defined in combo list of objects { $new_array_options[$key] = ''; - } elseif ($value) - { + } elseif ($value) { $object = new $InfoFieldList[0]($this->db); - if (is_numeric($value)) $res = $object->fetch($value); - else $res = $object->fetch('', $value); + if (is_numeric($value)) $res = $object->fetch($value); // Common case + else $res = $object->fetch('', $value); // For compatibility if ($res > 0) $new_array_options[$key] = $object->id; else { @@ -5552,7 +5552,7 @@ abstract class CommonObject } /** - * Update an extra field value for the current object. + * Update 1 extra field value for the current object. Keep other fields unchanged. * Data to describe values to update are stored into $this->array_options=array('options_codeforfield1'=>'valueforfield1', 'options_codeforfield2'=>'valueforfield2', ...) * * @param string $key Key of the extrafield to update (without starting 'options_') @@ -5585,10 +5585,37 @@ abstract class CommonObject $attributeLabel = $extrafields->attributes[$this->table_element]['label'][$key]; $attributeParam = $extrafields->attributes[$this->table_element]['param'][$key]; $attributeRequired = $extrafields->attributes[$this->table_element]['required'][$key]; + $attrfieldcomputed = $extrafields->attributes[$this->table_element]['computed'][$key]; + + // Similar code than into insertExtraFields + if ($attributeRequired) + { + $mandatorypb = false; + if ($attributeType == 'link' && $this->array_options["options_".$key] == '-1') $mandatorypb = true; + if ($this->array_options["options_".$key] === '') $mandatorypb = true; + if ($mandatorypb) + { + dol_syslog("Mandatory extra field options_".$key." is empty"); + $this->errors[] = $langs->trans('ErrorFieldRequired', $attributeLabel); + return -1; + } + } //dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG); //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); + if (!empty($attrfieldcomputed)) + { + if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) + { + $value = dol_eval($attrfieldcomputed, 1, 0); + dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG); + $this->array_options["options_".$key] = $value; + } else { + $this->array_options["options_".$key] = null; + } + } + switch ($attributeType) { case 'int': @@ -5630,31 +5657,65 @@ abstract class CommonObject case 'datetime': $this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]); break; + /* case 'link': $param_list = array_keys($attributeParam['options']); // 0 : ObjectName // 1 : classPath $InfoFieldList = explode(":", $param_list[0]); dol_include_once($InfoFieldList[1]); - if ($value) + if ($InfoFieldList[0] && class_exists($InfoFieldList[0])) { - $object = new $InfoFieldList[0]($this->db); - $object->fetch(0, $value); - $this->array_options["options_".$key] = $object->id; + if ($value == '-1') // -1 is key for no defined in combo list of objects + { + $new_array_options[$key] = ''; + } elseif ($value) { + $object = new $InfoFieldList[0]($this->db); + if (is_numeric($value)) $res = $object->fetch($value); // Common case + else $res = $object->fetch('', $value); // For compatibility + + if ($res > 0) $new_array_options[$key] = $object->id; + else { + $this->error = "Id/Ref '".$value."' for object '".$object->element."' not found"; + $this->db->rollback(); + return -1; + } + } + } else { + dol_syslog('Error bad setup of extrafield', LOG_WARNING); } break; + */ } $this->db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key."='".$this->db->escape($this->array_options["options_".$key])."'"; - $sql .= " WHERE fk_object = ".$this->id; + + $linealreadyfound = 0; + + // Check if there is already a line for this object (in most cases, it is, but sometimes it is not, for example when extra field has been created after), so we must keep this overload) + $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) { + $tmpobj = $this->db->fetch_object($resql); + if ($tmpobj) { + $linealreadyfound = $tmpobj->nb; + } + } + + if ($linealreadyfound) { + $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element."_extrafields SET ".$key." = '".$this->db->escape($this->array_options["options_".$key])."'"; + $sql .= " WHERE fk_object = ".$this->id; + } else { + $result = $this->insertExtraFields('', $user); + if ($result < 0) $error++; + } + $resql = $this->db->query($sql); if (!$resql) { $error++; $this->error = $this->db->lasterror(); } - if (!$error && $trigger) { // Call trigger @@ -6888,6 +6949,8 @@ abstract class CommonObject var parent = $(this).find("option[parent]:first").attr("parent"); var infos = parent.split(":"); var parent_list = infos[0]; + showOptions(child_list, parent_list); + $("select[name=\""+parent_list+"\"]").change(function() { showOptions(child_list, parent_list); }); @@ -7725,7 +7788,7 @@ abstract class CommonObject { $this->setVarsFromFetchObj($obj); - // Retreive all extrafield + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); @@ -7976,6 +8039,18 @@ abstract class CommonObject } } + // Delete llx_ecm_files + if (!$error) { + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".$this->id; + $resql = $this->db->query($sql); + if (!$resql) + { + $this->error = $this->db->lasterror(); + $this->errors[] = $this->error; + $error++; + } + } + if (!$error && !empty($this->isextrafieldmanaged)) { $result = $this->deleteExtraFields(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index ce726265006..d87174c5636 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -122,7 +122,7 @@ class Conf // First level object // TODO Remove this part. $this->expedition_bon = new stdClass(); - $this->livraison_bon = new stdClass(); + $this->delivery_note = new stdClass(); $this->fournisseur = new stdClass(); $this->product = new stdClass(); $this->service = new stdClass(); @@ -370,8 +370,8 @@ class Conf // Sous module bons d'expedition $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0); - // Sous module bons de livraison - $this->livraison_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0); + // Sub module delivery note Sous module bons de livraison + $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0); // Module fournisseur if (!empty($this->fournisseur)) diff --git a/htdocs/core/class/cproductnature.class.php b/htdocs/core/class/cproductnature.class.php index d098f56d82b..9e79093b12b 100644 --- a/htdocs/core/class/cproductnature.class.php +++ b/htdocs/core/class/cproductnature.class.php @@ -42,9 +42,20 @@ class CProductNature // extends CommonObject * @var string[] Error codes (or messages) */ public $errors = array(); + + /** + * @var array record + */ public $records = array(); + /** + * @var string element + */ public $element='cproductnbature'; + + /** + * @var string table element + */ public $table_element='c_product_nature'; /** @@ -52,13 +63,22 @@ class CProductNature // extends CommonObject */ public $id; + /** + * @var int code + */ public $code; + + /** + * @var string label + */ public $label; + + /** + * @var int active + */ public $active; - - /** * Constructor * @@ -80,17 +100,6 @@ class CProductNature // extends CommonObject public function create($user, $notrigger = 0) { global $conf, $langs; - $error = 0; - - // Clean parameters - - if (isset($this->id)) $this->id = (int) $this->id; - if (isset($this->code)) $this->code = trim($this->code); - if (isset($this->label)) $this->libelle = trim($this->label); - if (isset($this->active)) $this->active = trim($this->active); - - // Check parameters - // Put here code to add control on parameters values // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."("; @@ -101,32 +110,22 @@ class CProductNature // extends CommonObject $sql .= ") VALUES ("; $sql .= " ".(!isset($this->id) ? 'NULL' : ((int) $this->id)) .","; $sql .= " ".(!isset($this->code) ? 'NULL' : ((int) $this->code)).","; - $sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").","; - $sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->db->escape($this->active))).","; + $sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape(trim($this->label))."'").","; + $sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active)).","; $sql .= ")"; $this->db->begin(); dol_syslog(get_class($this)."::create", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - - if (!$error) - { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); - } - // Commit or rollback - if ($error) - { - foreach ($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } + if (!$resql) { + dol_syslog(get_class($this)."::create ".$this->db->lasterror(), LOG_ERR); + $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); - return -1 * $error; + return -1; } else { + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); $this->db->commit(); return $this->id; } @@ -265,39 +264,24 @@ class CProductNature // extends CommonObject public function update($user = null, $notrigger = 0) { global $conf, $langs; - $error = 0; - - // Clean parameters - if (isset($this->code)) $this->code = trim($this->code); - if (isset($this->label)) $this->label = trim($this->label); - if (isset($this->active)) $this->active = trim($this->active); - - // Check parameters - // Put here code to add control on parameters values // Update request $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET"; $sql .= " code=".(isset($this->code) ? ((int) $this->code) : "null").","; - $sql .= " label=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; + $sql .= " label=".(isset($this->label) ? "'".$this->db->escape(trim($this->label))."'" : "null").","; $sql .= " active=".(isset($this->active) ? ((int) $this->active) : "null"); - $sql .= " WHERE rowid=".$this->id; + $sql .= " WHERE rowid=".(int) $this->id; $this->db->begin(); dol_syslog(get_class($this)."::update", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - // Commit or rollback - if ($error) - { - foreach ($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } + if (!$resql) { + dol_syslog(get_class($this)."::update Error ".$this->db->lasterror(), LOG_ERR); + $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); - return -1 * $error; + return -1; } else { $this->db->commit(); return 1; @@ -318,24 +302,18 @@ class CProductNature // extends CommonObject $error = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " WHERE rowid=".$this->id; + $sql .= " WHERE rowid=".(int) $this->id; $this->db->begin(); dol_syslog(get_class($this)."::delete", LOG_DEBUG); $resql = $this->db->query($sql); - if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - // Commit or rollback - if ($error) - { - foreach ($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } + if (!$resql) { + dol_syslog(get_class($this)."::delete Error ".$this->db->lasterror(), LOG_ERR); + $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); - return -1 * $error; + return -1; } else { $this->db->commit(); return 1; @@ -345,7 +323,7 @@ class CProductNature // extends CommonObject /** * Get unit from code - * @param string $code code of unit + * @param int $code code of unit * @param string $mode 0= id , short_label=Use short label as value, code=use code * @return int <0 if KO, Id of code if OK */ diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 6cab6580a5a..ba636ac2569 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -815,7 +815,7 @@ class dolReceiptPrinter extends Printer } } // If is DummyPrintConnector send to log to debugging - if ($this->printer->connector instanceof DummyPrintConnector) + if ($this->printer->connector instanceof DummyPrintConnector || $conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") { $data = $this->printer->connector->getData(); if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector") echo base64_encode($data); @@ -868,6 +868,11 @@ class dolReceiptPrinter extends Printer public function initPrinter($printerid) { global $conf; + if ($conf->global->TAKEPOS_PRINT_METHOD == "takeposconnector"){ + $this->connector = new DummyPrintConnector(); + $this->printer = new Printer($this->connector, $this->profile); + return; + } $error = 0; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql .= ' FROM '.MAIN_DB_PREFIX.'printer_receipt'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4b8a64a0851..bf52ff5871a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1186,14 +1186,14 @@ class Form } } - // On recherche les societes + // We search companies $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur"; - if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) { + if (! empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $sql .= ", s.address, s.zip, s.town"; $sql .= ", dictp.code as country_code"; } $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if ($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST) { + if (! empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as dictp ON dictp.rowid = s.fk_pays"; } if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -3901,7 +3901,7 @@ class Form while ($i < $num) { $obj = $this->db->fetch_object($result); - if ($selected == $obj->rowid) + if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) { print '