Merge remote-tracking branch 'upstream/develop' into mailingcard

This commit is contained in:
Frédéric FRANCE 2020-12-27 14:04:04 +01:00
commit 12f4a74a74
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
755 changed files with 18061 additions and 124671 deletions

View File

@ -4,13 +4,14 @@ How to contribute to Dolibarr
Bug reports and feature requests
--------------------------------
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum).
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages.
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
Default language here is english. So please prepare your contributions in english.
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
4. Tell us the version you are using!
4. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version)
3. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible).
@ -26,7 +27,8 @@ Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
4. Commit and push your changes.
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
### <a name="branches"></a>Branches
<span id="branches" name="branches"></span>
### Branches
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.

View File

@ -50,6 +50,9 @@ jobs:
- if: type = push AND branch = develop
php: nightly
env: DB=mysql
- if: type = push AND branch = 13.0
php: nightly
env: DB=mysql
notifications:
email:
@ -268,8 +271,8 @@ script:
# Ensure we catch errors
set -e
#parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
parallel-lint --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
@ -400,7 +403,8 @@ script:
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
# Enable modules not enabled into original dump
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP,MAIN_MODULE_RECRUITMENT > $TRAVIS_BUILD_DIR/enablemodule.log
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP > $TRAVIS_BUILD_DIR/enablemodule.log
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT > $TRAVIS_BUILD_DIR/enablemodule.log
echo $?
cd -
set +e

View File

@ -23,14 +23,13 @@ PEAR Mail_MIME 1.8.9 BSD Yes
ParseDown 1.6 MIT License Yes Markdown parser
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
PHPSpreadSheet ? LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
PSR/Logs 1.0 Library for logs (used by DebugBar)
PSR/simple-cache ? Library for cache (used by PHPSpreadSheet)
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
Sabre 3.2.2 BSD Yes DAV support
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
Stripe 6.43.1 MIT licence Yes Library for Stripe module
@ -53,7 +52,7 @@ jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
jsGanttImproved 1.7.5.4 BSD License Yes JS library (to build Gantt reports)
jsGanttImproved 2.7.3 BSD License Yes JS library (to build Gantt reports)
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer

119
ChangeLog
View File

@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition
NEW: Accountancy - on transfers, select the periodicity by default
NEW: Accountancy - Add export for Gestinum (v3 & v5)
NEW: new currency rate editor
NEW: Solve blocking feature. Can increase stock of a Kit without changing subproduct stock.
NEW: add a widget to show the customers with outstanding limits reached
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
NEW: add a counter of number of words for pages in website module
@ -176,12 +177,13 @@ NEW: Weighing Scale compatibility with TakePOS connector
NEW: when creating a user from a member linked to a thirdparty, you can choose to create it as external or internal user
NEW: add clone button on miscellaneous payment
NEW: #15065 Add option to put the product label in bold in the PDF templates if configured
NEW: Add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF."
For developers:
---------------
NEW: add __MEMBER_TYPE__ substitution key
NEW: add __TYPE__ substitution key
NEW: add substitution key __MEMBER_TYPE__
NEW: add substitution key __TYPE__
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
NEW: Add some fields to link website page to an other object
@ -191,14 +193,9 @@ NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
NEW: can force the antivirus from conf file or autoprepend ini setup
NEW: can add event to log into blockedlog module with a constant
NEW: add property cssview when declaring fields of an object
NEW: Can use dynamic code into the 'enabled' property of DAO fields
NEW: allow to edit "demand reason" field though API
NEW: fetch contact by email with REST API
NEW: can use dynamic code into the 'enabled' property of DAO fields
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: field ref_ext for Attributes and Combinations
NEW: OAuth SCOPE for Admin SDK
NEW: retrieve discount from invoice from API
NEW: standardizes API thirdparties by email like other object
@ -219,6 +216,11 @@ 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: allow to edit field "demand reason" through API
NEW: fetch contact by email with REST API
NEW: get state by REST API
NEW: get state dictionary by REST API
NEW: improve Product API for product variants
HOOKs
NEW: Hook on propal card
@ -226,7 +228,7 @@ NEW: add hooks on newpayment page to allow external payment modules
NEW: add hooks on stats pages
NEW: add formConfirm hook on product page
NEW: add two hooks printFieldListFrom and printFieldSearchParam
NEW: add hook "loginCheckSecurityAccess"
WARNING:
@ -246,8 +248,105 @@ Following changes may create regressions for some external modules, but were nec
* 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().
* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
* Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
FIX: make formConfirm an addreplace-type hook
FIX: regex to remove 'action' parameter: taking feedback from PR#15213 into account
FIX: remove 'action' parameter from redirect URL when reordering lines on a document
FIX: error when displaying lines on order after adding a line if both MAIN_MULTILANGS and MAIN_DISABLE_PDF_AUTOUPDATE are activated
FIX: on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
FIX: set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity
FIX: the stringent XSS protection provided by 'alphanohtml' causes problems with some clients who used basic tags (bold, italic, underline) in product labels. Using 'restricthtml' instead could be a good compromise.
FIX: third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order)
FIX: when the cronjob 'params' field is empty, the cron method is called with one empty string param instead of no params at all
FIX: XSS protection too stringent -> replace 'alphanohtml' with 'restricthtml'
FIX: #13067 including opening balance in calculation of displayed balance
FIX: #14326
FIX: #14649
FIX: #14901
FIX: #14927 Change ContratLigne property type to product_type
FIX: #14979
FIX: #15074
FIX: #15111 Fix special characters output in PDF
FIX: #15161 MO translation conflict
FIX: #15163
FIX: #15199
FIX: #15208
FIX: #15303
FIX: #15365 export of extrafields for user and resources
FIX: #15374 : "New" doesn't clear total amounts
FIX: #15501
FIX: #15572
FIX: #15590
FIX: #15618
FIX: supplier proposals as linked objects of events are not correctly fetched
FIX: when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
FIX: Accountancy - Some ajustments on length of the account (general & auxiliary)
FIX: admin conf selected
FIX: also check if there is a method $object->fetch_thirdparty() before calling it
FIX: autofocus on first setup
FIX: Bad rigths to send contract
FIX: Better error message with IMAP when connection fails
FIX: Can create user but not update user with activedirectory
FIX: Can receipt of a product that required lot after disabling stock and
FIX: Can't create shipment for virtual product. Add
FIX: cant empty action comm desc
FIX: CA report by product/service : subcategory filter
FIX: Clean orphan records in llx_ecm_files into repair script.
FIX: default accountancy values and posted values
FIX: Deletion of expensereport + other generated object not complete.
FIX: disabled users must not be available in sales representative list on societe edit mode
FIX: Dol print error : conf usage thirdparty propagate extrafields to
FIX: Don't display inactive users in birthday box and company card
FIX: empty value is needed on filter list
FIX: enable HTML in product labels depending on conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML
FIX: error 500 on cash closure
FIX: excess comma
FIX: Export FEC - Remove line at zero
FIX: extrafield required error after submit
FIX: filter on project list
FIX: force payment mode to withdraw
FIX: formating of prices with foreign languages
FIX: handling $heightforinfotot when he's superior to a page height
FIX: if no PDF default model in admin for expense report, do not create a PDF
FIX: invoice payment terms edition: error management
FIX: list of fields in list of recurring invoices was empty
FIX: load default linked options for linked sellist extra fields
FIX: Loan - Return on list when you cancel create form or delete a loan
FIX: Missing lang trans
FIX: no empty value in required extrafield
FIX: Param joinfiles not sanitized
FIX: Payment by BankTransfer
FIX: pdf_getlinetotalwithtax must show total incl tax
FIX: Problem on supplier payment card
FIX: product auto volume calculation
FIX: product customer prices: missing triggers in CRUD class
FIX: Request on purchase orders in timeout even on very small databases
FIX: set paid on total discount of a product in cash desk
FIX: several warning with the barcode use in ODT templates
FIX: SHIP MODE install v12 bug insert
FIX: stripe for connect mode
FIX: subcat filter
FIX: supplier invoice: automatically calculate payment term when modifying payment condition
FIX: SUPPLIER PROPOSAL v12 bug add
FIX: table making extrafield input too small on advance target mailing
FIX: table making extrafield too small advtagertmailing
FIX: Unable to edit extrafields in expense report
FIX: update margins rates on object line edit
FIX: uses price2numjs
FIX: various payments: bad data handling for subledger account + useless db commit/rollback
FIX: virtual products: displayed value is by unit
FIX: virtual products: supplier discount was not applied in component list
FIX: warning for purchase order delivery late.
FIX: Warning on late purchase order delivery
FIX: WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty
FIX: wrong tab
FIX: Yogosha report 4425 (backport)
FIX: Yogosha report 4434 (backport)
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
FIX: 11.0 - expenses lines overlapping the total amounts frame

View File

@ -1,6 +0,0 @@
INSTALL
-------
English: See README.md file.
French: Voir fichier README-FR.md.

View File

@ -71,6 +71,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
- Follow the installer instructions
### Saas/Cloud setup
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
@ -86,6 +87,7 @@ Dolibarr supports upgrading usually wihtout the need for any (commercial) suppor
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
 If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
## WHAT'S NEW
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
@ -164,15 +166,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Flexible PDF & ODT generation for invoices, proposals, orders...
- …
### System Environment / Requirements
- Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
### Extending
Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com).
## WHAT DOLIBARR CAN'T DO YET
These are features that Dolibarr does **not** yet fully support:
@ -182,22 +187,29 @@ These are features that Dolibarr does **not** yet fully support:
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
- Dolibarr can't do coffee (yet)
## DOCUMENTATION
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
## CONTRIBUTING
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
This project exists thanks to all the people who contribute.
Please read the instructions how to contribute (report a bug/error, a feature request, send code ...) [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
A view on Contributors:
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
## CREDITS
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
## NEWS AND SOCIAL NETWORKS
Follow Dolibarr project on:
@ -208,6 +220,8 @@ Follow Dolibarr project on:
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]

View File

@ -6,8 +6,8 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
| Version | Supported |
| --------- | ------------------ |
| <= 9.0.* | :x: |
| >= 10.0.* | :white_check_mark: |
| <= 12.* | :x: |
| >= 13.* | :white_check_mark: |
## Reporting a Vulnerability
@ -23,11 +23,11 @@ If you believe you've found a security bug in our service, we are happy to work
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
We recommand to install Dolibarr ERP CRM on you own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
### User Agent
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-BugHunting-dolibarr'.
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-securitytest-for-dolibarr'.
### Account access
@ -36,54 +36,43 @@ You can install the web application yourself on your own platform/server so you
## Eligibility and Responsible Disclosure
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements may receive a monetary reward:
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements will be "validated reports" (if not, we may close the report without any answer):
You must be the first reporter of a vulnerability.
The vulnerability must be a qualifying vulnerability (see below)
Any vulnerability found must be reported no later than 24 hours after discovery
You must be the first reporter of the vulnerability (duplicate reports are closed).
You must send a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install softwate on your own platform.
You must not leak, manipulate, or destroy any user data.
You must not be a former or current employee of Dolibarr or one of its contractor.
Reports about vulnerabilities are examined by our security analysts.
Our analysis is always based on worst case exploitation of the vulnerability, as is the reward we pay.
No vulnerability disclosure, including partial is allowed for the moment.
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
## Scope for qualified vulnerabilities
ONLY vulnerabilities discovered, when the following setup on test platform is used, are accepted:
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":
* $dolibarr_main_prod must be set to 1 into conf.php
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
* $dolibarr_main_force_https must be set to something else than 0.
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be enabled soon by default)
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default)
* The module DebugBar must NOT be enabled (by default, this module is not enabled. This is a developer tool)
* The module ModuleBuilder must NOT be enabled (by default, this module is not enabled. This is a developer tool)
* ONLY security reports on modules provided by default and with the "stable" status are allowed (troubles into "experimental", "developement" or external modules are not accepted).
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
* CSRF attacks are accepted for all when using a POST URL, but are accepted only for creating or updating data resctricted to the admin user when using GET URL.
* Ability for a high level user to edit web site pages in the CMS by including javascript is an expected feature.
* CSRF attacks are accepted when using a POST URL, but when using GET URL, they are validated only for creating, updating or deleting data resctricted from pages restricted to admin users.
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
Scope is the web application (back office) and the APIs.
## Qualifying vulnerabilities for Bug bounty programs
* Remote code execution (RCE)
* Local files access and manipulation (LFI, RFI, XXE, SSRF, XSPA)
* Code injections (HTML, JS, SQL, PHP, ...)
* Cross-Site Scripting (XSS)
* Cross-Site Requests Forgery (CSRF) with real security impact
* Cross-Site Requests Forgery (CSRF) with real security impact (when using GET URLs, CSRF are qualified only for creating, updating or deleting data from pages restricted to admin users)
* Open redirect
* Broken authentication & session management
* Insecure direct object references
@ -95,6 +84,7 @@ Scope is the web application (back office) and the APIs.
## Non-qualifying vulnerabilities for Bug bounty programs, but qualified for reporting
* "Self" XSS
* SSL/TLS best practices
* Denial of Service attacks

View File

@ -306,7 +306,7 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
- htdocs/includes/jquery/plugins/datatables
- htdocs/includes/jszip
- htdocs/includes/mike42
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
- htdocs/includes/phpoffice
- htdocs/includes/restler/framework/Luracast/Restler/explorer
- htdocs/includes/swiftmailer
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom

View File

@ -37,7 +37,7 @@ Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
2010, Servitux Servicios Informaticos <info@servitux.es>
2011, Herve Prot <herve.prot@symeos.com>
2011, Remy Younes <ryounes@gmail.com>
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
License: GPL-3+
This program is free software; you can redistribute it
@ -189,36 +189,12 @@ License: CC-BY-SA-3.0
For more information, see https://creativecommons.org/licenses/by-sa/3.0/
------------------------------------------------------------
Files: htdocs/includes/fpdfi/*
Copyright: 2004-2011 Setasign - Jan Slabon
License: GPL-2+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
'/usr/share/common-licenses/GPL-2'.
------------------------------------------------------------
Files: htdocs/includes/geoip/*
Files: htdocs/includes/geoip2/*
Copyright: 2007 MaxMind LLC
License: LGPL-2.1+
License: CC-By-SA
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@ -380,30 +356,7 @@ License: GPL-2+
------------------------------------------------------------
Files: htdocs/includes/phpexcel/*
Copyright: 2006-2011 PHPExcel (http://www.codeplex.com/PHPExcel)
License: LGPL-2.1+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the full text of the GNU Lesser General Public
License version 2.1 can be found in the file
'/usr/share/common-licenses/LGPL-2.1'.
------------------------------------------------------------
Files: htdocs/includes/tcpdf/*
Files: htdocs/includes/tecnickcom/*
Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
License: LGPL-3.0+
TCPDF is free software: you can redistribute it and/or modify it

View File

@ -150,7 +150,6 @@ case "$1" in
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
#grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

View File

@ -35,7 +35,6 @@ $force_install_distrib='debian';
//$force_dolibarr_lib_GEOIP_PATH='';
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled'
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
//$force_dolibarr_js_JQUERY='/javascript/jquery';
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';

View File

@ -103,8 +103,6 @@ override_dh_install:
# clean from useless files
rm -fr htdocs/includes/jquery/plugins/multiselect
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
rm -fr htdocs/includes/tcpdf/fonts/utils
@ -113,7 +111,6 @@ override_dh_install:
# Licence files are already included into copyright file.
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
rm -f htdocs/includes/phpexcel/license.txt
rm -f htdocs/includes/tcpdf/LICENSE.TXT
# Drop unwanted executable permissions

View File

@ -118,7 +118,7 @@ Source: "C:\wamp64\bin\mariadb\mariadb10.4.10\*.*"; DestDir: "{app}\bin\mariadb\
;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
; Dolibarr
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"

View File

@ -476,6 +476,7 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
@ -615,13 +616,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PDF`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;

View File

@ -274,7 +274,6 @@ then
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

View File

@ -292,6 +292,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/recruitment
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/salaries
@ -424,7 +425,6 @@ then
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

View File

@ -209,6 +209,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/recruitment
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/salaries
@ -271,7 +272,6 @@ then
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

View File

@ -220,6 +220,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/product
%_datadir/dolibarr/htdocs/projet
%_datadir/dolibarr/htdocs/public
%_datadir/dolibarr/htdocs/recruitment
%_datadir/dolibarr/htdocs/reception
%_datadir/dolibarr/htdocs/resource
%_datadir/dolibarr/htdocs/salaries
@ -282,7 +283,6 @@ then
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config

View File

@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
//$force_dolibarr_lib_GEOIP_PATH='';
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
$force_dolibarr_lib_PHPEXCEL_PATH='';
$force_dolibarr_lib_TCPDF_PATH='';
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
//$force_dolibarr_js_JQUERY='/javascript/jquery';

View File

@ -25,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
//$force_dolibarr_lib_GEOIP_PATH='';
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
$force_dolibarr_lib_PHPEXCEL_PATH='';
$force_dolibarr_lib_TCPDF_PATH='';
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
//$force_dolibarr_js_JQUERY='/javascript/jquery';

View File

@ -25,7 +25,6 @@ $force_install_distrib='rpmopensuse';
//$force_dolibarr_lib_GEOIP_PATH='';
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
$force_dolibarr_lib_PHPEXCEL_PATH='';
$force_dolibarr_lib_TCPDF_PATH='';
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
//$force_dolibarr_js_JQUERY='/javascript/jquery';

View File

@ -59,4 +59,4 @@
"ext-zip" : "ODT, Excel and file compression support",
"ext-xml" : "Excel support"
}
}
}

501
composer.lock generated
View File

@ -6,53 +6,6 @@
],
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
"packages": [
{
"name": "Psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "ckeditor/ckeditor",
"version": "4.12.1",
@ -92,6 +45,12 @@
"text",
"wysiwyg"
],
"support": {
"forum": "http://ckeditor.com/forums",
"issues": "http://dev.ckeditor.com",
"source": "http://github.com/ckeditor/ckeditor-dev",
"wiki": "http://docs.ckeditor.com"
},
"time": "2019-06-28T10:41:23+00:00"
},
{
@ -153,6 +112,10 @@
"debug",
"debugbar"
],
"support": {
"issues": "https://github.com/maximebf/php-debugbar/issues",
"source": "https://github.com/maximebf/php-debugbar/tree/v1.15.1"
},
"time": "2019-09-24T14:55:42+00:00"
},
{
@ -208,6 +171,10 @@
"print",
"receipt"
],
"support": {
"issues": "https://github.com/mike42/escpos-php/issues",
"source": "https://github.com/mike42/escpos-php/tree/v2.2"
},
"time": "2019-10-05T05:59:00+00:00"
},
{
@ -260,6 +227,10 @@
"mobile detector",
"php mobile detect"
],
"support": {
"issues": "https://github.com/serbanghita/Mobile-Detect/issues",
"source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.34"
},
"time": "2019-09-18T18:44:20+00:00"
},
{
@ -308,62 +279,54 @@
"time": "2020-10-19T12:22:11+00:00"
},
{
"name": "phpoffice/phpexcel",
"version": "1.8.1",
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PHPExcel.git",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32"
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PHPExcel/zipball/372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"reference": "372c7cbb695a6f6f1e62649381aeaa37e7e70b32",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"ext-xml": "*",
"ext-xmlwriter": "*",
"php": ">=5.2.0"
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"PHPExcel": "Classes/"
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL"
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "http://blog.maartenballiauw.be"
},
{
"name": "Mark Baker"
},
{
"name": "Franck Lefevre",
"homepage": "http://blog.rootslabs.net"
},
{
"name": "Erik Tilt"
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "PHPExcel - OpenXML - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "http://phpexcel.codeplex.com",
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"OpenXML",
"excel",
"php",
"spreadsheet",
"xls",
"xlsx"
"log",
"psr",
"psr-3"
],
"abandoned": "phpoffice/phpspreadsheet",
"time": "2015-05-01T07:00:55+00:00"
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.3"
},
"time": "2020-03-23T09:12:05+00:00"
},
{
"name": "restler/framework",
@ -424,6 +387,9 @@
"rest",
"server"
],
"support": {
"source": "https://github.com/Luracast/Restler-Framework/tree/3.0.0-RC6"
},
"time": "2020-02-13T16:05:12+00:00"
},
{
@ -480,24 +446,28 @@
"payment processing",
"stripe"
],
"support": {
"issues": "https://github.com/stripe/stripe-php/issues",
"source": "https://github.com/stripe/stripe-php/tree/master"
},
"time": "2019-08-29T16:56:12+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.18.1",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a"
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a",
"reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
"reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-mbstring": "For best performance"
@ -505,7 +475,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
@ -543,6 +513,9 @@
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
@ -557,7 +530,7 @@
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/var-dumper",
@ -620,6 +593,9 @@
"debug",
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/master"
},
"time": "2015-11-18T13:48:51+00:00"
},
{
@ -682,40 +658,40 @@
"pdf417",
"qrcode"
],
"support": {
"source": "https://github.com/tecnickcom/TCPDF/tree/6.3.2"
},
"time": "2019-09-20T09:35:01+00:00"
}
],
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
"reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"doctrine/coding-standard": "^8.0",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
"phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-phpunit": "^0.12",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
@ -729,38 +705,59 @@
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
"homepage": "https://ocramius.github.io/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-06-14T21:17:01+00:00"
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/1.4.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2020-11-10T18:47:58+00:00"
},
{
"name": "php-parallel-lint/php-console-color",
"version": "v0.2",
"version": "v0.3",
"source": {
"type": "git",
"url": "https://github.com/php-parallel-lint/PHP-Console-Color.git",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191"
"reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/d5deaecff52a0d61ccb613bb3804088da0307191",
"reference": "d5deaecff52a0d61ccb613bb3804088da0307191",
"url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/b6af326b2088f1ad3b264696c9fd590ec395b49e",
"reference": "b6af326b2088f1ad3b264696c9fd590ec395b49e",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"replace": {
"jakub-onderka/php-console-color": "*"
},
"require-dev": {
"jakub-onderka/php-code-style": "1.0",
"jakub-onderka/php-parallel-lint": "1.0",
"jakub-onderka/php-var-dump-check": "0.*",
"php-parallel-lint/php-code-style": "1.0",
"php-parallel-lint/php-parallel-lint": "1.0",
"php-parallel-lint/php-var-dump-check": "0.*",
"phpunit/phpunit": "~4.3",
"squizlabs/php_codesniffer": "1.*"
},
@ -780,7 +777,11 @@
"email": "jakub.onderka@gmail.com"
}
],
"time": "2018-09-29T17:23:10+00:00"
"support": {
"issues": "https://github.com/php-parallel-lint/PHP-Console-Color/issues",
"source": "https://github.com/php-parallel-lint/PHP-Console-Color/tree/master"
},
"time": "2020-05-14T05:47:14+00:00"
},
{
"name": "php-parallel-lint/php-console-highlighter",
@ -829,6 +830,10 @@
}
],
"description": "Highlight PHP code in terminal",
"support": {
"issues": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/issues",
"source": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/tree/master"
},
"time": "2020-05-13T07:37:49+00:00"
},
{
@ -876,39 +881,37 @@
],
"description": "This tool check syntax of PHP files about 20x faster than serial check.",
"homepage": "https://github.com/JakubOnderka/PHP-Parallel-Lint",
"support": {
"source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v0.9.2"
},
"time": "2015-12-15T10:42:16+00:00"
},
{
"name": "phpdocumentor/reflection-common",
"version": "1.0.1",
"version": "2.2.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": "^4.6"
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-2.x": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src"
]
"phpDocumentor\\Reflection\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -930,44 +933,45 @@
"reflection",
"static analysis"
],
"time": "2017-09-11T18:02:19+00:00"
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
"source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
},
"time": "2020-06-27T09:03:43+00:00"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "4.3.2",
"version": "5.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e"
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
"reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": ""
},
"require": {
"php": "^7.0",
"phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0",
"phpdocumentor/type-resolver": "~0.4 || ^1.0.0",
"webmozart/assert": "^1.0"
"ext-filter": "*",
"php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^2.2",
"phpdocumentor/type-resolver": "^1.3",
"webmozart/assert": "^1.9.1"
},
"require-dev": {
"doctrine/instantiator": "^1.0.5",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
"mockery/mockery": "~1.3.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
"dev-master": "5.x-dev"
}
},
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
"src/"
]
"phpDocumentor\\Reflection\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -978,37 +982,44 @@
{
"name": "Mike van Riel",
"email": "me@mikevanriel.com"
},
{
"name": "Jaap van Otterdijk",
"email": "account@ijaap.nl"
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2019-09-12T14:27:41+00:00"
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
},
"time": "2020-09-03T19:13:55+00:00"
},
{
"name": "phpdocumentor/type-resolver",
"version": "0.5.1",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae"
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae",
"reference": "cf842904952e64e703800d094cdf34e715a8a3ae",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": ""
},
"require": {
"php": "^7.0",
"phpdocumentor/reflection-common": "^1.0"
"php": "^7.2 || ^8.0",
"phpdocumentor/reflection-common": "^2.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.4"
"ext-tokenizer": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-1.x": "1.x-dev"
}
},
"autoload": {
@ -1026,37 +1037,42 @@
"email": "me@mikevanriel.com"
}
],
"time": "2017-12-30T13:23:38+00:00"
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
},
"time": "2020-09-17T18:55:26+00:00"
},
{
"name": "phpspec/prophecy",
"version": "1.9.0",
"version": "v1.10.3",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
"reference": "451c3cd1418cf640de218914901e51b064abb093"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
"reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
"reference": "451c3cd1418cf640de218914901e51b064abb093",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
"sebastian/comparator": "^1.1|^2.0|^3.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0"
"sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
"sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpspec/phpspec": "^2.5 || ^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.8.x-dev"
"dev-master": "1.10.x-dev"
}
},
"autoload": {
@ -1089,7 +1105,11 @@
"spy",
"stub"
],
"time": "2019-10-03T11:07:50+00:00"
"support": {
"issues": "https://github.com/phpspec/prophecy/issues",
"source": "https://github.com/phpspec/prophecy/tree/v1.10.3"
},
"time": "2020-03-05T15:02:03+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -1151,6 +1171,11 @@
"testing",
"xunit"
],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2"
},
"time": "2015-10-06T15:47:00+00:00"
},
{
@ -1198,6 +1223,11 @@
"filesystem",
"iterator"
],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
"source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5"
},
"time": "2017-11-27T13:52:08+00:00"
},
{
@ -1239,6 +1269,10 @@
"keywords": [
"template"
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-text-template/issues",
"source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
},
"time": "2015-06-21T13:50:34+00:00"
},
{
@ -1288,6 +1322,10 @@
"keywords": [
"timer"
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues",
"source": "https://github.com/sebastianbergmann/php-timer/tree/master"
},
"time": "2017-02-26T11:10:40+00:00"
},
{
@ -1337,6 +1375,10 @@
"keywords": [
"tokenizer"
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
"source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4"
},
"abandoned": true,
"time": "2017-12-04T08:55:13+00:00"
},
@ -1410,6 +1452,10 @@
"testing",
"xunit"
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36"
},
"time": "2017-06-21T08:07:12+00:00"
},
{
@ -1466,6 +1512,11 @@
"mock",
"xunit"
],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues",
"source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3"
},
"abandoned": true,
"time": "2015-10-02T06:51:40+00:00"
},
@ -1531,6 +1582,11 @@
"testing",
"xunit"
],
"support": {
"irc": "irc://irc.freenode.net/phpunit",
"issues": "https://github.com/sebastianbergmann/phpunit-selenium/issues",
"source": "https://github.com/giorgiosironi/phpunit-selenium/tree/2.x"
},
"time": "2017-01-23T22:15:32+00:00"
},
{
@ -1595,6 +1651,10 @@
"compare",
"equality"
],
"support": {
"issues": "https://github.com/sebastianbergmann/comparator/issues",
"source": "https://github.com/sebastianbergmann/comparator/tree/1.2"
},
"time": "2017-01-29T09:50:25+00:00"
},
{
@ -1647,6 +1707,10 @@
"keywords": [
"diff"
],
"support": {
"issues": "https://github.com/sebastianbergmann/diff/issues",
"source": "https://github.com/sebastianbergmann/diff/tree/1.4"
},
"time": "2017-05-22T07:24:03+00:00"
},
{
@ -1697,6 +1761,10 @@
"environment",
"hhvm"
],
"support": {
"issues": "https://github.com/sebastianbergmann/environment/issues",
"source": "https://github.com/sebastianbergmann/environment/tree/1.3"
},
"time": "2016-08-18T05:49:44+00:00"
},
{
@ -1764,6 +1832,10 @@
"export",
"exporter"
],
"support": {
"issues": "https://github.com/sebastianbergmann/exporter/issues",
"source": "https://github.com/sebastianbergmann/exporter/tree/master"
},
"time": "2016-06-17T09:04:28+00:00"
},
{
@ -1815,6 +1887,10 @@
"keywords": [
"global state"
],
"support": {
"issues": "https://github.com/sebastianbergmann/global-state/issues",
"source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1"
},
"time": "2015-10-12T03:26:01+00:00"
},
{
@ -1868,6 +1944,10 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"support": {
"issues": "https://github.com/sebastianbergmann/recursion-context/issues",
"source": "https://github.com/sebastianbergmann/recursion-context/tree/master"
},
"time": "2016-10-03T07:41:43+00:00"
},
{
@ -1903,6 +1983,10 @@
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"support": {
"issues": "https://github.com/sebastianbergmann/version/issues",
"source": "https://github.com/sebastianbergmann/version/tree/1.0.6"
},
"time": "2015-06-21T13:59:46+00:00"
},
{
@ -1981,24 +2065,29 @@
"phpcs",
"standards"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2018-11-07T22:31:41+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.12.0",
"version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
@ -2006,7 +2095,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@ -2039,20 +2132,37 @@
"polyfill",
"portable"
],
"time": "2019-08-06T08:03:45+00:00"
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-23T14:02:19+00:00"
},
{
"name": "symfony/yaml",
"version": "v3.4.32",
"version": "v3.4.47",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "768f817446da74a776a31eea335540f9dcb53942"
"reference": "88289caa3c166321883f67fe5130188ebbb47094"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/768f817446da74a776a31eea335540f9dcb53942",
"reference": "768f817446da74a776a31eea335540f9dcb53942",
"url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094",
"reference": "88289caa3c166321883f67fe5130188ebbb47094",
"shasum": ""
},
"require": {
@ -2069,11 +2179,6 @@
"symfony/console": "For validating YAML files using the lint command"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
@ -2098,35 +2203,51 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2019-09-10T10:38:46+00:00"
"support": {
"source": "https://github.com/symfony/yaml/tree/v3.4.47"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-24T10:57:07+00:00"
},
{
"name": "webmozart/assert",
"version": "1.5.0",
"version": "1.9.1",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4"
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4",
"url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
"reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0",
"php": "^5.3.3 || ^7.0 || ^8.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"phpstan/phpstan": "<0.12.20",
"vimeo/psalm": "<3.9.1"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
@ -2148,7 +2269,11 @@
"check",
"validate"
],
"time": "2019-08-24T08:43:50+00:00"
"support": {
"issues": "https://github.com/webmozart/assert/issues",
"source": "https://github.com/webmozart/assert/tree/master"
},
"time": "2020-07-08T17:02:28+00:00"
}
],
"aliases": [],

View File

@ -48,6 +48,7 @@ By
* In file nusoap.php, to avoid a warning,
Replace call to serialize_val with no bugged value
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
@ -217,14 +218,6 @@ JQUERYFILETREE:
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
PHPEXCEL:
---------
* Replace in htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
continue;
with:
continue 2;
RESTLER:
--------
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
@ -236,11 +229,21 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor
public static function getShortName($className)
{
// @CHANGE LDR
if (! is_string($className)) return;
if (!is_string($className)) return;
//var_dump($className);
* Add line into Data/Text.php to complete function
public static function endsWith($haystack, $needle)
{
$length = strlen($needle);
if ($length == 0) {
return true;
}
// @CHANGE LDR
if (!is_string($haystack)) return false;
PARSEDOWN
---------
@ -306,7 +309,7 @@ SELECT2
Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug: https://github.com/select2/select2/issues/5832
.select2-hidden-accessible {
margin: -1px !important; /* line to restore */
margin: -10000px !important; /* line to restore */
}

View File

@ -12,6 +12,11 @@ The script initdemo.sh will erase current database with data into mysqldump_doli
Do a chmod 700 initdemo.sh
then run ./initdemo.sh to launch Graphic User Interface.
After loading the demo files, admin login may be:
- admin / admin
or
- admin / adminadmin
*** Save demo

View File

@ -189,8 +189,8 @@ export res=$?
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
if [ "x$documentdir" != "x" ]
then
$DIALOG --title "Reset document directory tpp" --clear \
--inputbox "Delete and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
$DIALOG --title "Reset document directory" --clear \
--inputbox "DELETE and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
valret=$?

View File

@ -53,7 +53,7 @@ then
DIALOG="$DIALOG --ascii-lines"
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Init Dolibarr with demo values" --clear \
$DIALOG --title "Reset login password" --clear \
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
valret=$?
case $valret in
@ -70,7 +70,7 @@ then
DIALOG=${DIALOG=dialog}
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
trap "rm -f $fichtemp" 0 1 2 5 15
$DIALOG --title "Init Dolibarr with demo values" --clear \
$DIALOG --title "Reset login password" --clear \
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
valret=$?
@ -128,7 +128,7 @@ then
# ---------------------------- confirmation
DIALOG=${DIALOG=dialog}
$DIALOG --title "Init demo login with demo values" --clear \
$DIALOG --title "Reset login password" --clear \
--yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Demo login: '$demologin' \n Demo password : '$demopass'" 15 55
case $? in

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="INSTAT">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Envelope"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Envelope">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="envelopeId"/>
<xsd:element ref="DateTime"/>
<xsd:element ref="Party"/>
<xsd:element ref="softwareUsed" minOccurs="0"/>
<xsd:element ref="Declaration" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="envelopeId" type="xsd:string"/>
<xsd:element name="DateTime">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="date"/>
<xsd:element ref="time" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="Party">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="partyId"/>
<xsd:element ref="partyName"/>
</xsd:sequence>
<xsd:attribute name="partyType" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="PSI"/>
<xsd:enumeration value="TDP"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="partyRole" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="sender"/>
<xsd:enumeration value="PSI"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="partyId" type="xsd:string"/>
<xsd:element name="partyName" type="xsd:string"/>
<xsd:element name="softwareUsed" type="xsd:string"/>
<xsd:element name="Declaration">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="declarationId"/>
<xsd:element ref="referencePeriod"/>
<xsd:element ref="PSIId"/>
<xsd:element ref="Function"/>
<xsd:element ref="declarationTypeCode"/>
<xsd:element ref="flowCode"/>
<xsd:element ref="currencyCode"/>
<xsd:element ref="Item" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="declarationId" type="xsd:string"/>
<xsd:element name="referencePeriod" type="xsd:string"/>
<xsd:element name="PSIId" type="xsd:string"/>
<xsd:element name="Function">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="functionCode"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="functionCode" type="xsd:string"/>
<xsd:element name="declarationTypeCode" type="xsd:string"/>
<xsd:element name="flowCode" type="xsd:string"/>
<xsd:element name="currencyCode" type="xsd:string"/>
<xsd:element name="Item">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="itemNumber"/>
<xsd:element ref="CN8" minOccurs="0"/>
<xsd:element ref="MSConsDestCode" minOccurs="0"/>
<xsd:element ref="countryOfOriginCode" minOccurs="0"/>
<xsd:element ref="netMass" minOccurs="0"/>
<xsd:element ref="quantityInSU" minOccurs="0"/>
<xsd:element ref="invoicedAmount"/>
<xsd:element ref="partnerId" minOccurs="0"/>
<xsd:element ref="invoicedNumber" minOccurs="0"/>
<xsd:element ref="statisticalProcedureCode" />
<xsd:element ref="NatureOfTransaction" minOccurs="0"/>
<xsd:element ref="modeOfTransportCode" minOccurs="0"/>
<xsd:element ref="regionCode" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="itemNumber" type="xsd:integer"/>
<xsd:element name="CN8">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="CN8Code" minOccurs="0"/>
<xsd:element ref="SUCode" minOccurs="0"/>
<xsd:element ref="additionalGoodsCode" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="CN8Code" type="xsd:string"/>
<xsd:element name="SUCode" type="xsd:string"/>
<xsd:element name="additionalGoodsCode" type="xsd:string"/>
<xsd:element name="MSConsDestCode" type="xsd:string"/>
<xsd:element name="countryOfOriginCode" type="xsd:string"/>
<xsd:element name="netMass" type="xsd:integer"/>
<xsd:element name="quantityInSU" type="xsd:integer"/>
<xsd:element name="invoicedAmount" type="xsd:integer"/>
<xsd:element name="partnerId" type="xsd:string"/>
<xsd:element name="invoicedNumber" type="xsd:string"/>
<xsd:element name="statisticalProcedureCode" type="xsd:integer"/>
<xsd:element name="NatureOfTransaction">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="natureOfTransactionACode"/>
<xsd:element ref="natureOfTransactionBCode" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="natureOfTransactionACode" type="xsd:string"/>
<xsd:element name="natureOfTransactionBCode" type="xsd:string"/>
<xsd:element name="modeOfTransportCode" type="xsd:string"/>
<xsd:element name="regionCode" type="xsd:string"/>
<xsd:element name="date" type="xsd:date"/>
<xsd:element name="time" type="xsd:time"/>
</xsd:schema>

View File

@ -6,7 +6,7 @@
<exclude-pattern type="relative">build/html</exclude-pattern>
<exclude-pattern type="relative">build/aps</exclude-pattern>
<exclude-pattern type="relative">dev/namespacemig</exclude-pattern>
<exclude-pattern type="relative">dev/tools/test/namespacemig</exclude-pattern>
<exclude-pattern type="relative">dev/initdata/dbf/includes</exclude-pattern>
<exclude-pattern type="relative">documents</exclude-pattern>
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>

View File

@ -15,6 +15,9 @@ function faaa()
return 'faaa';
}
/**
* Class Aaa
*/
class Aaa
{
const AAA='aaa';

View File

@ -12,6 +12,9 @@ function fbbb()
return 'fbbb';
}
/**
* Class Bbb
*/
class Bbb
{
const BBB='bbb';

View File

@ -642,6 +642,7 @@ if (empty($reshook)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php', '', 1, array('morecss' => 'marginleftonly'));
$url = './card.php?action=create';
if (!empty($socid)) $url .= '&socid='.$socid;

View File

@ -39,8 +39,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->loadLangs(array("accountancy", "compta"));
$action = GETPOST('action', 'aZ09');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_accountancy_code = GETPOST("search_accountancy_code");
@ -126,9 +132,24 @@ $arrayfields = array(
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
if ($search_date_start && empty($search_date_startyear)) {
$tmparray = dol_getdate($search_date_start);
$search_date_startyear = $tmparray['year'];
$search_date_startmonth = $tmparray['mon'];
$search_date_startday = $tmparray['mday'];
}
if ($search_date_end && empty($search_date_endyear)) {
$tmparray = dol_getdate($search_date_end);
$search_date_endyear = $tmparray['year'];
$search_date_endmonth = $tmparray['mon'];
$search_date_endday = $tmparray['mday'];
}
/*
* Action
*/
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
@ -172,11 +193,11 @@ if (empty($reshook))
if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int');
$param .= '&search_date_startmonth='.$search_date_startmonth.'&search_date_startday='.$search_date_startday.'&search_date_startyear='.$search_date_startyear;
}
if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int');
$param .= '&search_date_endmonth='.$search_date_endmonth.'&search_date_endday='.$search_date_endday.'&search_date_endyear='.$search_date_endyear;
}
if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
@ -242,7 +263,7 @@ if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->suppri
}
// Make a redirect to avoid to launch the delete later after a back button
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
header("Location: ".$_SERVER["PHP_SELF"].($param ? '?'.$param : ''));
exit;
}
}
@ -267,7 +288,7 @@ if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouveme
}
// Make a redirect to avoid to launch the delete later after a back button
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
header("Location: ".$_SERVER["PHP_SELF"].($param ? '?'.$param : ''));
exit;
} else {
setEventMessages("NoRecordDeleted", null, 'warnings');
@ -284,7 +305,7 @@ if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->suppri
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
}
header("Location: listbyaccount.php?noreset=1".($param ? '&'.$param : ''));
header("Location: ".$_SERVER["PHP_SELF"]."?noreset=1".($param ? '&'.$param : ''));
exit;
}
}
@ -303,7 +324,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou
llxHeader('', $title_page);
// List
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
@ -380,10 +400,8 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= ' &nbsp; ';
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php', '', 1, array('morecss' => 'marginleftonly'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
@ -524,8 +542,15 @@ while ($i < min($num, $limit))
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 7;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber = 3;
$colnumberend = 7;
} else {
$colnumber = 4;
$colnumberend = 7;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
// Show a subtotal by accounting account
if (isset($displayed_account_number)) {
print '<tr class="liste_total">';
@ -646,11 +671,11 @@ while ($i < min($num, $limit))
// Other type
}
print '<td class="nowrap">';
print '<td class="maxwidth400">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
print '<td class="nobordernopadding">';
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
{
@ -725,8 +750,15 @@ while ($i < min($num, $limit))
}
// Show sub-total of last shown account
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 8;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber = 3;
$colnumberend = 7;
} else {
$colnumber = 4;
$colnumberend = 7;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';

View File

@ -39,8 +39,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->loadLangs(array("accountancy", "compta"));
$action = GETPOST('action', 'aZ09');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_accountancy_code = GETPOST("search_accountancy_code");
@ -126,6 +132,20 @@ $arrayfields = array(
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
if ($search_date_start && empty($search_date_startyear)) {
$tmparray = dol_getdate($search_date_start);
$search_date_startyear = $tmparray['year'];
$search_date_startmonth = $tmparray['mon'];
$search_date_startday = $tmparray['mday'];
}
if ($search_date_end && empty($search_date_endyear)) {
$tmparray = dol_getdate($search_date_end);
$search_date_endyear = $tmparray['year'];
$search_date_endmonth = $tmparray['mon'];
$search_date_endday = $tmparray['mday'];
}
/*
* Action
*/
@ -172,11 +192,11 @@ if (empty($reshook))
if (!empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int');
$param .= '&search_date_startmonth='.$search_date_startmonth.'&search_date_startday='.$search_date_startday.'&search_date_startyear='.$search_date_startyear;
}
if (!empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int');
$param .= '&search_date_endmonth='.$search_date_endmonth.'&search_date_endday='.$search_date_endday.'&search_date_endyear='.$search_date_endyear;
}
if (!empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
@ -242,7 +262,7 @@ if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->suppri
}
// Make a redirect to avoid to launch the delete later after a back button
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
header("Location: ".$_SERVER["PHP_SELF"].($param ? '?'.$param : ''));
exit;
}
}
@ -380,14 +400,19 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly'));
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbysubaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
print info_admin($langs->trans("WarningRecordWithoutSubledgerAreExcluded"));
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
@ -521,8 +546,15 @@ while ($i < min($num, $limit))
// Is it a break ?
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 7;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber = 3;
$colnumberend = 7;
} else {
$colnumber = 4;
$colnumberend = 7;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
// Show a subtotal by accounting account
if (isset($displayed_account_number)) {
print '<tr class="liste_total">';
@ -554,8 +586,16 @@ while ($i < min($num, $limit))
// Show the break account
print "<tr>";
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 9).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
if ($line->subledger_account != "" && $line->subledger_account != '-1') print length_accounta($line->subledger_account).' : '.$object->get_compte_desc($line->numero_compte);
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account);
} else {
// Should not happen: subledger account must be null or a non empty value
print '<span class="error">'.$langs->trans("Unknown");
if ($line->subledger_label) print ' ('.$line->subledger_label.')';
$htmltext = 'EmptyStringForSubledgerAccountButSubledgerLabelDefined';
print $form->textwithpicto('', $htmltext);
print '</span>';
}
print '</td>';
print '</tr>';
@ -643,11 +683,11 @@ while ($i < min($num, $limit))
// Other type
}
print '<td class="nowrap">';
print '<td class="maxwidth400">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
print '<td class="nobordernopadding">';
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
{
@ -722,8 +762,15 @@ while ($i < min($num, $limit))
}
// Show sub-total of last shown account
$colspan = $totalarray['nbfield'] - 3;
$colspanend = $totalarray['nbfield'] - 8;
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
$colnumber = 3;
$colnumberend = 7;
} else {
$colnumber = 4;
$colnumberend = 7;
}
$colspan = $totalarray['nbfield'] - $colnumber;
$colspanend = $totalarray['nbfield'] - $colnumberend;
print '<tr class="liste_total">';
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';

View File

@ -60,6 +60,7 @@ class AccountancyExport
public static $EXPORT_TYPE_GESTINUMV3 = 130;
public static $EXPORT_TYPE_GESTINUMV5 = 135;
public static $EXPORT_TYPE_FEC = 1000;
public static $EXPORT_TYPE_FEC2 = 1010;
/**
@ -121,6 +122,7 @@ class AccountancyExport
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
);
ksort($listofexporttypes, SORT_NUMERIC);
@ -155,6 +157,7 @@ class AccountancyExport
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
self::$EXPORT_TYPE_FEC => 'fec',
self::$EXPORT_TYPE_FEC2 => 'fec2',
);
return $formatcode[$type];
@ -234,6 +237,10 @@ class AccountancyExport
'label' => $langs->trans('Modelcsv_FEC'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
self::$EXPORT_TYPE_FEC2 => array(
'label' => $langs->trans('Modelcsv_FEC2'),
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
),
),
'cr'=> array(
'1' => $langs->trans("Unix"),
@ -322,6 +329,9 @@ class AccountancyExport
case self::$EXPORT_TYPE_FEC :
$this->exportFEC($TData);
break;
case self::$EXPORT_TYPE_FEC2 :
$this->exportFEC2($TData);
break;
default:
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
break;
@ -505,9 +515,9 @@ class AccountancyExport
$end_line = "\r\n";
//We should use dol_now function not time however this is wrong date to transfert in accounting
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
// We should use dol_now function not time however this is wrong date to transfert in accounting
// $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
// $date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
foreach ($TData as $data) {
$code_compta = $data->numero_compte;
if (!empty($data->subledger_account))
@ -519,36 +529,46 @@ class AccountancyExport
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
$Tab['folio'] = '000';
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
// We use invoice date $data->doc_date not $date_ecriture which is the transfert date
// maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
//$Tab['date_ecriture'] = $date_ecriture;
$Tab['date_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
$Tab['filler'] = ' ';
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 20), 20);
$Tab['sens'] = $data->sens; // C or D
$Tab['signe_montant'] = '+';
//elarifr le montant doit etre en centimes sans point decimal !
$Tab['montant'] = str_pad(abs($data->montant * 100), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
// $Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount
// Credit invoice - invert sens
if ($data->montant < 0) {
if ($data->sens == 'C') {
$Tab['sens'] = 'D';
} else {
$Tab['sens'] = 'C';
}
$Tab['signe_montant'] = '-';
} else {
$Tab['sens'] = $data->sens; // C or D
$Tab['signe_montant'] = '+';
}
// The amount must be in centimes without decimal points.
$Tab['montant'] = str_pad(abs($data->montant * 100), 12, '0', STR_PAD_LEFT);
$Tab['contrepartie'] = str_repeat(' ', 8);
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
// Force date format : %d%m%y
if (!empty($data->date_echeance)) {
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // Format must be ddmmyy
} else {
$Tab['date_echeance'] = '000000';
}
//elarifr please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5)
//$Tab['lettrage'] = str_repeat(' ', 5);
// Please keep quadra named field lettrage(2) + codestat(3) instead of fake lettrage(5)
// $Tab['lettrage'] = str_repeat(' ', 5);
$Tab['lettrage'] = str_repeat(' ', 2);
$Tab['codestat'] = str_repeat(' ', 3);
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 5), 5);
//elarifr keep correct quadra named field instead of anon filler
//$Tab['filler2'] = str_repeat(' ', 20);
// Keep correct quadra named field instead of anon filler
// $Tab['filler2'] = str_repeat(' ', 20);
$Tab['affaire'] = str_repeat(' ', 10);
$Tab['quantity1'] = str_repeat(' ', 10);
$Tab['num_piece2'] = str_pad(self::trunc($data->piece_num, 8), 8);
@ -556,17 +576,17 @@ class AccountancyExport
$Tab['code_journal2'] = str_pad(self::trunc($data->code_journal, 3), 3);
$Tab['filler3'] = str_repeat(' ', 3);
//elarifr keep correct quadra named field instead of anon filler libelle_ecriture2 is 30 char not 32 !!!!
//as we use utf8, we must remove accent to have only one ascii char instead of utf8 2 chars for specials that report wrong line size that will exceed import format spec
//todo we should filter more than only accent to avoid wrong line size
//TODO: remove invoice number doc_ref in libelle,
//TODO: we should offer an option for customer to build the libelle using invoice number / name / date in accounting software
// Keep correct quadra named field instead of anon filler libelle_ecriture2 is 30 char not 32 !!!!
// as we use utf8, we must remove accent to have only one ascii char instead of utf8 2 chars for specials that report wrong line size that will exceed import format spec
// TODO: we should filter more than only accent to avoid wrong line size
// TODO: remove invoice number doc_ref in libelle,
// TODO: we should offer an option for customer to build the libelle using invoice number / name / date in accounting software
//$Tab['libelle_ecriture2'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref) . ' ' . dol_string_unaccent($data->label_operation), 30), 30);
$Tab['libelle_ecriture2'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 30), 30);
$Tab['codetva'] = str_repeat(' ', 2);
//elarifr we need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
//$Tab['num_piece3'] = str_pad(self::trunc($data->piece_num, 10), 10);
// We need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
// $Tab['num_piece3'] = str_pad(self::trunc($data->piece_num, 10), 10);
$Tab['num_piece3'] = substr(self::trunc($data->doc_ref, 20), -10);
$Tab['filler4'] = str_repeat(' ', 73);
@ -801,7 +821,7 @@ class AccountancyExport
public function exportFEC($objectLines)
{
$separator = "\t";
$end_line = "\n";
$end_line = "\r\n";
print "JournalCode".$separator;
print "JournalLib".$separator;
@ -824,65 +844,169 @@ class AccountancyExport
print $end_line;
foreach ($objectLines as $line) {
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
if ($line->debit == 0 && $line->credit == 0) {
unset($array[$line]);
} else {
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
// FEC:JournalCode
print $line->code_journal.$separator;
// FEC:JournalCode
print $line->code_journal.$separator;
// FEC:JournalLib
print $line->journal_label.$separator;
// FEC:JournalLib
print $line->journal_label.$separator;
// FEC:EcritureNum
print $line->piece_num.$separator;
// FEC:EcritureNum
print $line->piece_num.$separator;
// FEC:EcritureDate
print $date_document.$separator;
// FEC:EcritureDate
print $date_document.$separator;
// FEC:CompteNum
print $line->numero_compte.$separator;
// FEC:CompteNum
print $line->numero_compte.$separator;
// FEC:CompteLib
print dol_string_unaccent($line->label_compte).$separator;
// FEC:CompteLib
print dol_string_unaccent($line->label_compte).$separator;
// FEC:CompAuxNum
print $line->subledger_account.$separator;
// FEC:CompAuxNum
print $line->subledger_account.$separator;
// FEC:CompAuxLib
print dol_string_unaccent($line->subledger_label).$separator;
// FEC:CompAuxLib
print dol_string_unaccent($line->subledger_label).$separator;
// FEC:PieceRef
print $line->doc_ref.$separator;
// FEC:PieceRef
print $line->doc_ref.$separator;
// FEC:PieceDate
print dol_string_unaccent($date_creation).$separator;
// FEC:PieceDate
print dol_string_unaccent($date_creation).$separator;
// FEC:EcritureLib
print $line->label_operation.$separator;
// FEC:EcritureLib
print dol_string_unaccent($line->label_operation).$separator;
// FEC:Debit
print price2fec($line->debit).$separator;
// FEC:Debit
print price2fec($line->debit).$separator;
// FEC:Credit
print price2fec($line->credit).$separator;
// FEC:Credit
print price2fec($line->credit).$separator;
// FEC:EcritureLet
print $line->lettering_code.$separator;
// FEC:EcritureLet
print $line->lettering_code.$separator;
// FEC:DateLet
print $line->date_lettering.$separator;
// FEC:DateLet
print $date_lettering.$separator;
// FEC:ValidDate
print $date_validation.$separator;
// FEC:ValidDate
print $date_validation.$separator;
// FEC:Montantdevise
print $line->multicurrency_amount.$separator;
// FEC:Montantdevise
print $line->multicurrency_amount.$separator;
// FEC:Idevise
print $line->multicurrency_code;
// FEC:Idevise
print $line->multicurrency_code;
print $end_line;
print $end_line;
}
}
}
/**
* Export format : FEC2
*
* @param array $objectLines data
* @return void
*/
public function exportFEC2($objectLines)
{
$separator = "\t";
$end_line = "\r\n";
print "JournalCode".$separator;
print "JournalLib".$separator;
print "EcritureNum".$separator;
print "EcritureDate".$separator;
print "CompteNum".$separator;
print "CompteLib".$separator;
print "CompAuxNum".$separator;
print "CompAuxLib".$separator;
print "PieceRef".$separator;
print "PieceDate".$separator;
print "EcritureLib".$separator;
print "Debit".$separator;
print "Credit".$separator;
print "EcritureLet".$separator;
print "DateLet".$separator;
print "ValidDate".$separator;
print "Montantdevise".$separator;
print "Idevise";
print $end_line;
foreach ($objectLines as $line) {
if ($line->debit == 0 && $line->credit == 0) {
unset($array[$line]);
} else {
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
// FEC:JournalCode
print $line->code_journal . $separator;
// FEC:JournalLib
print $line->journal_label . $separator;
// FEC:EcritureNum
print $line->piece_num . $separator;
// FEC:EcritureDate
print $date_creation . $separator;
// FEC:CompteNum
print $line->numero_compte . $separator;
// FEC:CompteLib
print dol_string_unaccent($line->label_compte) . $separator;
// FEC:CompAuxNum
print $line->subledger_account . $separator;
// FEC:CompAuxLib
print dol_string_unaccent($line->subledger_label) . $separator;
// FEC:PieceRef
print $line->doc_ref . $separator;
// FEC:PieceDate
print $date_document . $separator;
// FEC:EcritureLib
print dol_string_unaccent($line->label_operation) . $separator;
// FEC:Debit
print price2fec($line->debit) . $separator;
// FEC:Credit
print price2fec($line->credit) . $separator;
// FEC:EcritureLet
print $line->lettering_code . $separator;
// FEC:DateLet
print $date_lettering . $separator;
// FEC:ValidDate
print $date_validation . $separator;
// FEC:Montantdevise
print $line->multicurrency_amount . $separator;
// FEC:Idevise
print $line->multicurrency_code;
print $end_line;
}
}
}

View File

@ -825,6 +825,10 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} elseif ($key == 't.reconciled_option') {
$sqlwhere[] = 't.lettering_code IS NULL';
} elseif ($key == 't.code_journal' && !empty($value)) {
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
} else {
$sqlwhere[] = natural_search($key, $value, 0, 1);
}

View File

@ -960,7 +960,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
print '<tr><td>'.$form->editfieldkey("Categories", 'memcats', '', $object, 0).'</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1);
print $form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, null, null, '100%');
print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
print "</td></tr>";
}

View File

@ -146,12 +146,7 @@ $arrayfields = array(
'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000)
);
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
}
}
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
/*

View File

@ -300,57 +300,75 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if (!$error) {
// Send confirmation Email
if ($object->email && $sendalsoemail) { // $object is 'Adherent'
$subject = '';
$msg = '';
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
$parameters = array(
'datesubscription' => $datesubscription,
'amount' => $amount,
'ccountid' => $accountid,
'operation' => $operation,
'label' => $label,
'num_chq' => $num_chq,
'emetteur_nom' => $emetteur_nom,
'emetteur_banque' => $emetteur_banque,
'datesubend' => $datesubend
);
$reshook = $hookmanager->executeHooks('sendMail', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
if (empty($reshook)) {
$subject = '';
$msg = '';
// Attach a file ?
$file = '';
$listofpaths = array();
$listofnames = array();
$listofmimes = array();
if (is_object($object->invoice) && (!is_object($arraydefaultmessage) || intval($arraydefaultmessage->joinfiles))) {
$invoicediroutput = $conf->facture->dir_output;
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
$file = $fileparams['fullname'];
// Send subscription email
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$listofpaths = array($file);
$listofnames = array(basename($file));
$listofmimes = array(dol_mimetype($file));
}
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
$moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n";
if (!empty($labeltouse)) $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
$result = $object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1, '', $moreinheader);
if ($result < 0) {
$errmsg = $object->error;
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs');
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs);
// Attach a file ?
$file = '';
$listofpaths = array();
$listofnames = array();
$listofmimes = array();
if (is_object($object->invoice) && (!is_object($arraydefaultmessage) || intval($arraydefaultmessage->joinfiles))) {
$invoicediroutput = $conf->facture->dir_output;
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
$file = $fileparams['fullname'];
$listofpaths = array($file);
$listofnames = array(basename($file));
$listofmimes = array(dol_mimetype($file));
}
$moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n";
$result = $object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1, '', $moreinheader);
if ($result < 0) {
$errmsg = $object->error;
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs');
}
}
} else {
setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs');

View File

@ -187,10 +187,18 @@ print '<td class="center">&nbsp;</td>'."\n";
print '<td class="right">'."\n";
if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
if (! getIsHTTPS()) {
$langs->load("errors");
print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' ';
}
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Disabled'), 'switch_off').'</a>';
print '</td></tr>'."\n";
} else {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
if (! getIsHTTPS()) {
$langs->load("errors");
print img_warning($langs->trans("WarningAvailableOnlyForHTTPSServers"), '', 'valignmiddle size15x').' ';
}
print '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_REMINDER_BROWSER&amp;token='.newToken().'">'.img_picto($langs->trans('Enabled'), 'switch_on').'</a>';
print '</td></tr>'."\n";
print '<tr class="oddeven">'."\n";

View File

@ -111,11 +111,9 @@ if ($action == 'updateMask')
}
// Activate a model
elseif ($action == 'set')
{
elseif ($action == 'set') {
$ret = addDocumentModel($value, $type, $label, $scandir);
} elseif ($action == 'del')
{
} elseif ($action == 'del') {
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
@ -124,8 +122,7 @@ elseif ($action == 'set')
}
// Set default model
elseif ($action == 'setdoc')
{
elseif ($action == 'setdoc') {
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
{
// The constant that was read before the new set
@ -139,8 +136,7 @@ elseif ($action == 'setdoc')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
} elseif ($action == 'setmod')
{
} elseif ($action == 'setmod') {
// TODO Check if numbering module chosen can be activated
// by calling method canBeActivated
@ -254,6 +250,7 @@ print dol_get_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order')
print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
@ -346,7 +343,7 @@ foreach ($dirmodels as $reldir)
}
}
}
print "</table><br>\n";
print "</table></div><br>\n";
/*
@ -377,6 +374,7 @@ if ($resql)
}
print '<div class="div-table-responsive-no-min">';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>'.$langs->trans("Name").'</td>';
@ -501,6 +499,7 @@ foreach ($dirmodels as $reldir)
}
print '</table>';
print '</div>';
/*

View File

@ -178,13 +178,6 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))
}
}
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FACEBOOK_URL", GETPOST("facebookurl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TWITTER_URL", GETPOST("twitterurl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LINKEDIN_URL", GETPOST("linkedinurl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_INSTAGRAM_URL", GETPOST("instagramurl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_YOUTUBE_URL", GETPOST("youtubeurl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GITHUB_URL", GETPOST("githuburl", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity);
@ -478,6 +471,14 @@ if (!empty($mysoc->logo_small)) {
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
print '</div>';
} elseif (!empty($mysoc->logo)) {
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_mini', $quality);
}
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality);
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
print '</div>';
}
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} elseif (!empty($mysoc->logo)) {
@ -505,6 +506,14 @@ if (!empty($mysoc->logo_squarred_small)) {
print '<div class="inline-block valignmiddle marginrightonly">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_small).'">';
print '</div>';
} elseif (!empty($mysoc->logo_squarred)) {
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini, '_mini', $quality);
}
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo_squarred, $maxwidthmini, $maxheightmini, '_small', $quality);
print '<div class="inline-block valignmiddle">';
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
print '</div>';
}
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
} elseif (!empty($mysoc->logo_squarred)) {
@ -530,25 +539,6 @@ print '</td></tr>';
print '</table>';
// Social networks
print '<br>';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
$listofnetworks = array('facebook'=>'facebook', 'twitter'=>'twitter', 'linkedin'=>'linkedin', 'instagram'=>'instagram', 'youtube'=>'youtube', 'github'=>'github');
foreach ($listofnetworks as $networkkey => $networkicon) {
print '<tr class="oddeven"><td>';
print '<label for="'.$networkkey.'url">'.$langs->trans("SocialNetworks".ucfirst($networkkey)."URL").'</label></td><td>';
$networkconst = 'MAIN_INFO_SOCIETE_'.strtoupper($networkkey).'_URL';
print '<span class="fa paddingright fa-'.($networkicon ? $networkicon : 'link').'"></span>';
print '<input name="'.$networkkey.'url" id="'.$networkkey.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconst).'"></td></tr>';
print '</td></tr>'."\n";
}
print "</table>";
print '<br>';
// IDs of the company (country-specific)
@ -695,7 +685,7 @@ print '<td class="right">&nbsp;</td>';
print "</tr>\n";
// Main tax
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
print '<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
print '<td colspan="2">';
$tooltiphelp = '';
if ($mysoc->country_code == 'FR') $tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
@ -703,7 +693,7 @@ print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDes
print "</td></tr>\n";
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
print '<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="no_vat" value="0"'.(empty($conf->global->FACTURE_TVAOPTION) ? " checked" : "")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
print '<td colspan="2">';
$tooltiphelp = '';
if ($mysoc->country_code == 'FR') $tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
@ -723,7 +713,7 @@ print "</tr>\n";
if ($mysoc->useLocalTax(1))
{
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
@ -742,7 +732,7 @@ if ($mysoc->useLocalTax(1))
print "</div>";
print "</td></tr>\n";
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
@ -770,7 +760,7 @@ print "</tr>\n";
if ($mysoc->useLocalTax(2))
{
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
@ -786,7 +776,7 @@ if ($mysoc->useLocalTax(2))
print "</div>";
print "</td></tr>\n";
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
print '<td colspan="2">';
print "<div>";
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);

View File

@ -0,0 +1,142 @@
<?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2017 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/company_socialnetworks.php
* \ingroup company
* \brief Setup page to configure company social networks
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'admincompany'; // To manage different context of search
// Load translation files required by the page
$langs->loadLangs(array('admin', 'companies'));
if (!$user->admin) {
accessforbidden();
}
$listofnetworks = getArrayOfSocialNetworks();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('adminsocialnetworkscompany', 'globaladmin'));
/*
* Actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if (($action == 'update' && !GETPOST("cancel", 'alpha'))) {
foreach ($listofnetworks as $key => $value) {
if (!empty($value['active'])) {
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
if (GETPOSTISSET($key.'url') && GETPOST($key.'url', 'alpha') != '') {
dolibarr_set_const($db, $networkconstname, GETPOST($key.'url', 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, $networkconstid, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
} elseif (GETPOSTISSET($key) && GETPOST($key, 'alpha') != '') {
if (!empty($listofnetworks[$key]['url'])) {
$url = str_replace('{socialid}', GETPOST($key, 'alpha'), $listofnetworks[$key]['url']);
dolibarr_set_const($db, $networkconstname, $url, 'chaine', 0, '', $conf->entity);
}
dolibarr_set_const($db, $networkconstid, GETPOST($key, 'alpha'), 'chaine', 0, '', $conf->entity);
} else {
dolibarr_del_const($db, $networkconstname, $conf->entity);
dolibarr_del_const($db, $networkconstid, $conf->entity);
}
}
}
}
/*
* View
*/
$wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
llxHeader('', $langs->trans("Setup"), $wikihelp);
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
$head = company_admin_prepare_head();
print dol_get_fiche_head($head, 'socialnetworks', $langs->trans("SocialNetworksInformation"), -1, 'company');
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
print "<br>\n";
/**
* Edit parameters
*/
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
// Social networks
print '<br>';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print "</tr>\n";
foreach ($listofnetworks as $key => $value) {
if (!empty($value['active'])) {
print '<tr class="oddeven">';
print '<td><label for="'.$key.'url">'.$langs->trans(ucfirst($key)).'</label></td>';
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstname).'">';
print '</td><td>';
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($conf->global->$networkconstid).'">';
print '</td>';
print '<td>'.dol_print_socialnetworks($conf->global->$networkconstid, 0, 0, $key, $listofnetworks).'</td>';
print '</tr>'."\n";
}
}
print "</table>";
print '<br>';
print '<br><div class="center">';
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -135,12 +135,13 @@ if ($action == 'deletefilter')
{
$emailcollectorfilter = new EmailCollectorFilter($db);
$emailcollectorfilter->fetch(GETPOST('filterid', 'int'));
$result = $emailcollectorfilter->delete($user);
if ($result > 0)
{
$object->fetchFilters();
} else {
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
if ($emailcollectorfilter->id > 0) {
$result = $emailcollectorfilter->delete($user);
if ($result > 0) {
$object->fetchFilters();
} else {
setEventMessages($emailcollectorfilter->errors, $emailcollectorfilter->error, 'errors');
}
}
}
@ -153,13 +154,26 @@ if (GETPOST('addoperation', 'alpha'))
$emailcollectoroperation->status = 1;
$emailcollectoroperation->position = 50;
$result = $emailcollectoroperation->create($user);
if ($emailcollectoroperation->type == '-1') {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Operation")), null, 'errors');
}
if ($result > 0)
{
$object->fetchActions();
} else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
if (in_array($emailcollectoroperation->type, array('loadthirdparty', 'loadandcreatethirdparty'))
&& empty($emailcollectoroperation->actionparam)) {
$error++;
setEventMessages($langs->trans("ErrorAParameterIsRequiredForThisOperation"), null, 'errors');
}
if (!$error) {
$result = $emailcollectoroperation->create($user);
if ($result > 0) {
$object->fetchActions();
} else {
$error++;
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
}
@ -170,25 +184,35 @@ if ($action == 'updateoperation')
$emailcollectoroperation->actionparam = GETPOST('operationparam2', 'restricthtml');
$result = $emailcollectoroperation->update($user);
if (in_array($emailcollectoroperation->type, array('loadthirdparty', 'loadandcreatethirdparty'))
&& empty($emailcollectoroperation->actionparam)) {
$error++;
setEventMessages($langs->trans("ErrorAParameterIsRequiredForThisOperation"), null, 'errors');
}
if ($result > 0)
{
$object->fetchActions();
} else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
if (!$error) {
$result = $emailcollectoroperation->update($user);
if ($result > 0)
{
$object->fetchActions();
} else {
$error++;
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
}
if ($action == 'deleteoperation')
{
$emailcollectoroperation = new EmailCollectorAction($db);
$emailcollectoroperation->fetch(GETPOST('operationid', 'int'));
$result = $emailcollectoroperation->delete($user);
if ($result > 0)
{
$object->fetchActions();
} else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
if ($emailcollectoroperation->id > 0) {
$result = $emailcollectoroperation->delete($user);
if ($result > 0) {
$object->fetchActions();
} else {
setEventMessages($emailcollectoroperation->errors, $emailcollectoroperation->error, 'errors');
}
}
}
@ -412,13 +436,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtml .= $form->textwithpicto('', 'connect string '.$connectstringserver);
} else {
$morehtml .= 'IMAP functions not available on your PHP';
$morehtml .= 'IMAP functions not available on your PHP. ';
}
if (!$connection)
{
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
$morehtml .= '<br>'.imap_last_error();
if (function_exists('imap_last_error')) {
$morehtml .= '<br>'.imap_last_error();
}
//var_dump(imap_errors())
} else {
$morehtml .= imap_num_msg($connection);
@ -456,7 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="div-table-responsive">';
print '<table class="border centpercent tableforfield">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Filters").'</td><td></td><td></td>';
print '<td>'.$form->textwithpicto($langs->trans("Filters"), $langs->trans("EmailCollectorFilterDesc")).'</td><td></td><td></td>';
print '</tr>';
// Add filter
print '<tr class="oddeven">';
@ -489,7 +515,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1),
'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1)
);
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth500', 0, '', 2);
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth500', 1, '', 2);
print "\n";
print '<script>';
@ -542,7 +568,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<div class="div-table-responsive">';
print '<table id="tablelines" class="noborder noshadow tableforfield">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("EmailcollectorOperations").'</td><td></td><td></td><td></td>';
print '<td>'.$form->textwithpicto($langs->trans("EmailcollectorOperations"), $langs->trans("EmailcollectorOperationsDesc")).'</td><td></td><td></td><td></td>';
print '</tr>';
// Add operation
print '<tr class="oddeven">';
@ -559,13 +585,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$parameters = array('arrayoftypes' => $arrayoftypes);
$res = $hookmanager->executeHooks('addMoreActionsEmailCollector', $parameters, $object, $action);
if ($res)
if ($res) {
$arrayoftypes = $hookmanager->resArray;
else foreach ($hookmanager->resArray as $k=>$desc)
} else {
foreach ($hookmanager->resArray as $k=>$desc) {
$arrayoftypes[$k] = $desc;
}
}
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300');
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1);
print '</td><td>';
print '<input type="text" name="operationparam">';
print '</td>';

View File

@ -131,9 +131,12 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
$permissiontoread = $user->rights->emailcollector->read;
/*$permissiontoread = $user->rights->emailcollector->read;
$permissiontoadd = $user->rights->emailcollector->write;
$permissiontodelete = $user->rights->emailcollector->delete;
$permissiontodelete = $user->rights->emailcollector->delete;*/
$permissiontoread = $user->admin;
$permissiontoadd = $user->admin;
$permissiontodelete = $user->admin;
if (!$user->admin) accessforbidden();
if (empty($conf->emailcollector->enabled)) accessforbidden('Module not enabled');
@ -175,8 +178,6 @@ if (empty($reshook))
// Mass actions
$objectclass = 'EmailCollector';
$objectlabel = 'EmailCollector';
$permissiontoread = $user->rights->emailcollector->read;
$permissiontodelete = $user->rights->emailcollector->delete;
$uploaddir = $conf->emailcollector->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}

View File

@ -156,7 +156,8 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
@ -241,30 +242,33 @@ print '<input type="hidden" name="action" value="update">';
clearstatcache();
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
print '</tr>';
// Default language
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultLanguage").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
print '</td>';
print '</tr>';
// Multilingual GUI
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableMultilangInterface").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("EnableMultilangInterface").'</td><td>';
print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '</tr>';
print '</table><br>'."\n";
print '</div>';
// Themes and themes options
showSkins(null, 1);
print '<br>';
// Other
print '<div class="div-table-responsive-no-min">';
print '<table summary="otherparameters" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th>'.$langs->trans("Miscellaneous").'</th><th></th>';
print '<th width="20">&nbsp;</tg>';
@ -299,37 +303,46 @@ print '</tr>';
*/
// First day for weeks
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("WeekStartOnDay").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("WeekStartOnDay").'</td><td>';
print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'), 'MAIN_START_WEEK', 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingDays
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingDays").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingDays").'</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_DAYS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_DAYS) ? $conf->global->MAIN_DEFAULT_WORKING_DAYS : '1-5').'">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// DefaultWorkingHours
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DefaultWorkingHours").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("DefaultWorkingHours").'</td><td>';
print '<input type="text" name="MAIN_DEFAULT_WORKING_HOURS" size="5" value="'.(isset($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? $conf->global->MAIN_DEFAULT_WORKING_HOURS : '9-18').'">';
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Firstname/Name
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("FirstnameNamePosition").'</td><td>';
$array = array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION) ? $conf->global->MAIN_FIRSTNAME_NAME_POSITION : 0));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized menus
print '<tr class="oddeven"><td>'.$langs->trans("HideUnauthorizedMenu").'</td><td>';
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
// Hide unauthorized button
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
print '<tr class="oddeven"><td>'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
@ -337,7 +350,7 @@ print '</tr>';
// Hide version link
/*
print '<tr><td class="titlefield">'.$langs->trans("HideVersionLink").'</td><td>';
print '<tr><td>'.$langs->trans("HideVersionLink").'</td><td>';
print $form->selectyesno('MAIN_HIDE_VERSION',$conf->global->MAIN_HIDE_VERSION,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
@ -345,7 +358,7 @@ print '</tr>';
*/
// Show bugtrack link
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
print ajax_constantonoff("MAIN_BUGTRACK_ENABLELINK", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1);
print '</td>';
@ -354,7 +367,7 @@ print '</tr>';
// Hide wiki link on login page
$pictohelp = '<span class="fa fa-question-circle"></span>';
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelp", $pictohelp).'</td><td>';
print '<tr class="oddeven"><td>'.str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')).'</td><td>';
print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print '</td>';
@ -365,7 +378,7 @@ print '</tr>';
$substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
complete_substitutions_array($substitutionarray, $langs);
print '<tr class="oddeven"><td class="titlefield">';
print '<tr class="oddeven"><td>';
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
foreach ($substitutionarray as $key => $val)
{
@ -381,18 +394,19 @@ $doleditor->Create();
print '</td></tr>'."\n";
print '</table>'."\n";
print '</div>';
print '<br>';
// Other
print '<div class="div-table-responsive-no-min">';
print '<table summary="edit" class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("LoginPage").'</th><th></th>';
print '<tr class="liste_titre"><th>'.$langs->trans("LoginPage").'</th><th></th>';
print '<th width="20">&nbsp;</th>';
print '</tr>';
// Hide helpcenter link on login page
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
print '</td>';
print '<td width="20">&nbsp;</td>';

View File

@ -123,7 +123,7 @@ print '</td></tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("MailingDelay").'</td><td>';
print '<input size="32" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
print '</td></tr>';

View File

@ -131,8 +131,12 @@ if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') $
$form = new Form($db);
$linuxlike = 1;
if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0;
if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0;
if (preg_match('/^win/i', PHP_OS)) {
$linuxlike = 0;
}
if (preg_match('/^mac/i', PHP_OS)) {
$linuxlike = 0;
}
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE = 'mail';
$port = !empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ini_get('smtp_port');

View File

@ -141,12 +141,6 @@ $head[$h][1] = $langs->trans("MenuAdmin");
$head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';

View File

@ -224,11 +224,6 @@ $head[$h][1] = $langs->trans("MenuAdmin");
$head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
print dol_get_fiche_head($head, 'editor', '', -1);
print '<span class="opacitymedium">'.$langs->trans("MenusEditorDesc")."</span><br>\n";

View File

@ -1,106 +0,0 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/menus/other.php
* \ingroup core
* \brief Menus options setup
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("user", "other", "admin"));
if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09');
/*
* Actions
*/
if ($action == 'activate_hidemenu')
{
dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} elseif ($action == 'disable_hidemenu')
{
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
/*
* View
*/
llxHeader('', $langs->trans("Setup"));
print load_fiche_titre($langs->trans("Menus"), '', 'title_setup');
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
$head[$h][1] = $langs->trans("MenuHandlers");
$head[$h][2] = 'handler';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
$head[$h][1] = $langs->trans("MenuAdmin");
$head[$h][2] = 'editor';
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
$head[$h][1] = $langs->trans("Miscellaneous");
$head[$h][2] = 'misc';
$h++;
print dol_get_fiche_head($head, 'misc', '', -1);
// Other Options
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
print '</tr>';
// Hide unauthorized menu
print '<tr class="oddeven">';
print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
print '<td class="center">';
if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} else {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
}
print "</td>";
print '</tr>';
print '</table>';
// End of page
llxFooter();
$db->close();

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'stocks'));
if (!$user->admin) accessforbidden();
@ -80,6 +80,7 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@ -331,6 +332,10 @@ print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? G
//}
print '</td></tr>';
// SHOW_SUBPRODUCT_REF_IN_PDF - Option to show the detail of product ref for kits.
print '<tr class="oddeven"><td>'.$langs->trans("SHOW_SUBPRODUCT_REF_IN_PDF", $langs->transnoentitiesnoconv("AssociatedProductsAbility"), $langs->transnoentitiesnoconv("Products")).'</td><td>';
print $form->selectyesno('SHOW_SUBPRODUCT_REF_IN_PDF', (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) ? $conf->global->SHOW_SUBPRODUCT_REF_IN_PDF : 0, 1);
print '</td></tr>';
print '</table>';
print '</div>';

View File

@ -39,6 +39,8 @@ if (!$user->admin) accessforbidden();
$action = GETPOST('action', 'aZ09');
$type = 'paymentorder';
$error = 0;
/*
* Actions
@ -73,30 +75,25 @@ if ($action == "set")
} else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (! ($res > 0)) $error++;
if (GETPOST("PRELEVEMENT_USER") > 0)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
}
if (GETPOST("PRELEVEMENT_USER") > 0) {
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END") == "") {
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD") == "") {
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS") == "")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
} elseif (!$error)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
if (! $error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@ -193,9 +190,10 @@ print '</td></tr>';
//ADDDAYS
print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
print '<td class="left">';
if (!$conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS = 0;
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS = 0;
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
print '</td></tr>';
print '</table>';
print '<br>';

View File

@ -153,7 +153,7 @@ if (ini_get('safe_mode') && !empty($conf->global->MAIN_ANTIVIRUS_COMMAND))
dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING);
}
}
print '<input type="text" '.(defined('MAIN_ANTIVIRUS_COMMAND') ? 'disabled' : '').' name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_COMMAND) : '').'">';
print '<input type="text" '.(defined('MAIN_ANTIVIRUS_COMMAND') ? 'disabled ' : '').'name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_COMMAND) : '').'">';
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
print '<br><span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
}
@ -167,7 +167,7 @@ print '<td colspan="2">'.$langs->trans("AntiVirusParam").'<br>';
print '<span class="opacitymedium">'.$langs->trans("AntiVirusParamExample").'</span>';
print '</td>';
print '<td>';
print '<input type="text" name="MAIN_ANTIVIRUS_PARAM" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_PARAM) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_PARAM) : '').'">';
print '<input type="text" '.(defined('MAIN_ANTIVIRUS_PARAM') ? 'disabled ' : '').'name="MAIN_ANTIVIRUS_PARAM" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_PARAM) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_PARAM) : '').'">';
if (defined('MAIN_ANTIVIRUS_PARAM')) {
print '<br><span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
}

View File

@ -29,7 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "admin", "products", "sms", "other", "errors"));
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
if (!$user->admin) {
accessforbidden();
@ -43,8 +44,6 @@ $substitutionarrayfortest = array(
'__FIRSTNAME__' => 'TESTFirstname'
);
$action = GETPOST('action', 'aZ09');
/*
* Actions
@ -62,9 +61,7 @@ if ($action == 'update' && !$cancel) {
}
/*
* Send sms
*/
// Send sms
if ($action == 'send' && !$_POST['cancel']) {
$error = 0;
@ -135,6 +132,8 @@ if ($action == 'send' && !$_POST['cancel']) {
* View
*/
$form = new Form($db);
$linuxlike = 1;
if (preg_match('/^win/i', PHP_OS)) {
$linuxlike = 0;
@ -162,8 +161,6 @@ if (!count($listofmethods)) {
}
if ($action == 'edit') {
$form = new Form($db);
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
@ -274,30 +271,6 @@ if ($action == 'edit') {
}
print '</div>';
// Run the test to connect
/*
if ($_GET["action"] == 'testconnect')
{
print '<br>';
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
// If we use SSL/TLS
if (! empty($conf->global->MAIN_MAIL_EMAIL_TLS) && function_exists('openssl_open')) $server='ssl://'.$server;
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mail = new CSMSFile('','','','');
$result=$mail->check_server_port($server,$port);
if ($result) print '<div class="ok">'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'</div>';
else
{
print '<div class="error">'.$langs->trans("ServerNotAvailableOnIPOrPort",$server,$port);
if ($mail->error) print ' - '.$mail->error;
print '</div>';
}
print '<br>';
}*/
// Affichage formulaire de TEST simple
if ($action == 'test') {
print '<br>';
@ -308,12 +281,12 @@ if ($action == 'edit') {
$formsms = new FormSms($db);
$formsms->fromtype = 'user';
$formsms->fromid = $user->id;
$formsms->fromsms = (GETPOSTISSET('fromsms') ? $_POST['fromsms'] : ($conf->global->MAIN_MAIL_SMS_FROM ? $conf->global->MAIN_MAIL_SMS_FROM : $user->user_mobile));
$formsms->fromsms = (GETPOSTISSET('fromsms') ? GETPOST('fromsms') : ($conf->global->MAIN_MAIL_SMS_FROM ? $conf->global->MAIN_MAIL_SMS_FROM : $user->user_mobile));
$formsms->withfromreadonly = 0;
$formsms->withsubstit = 0;
$formsms->withfrom = 1;
$formsms->withto = (GETPOSTISSET('sendto') ? $_POST['sendto'] : ($user->user_mobile ? $user->user_mobile : 1));
$formsms->withbody = (GETPOSTISSET('message') ? (empty($_POST['message']) ? 1 : $_POST['message']) : $langs->trans("ThisIsATestMessage"));
$formsms->withto = (GETPOSTISSET('sendto') ? GETPOST('sendto') : ($user->user_mobile ? $user->user_mobile : 1));
$formsms->withbody = (GETPOSTISSET('message') ? (!GETPOST('message') ? 1 : GETPOST('message')) : $langs->trans("ThisIsATestMessage"));
$formsms->withbodyreadonly = 0;
$formsms->withcancel = 1;
// Tableau des substitutions

View File

@ -1,118 +0,0 @@
<?php
/* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/admin/socialnetworks.php
* \ingroup socialnetworks
* \brief Page to setup the module Social Networks
*/
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/mailmanspip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "errors"));
if (!$user->admin) accessforbidden();
$type = array('yesno', 'texte', 'chaine');
$action = GETPOST('action', 'aZ09');
/*
* Action
*/
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
{
$code = $reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);
}
}
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
{
$code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);
}
}
/*
* View
*/
$help_url = '';
llxHeader('', $langs->trans("SocialNetworkSetup"), $help_url);
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("SocialNetworkSetup"), $linkback, 'title_setup');
//$head = socialnetworks_admin_prepare_head();
$h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/admin/socialnetworks.php';
$head[$h][1] = $langs->trans("Setup");
$head[$h][2] = 'setup';
$h++;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print dol_get_fiche_head($head, 'setup', '', 0, 'user');
print '<br>';
$arrayofsocialnetworks = array('jabber'=>'Jabber', 'skype'=>'Skype', 'twitter'=>'Twitter', 'facebook'=>'Facebook', 'linkedin'=>'LinkedIn');
foreach ($arrayofsocialnetworks as $snkey => $snlabel) {
$consttocheck = 'SOCIALNETWORKS_'.strtoupper($snkey);
if ($conf->use_javascript_ajax) {
$link = ajax_constantonoff($consttocheck);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
$link = $form->selectarray($consttocheck, $arrval, $conf->global->$consttocheck);
}
print $langs->trans('EnableFeatureFor', $snlabel).' '.$link.'<br><br>';
}
print dol_get_fiche_end();
print '</form>';
// End of page
llxFooter();
$db->close();

View File

@ -146,8 +146,7 @@ elseif ($action == 'setdoc')
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
} elseif ($action == 'unsetdoc')
{
} elseif ($action == 'unsetdoc') {
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
}

View File

@ -77,7 +77,6 @@ $configfileparameters = array(
'?dolibarr_lib_FPDI_PATH',
'?dolibarr_lib_TCPDI_PATH',
'?dolibarr_lib_NUSOAP_PATH',
'?dolibarr_lib_PHPEXCEL_PATH',
'?dolibarr_lib_GEOIP_PATH',
'?dolibarr_lib_ODTPHP_PATH',
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
@ -124,7 +123,6 @@ $configfilelib = array(
'dolibarr_lib_TCPDF_PATH',
'dolibarr_lib_FPDI_PATH',
'dolibarr_lib_NUSOAP_PATH',
'dolibarr_lib_PHPEXCEL_PATH',
'dolibarr_lib_GEOIP_PATH',
'dolibarr_lib_ODTPHP_PATH',
'dolibarr_lib_ODTPHP_PATHTOPCLZIP',

View File

@ -45,15 +45,15 @@ print load_fiche_titre($langs->trans("InfoDatabase"), '', 'title_setup');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Database").'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DatabaseServer").'</td><td>'.$conf->db->host.'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DatabasePort").'</td><td>'.(empty($conf->db->port) ? $langs->trans("Default") : $conf->db->port).'</td></tr>'."\n";
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DatabaseName").'</td><td>'.$conf->db->name.'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DriverType").'</td><td>'.$conf->db->type.($db->getDriverInfo() ? ' ('.$db->getDriverInfo().')' : '').'</td></tr>'."\n";
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("User").'</td><td>'.$conf->db->user.'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $dolibarr_main_db_pass).'</td></tr>'."\n";
print '<tr '.$bc[1].'><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Version").'</td><td>'.$db::LABEL.' '.$db->getVersion().'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DatabaseServer").'</td><td>'.$conf->db->host.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DatabasePort").'</td><td>'.(empty($conf->db->port) ? $langs->trans("Default") : $conf->db->port).'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DatabaseName").'</td><td>'.$conf->db->name.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DriverType").'</td><td>'.$conf->db->type.($db->getDriverInfo() ? ' ('.$db->getDriverInfo().')' : '').'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("User").'</td><td>'.$conf->db->user.'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $dolibarr_main_db_pass).'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBStoringCharset").'</td><td>'.$db->getDefaultCharacterSetDatabase().'</td></tr>'."\n";
print '<tr class="oddeven"><td width="300">'.$langs->trans("DBSortingCharset").'</td><td>'.$db->getDefaultCollationDatabase().'</td></tr>'."\n";
print '</table>';
print '</div>';
@ -62,7 +62,7 @@ print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Tables").'</td></tr>'."\n";
print '<tr '.$bc[0].'><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
print '<tr class="oddeven"><td width="300"><a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?mainmenu=home">'.$langs->trans("List").'</a></td></tr>'."\n";
print '</table>';
print '</div>';
@ -104,7 +104,7 @@ if (!count($listofvars) && !count($listofstatus))
print '<td>';
print $param;
print '</td>';
print '<td>';
print '<td class="wordbreak">';
$show = 0; $text = '';
foreach ($arraytest as $key => $val)
{

View File

@ -319,7 +319,6 @@ $configfileparameters = array(
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
'?dolibarr_lib_PHPEXCEL_PATH' => 'dolibarr_lib_PHPEXCEL_PATH',
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',

View File

@ -191,6 +191,16 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
print "</tr>";
}
$functions = ["imap_open"];
$name = "IMAP";
print "<tr>";
print "<td>".$name."</td>";
print getTableColumn($name, $loadedExtensions);
print getTableColumnFunction($functions);
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
print "</tr>";
$functions = array();
$name = "xDebug";
@ -346,7 +356,7 @@ function getResultColumn($name, array $activated, array $loaded, array $function
}
$html = "<td>";
$html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport".$name);
$html .= $result ? $langs->trans("PHPSupport", $name) : $langs->trans("ErrorPHPDoesNotSupport", $name);
$html .= "</td>";
return $html;

View File

@ -44,10 +44,13 @@ $type = 'ticket';
$error = 0;
/*
* Actions
*/
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstticket = GETPOST('maskconstticket', 'alpha');
$maskticket = GETPOST('maskticket', 'alpha');
@ -66,7 +69,37 @@ if ($action == 'updateMask') {
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
} elseif ($action == 'setmod') {
}
// Activate a model
elseif ($action == 'set') {
$ret = addDocumentModel($value, $type, $label, $scandir);
} elseif ($action == 'del') {
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
if ($conf->global->TICKET_ADDON_PDF == "$value") dolibarr_del_const($db, 'TICKET_ADDON_PDF', $conf->entity);
}
}
// Set default model
elseif ($action == 'setdoc') {
if (dolibarr_set_const($db, "TICKET_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
{
// The constant that was read before the new set
// We therefore requires a variable to have a coherent view
$conf->global->TICKET_ADDON_PDF = $value;
}
// On active le modele
$ret = delDocumentModel($value, $type);
if ($ret > 0)
{
$ret = addDocumentModel($value, $type, $label, $scandir);
}
}
elseif ($action == 'setmod') {
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@ -190,7 +223,7 @@ print dol_get_fiche_end();
/*
* Projects Numbering model
* Tickets numbering model
*/
print load_fiche_titre($langs->trans("TicketNumberingModules"), '', '');
@ -291,6 +324,162 @@ print '</table>';
print '</div>';
print '<br>';
/*
* Document templates generators
*/
print load_fiche_titre($langs->trans("TicketsModelModule"), '', '');
// Load array def with activated templates
$def = array();
$sql = "SELECT nom";
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
$sql .= " WHERE type = '".$db->escape($type)."'";
$sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num_rows = $db->num_rows($resql);
while ($i < $num_rows)
{
$array = $db->fetch_array($resql);
array_push($def, $array[0]);
$i++;
}
} else {
dol_print_error($db);
}
print '<div class="div-table-responsive-no-min">';
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
clearstatcache();
foreach ($dirmodels as $reldir)
{
foreach (array('', '/doc') as $valdir)
{
$realpath = $reldir."core/modules/ticket".$valdir;
$dir = dol_buildpath($realpath);
if (is_dir($dir))
{
$handle = opendir($dir);
if (is_resource($handle))
{
while (($file = readdir($handle)) !== false)
{
$filelist[] = $file;
}
closedir($handle);
arsort($filelist);
foreach ($filelist as $file)
{
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
{
if (file_exists($dir.'/'.$file))
{
$name = substr($file, 4, dol_strlen($file) - 16);
$classname = substr($file, 0, dol_strlen($file) - 12);
require_once $dir.'/'.$file;
$module = new $classname($db);
$modulequalified = 1;
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
if ($modulequalified)
{
print '<tr class="oddeven"><td width="100">';
print (empty($module->name) ? $name : $module->name);
print "</td><td>\n";
if (method_exists($module, 'info')) print $module->info($langs);
else print $module->description;
print '</td>';
// Active
if (in_array($name, $def))
{
print '<td class="center">'."\n";
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print '</a>';
print '</td>';
} else {
print '<td class="center">'."\n";
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
print "</td>";
}
// Default
print '<td class="center">';
if ($conf->global->TICKET_ADDON_PDF == $name)
{
print img_picto($langs->trans("Default"), 'on');
} else {
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
}
print '</td>';
// Info
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
if ($module->type == 'pdf')
{
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
}
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
//$htmltooltip .= '<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
//$htmltooltip .= '<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
//$htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
print '<td class="center">';
print $form->textwithpicto('', $htmltooltip, 1, 0);
print '</td>';
// Preview
print '<td class="center">';
if ($module->type == 'pdf')
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
} else {
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
}
print '</td>';
print "</tr>\n";
}
}
}
}
}
}
}
}
print '</table>';
print '</div><br>';
if (!$conf->use_javascript_ajax) {
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data" >';
print '<input type="hidden" name="token" value="'.newToken().'">';

View File

@ -33,8 +33,8 @@ $langs->load("admin");
$action = GETPOST('action', 'aZ09');
$what = GETPOST('what', 'alpha');
$export_type = GETPOST('export_type', 'alpha');
$file = GETPOST('zipfilename_template', 'alpha');
$compression = GETPOST('compression');
$file = trim(GETPOST('zipfilename_template', 'alpha'));
$compression = GETPOST('compression', 'aZ09');
$file = dol_sanitizeFileName($file);
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);

View File

@ -91,7 +91,7 @@ print '<table class="border centpercent">';
print '<tr class="border"><td style="padding: 4px">';
if (!empty($conf->syslog->enabled)) {
print '<input type="radio" name="choice" value="logfile"';
print '<input type="radio" name="choice" id="choicelogfile" value="logfile"';
print ($choice && $choice == 'logfile') ? ' checked' : '';
$filelogparam = $filelog;
if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog))) {
@ -101,17 +101,17 @@ if (!empty($conf->syslog->enabled)) {
}
$desc = $langs->trans("PurgeDeleteLogFile", '{filelogparam}');
$desc = str_replace('{filelogparam}', $filelogparam, $desc);
print '> '.$desc;
print '> <label for="choicelogfile">'.$desc.'</label>';
print '<br><br>';
}
print '<input type="radio" name="choice" value="tempfiles"';
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
print '> '.$langs->trans("PurgeDeleteTemporaryFiles").'<br><br>';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
print '<input type="radio" name="choice" value="confirm_allfiles"';
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';
print '> '.$langs->trans("PurgeDeleteAllFilesInDocumentsDir", $dolibarr_main_data_root).'<br>';
print '> <label for="choiceallfiles">'.$langs->trans("PurgeDeleteAllFilesInDocumentsDir", $dolibarr_main_data_root).'</label><br>';
print '</td></tr></table>';

View File

@ -190,7 +190,7 @@ $formadmin = new FormAdmin($db);
$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración';
llxHeader('', $langs->trans("Setup"), $wikihelp);
$param = '&mode='.$mode;
$param = '&mode='.urlencode($mode);
$enabledisablehtml = '';
$enabledisablehtml .= $langs->trans("EnableOverwriteTranslation").' ';
@ -246,7 +246,7 @@ if ($mode == 'overwrite')
print '<div class="justify"><span class="opacitymedium">';
print img_info().' '.$langs->trans("SomeTranslationAreUncomplete");
$urlwikitranslatordoc = 'https://wiki.dolibarr.org/index.php/Translator_documentation';
print ' ('.$langs->trans("SeeAlso", '<a href="'.$urlwikitranslatordoc.'" target="_blank">'.$langs->trans("Here").'</a>').')<br>';
print ' ('.str_replace('{s1}', '<a href="'.$urlwikitranslatordoc.'" target="_blank">'.$langs->trans("Here").'</a>', $langs->trans("SeeAlso", '{s1}')).')<br>';
print $langs->trans("TranslationOverwriteDesc", $langs->transnoentitiesnoconv("Language"), $langs->transnoentitiesnoconv("Key"), $langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n";
print ' ('.$langs->trans("TranslationOverwriteDesc2").').'."<br>\n";
print '</span></div>';
@ -338,16 +338,15 @@ if ($mode == 'overwrite')
print '</td>';
print '<td class="center">';
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int'))
{
if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) {
print '<input type="hidden" class="button" name="rowid" value="'.$obj->rowid.'">';
print '<input type="submit" class="button buttongen button-save" name="save" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
print ' &nbsp; ';
print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
} else {
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print '<a class="reposition editfielda paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=edit'.((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
print ' &nbsp; ';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$obj->entity.'&mode='.urlencode($mode).'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
}
print '</td>';
@ -493,14 +492,12 @@ if ($mode == 'searchkey')
print '<tr class="oddeven"><td>'.$langcode.'</td><td>'.$key.'</td><td>';
print dol_escape_htmltag($val);
print '</td><td class="right nowraponall">';
if (!empty($newlangfileonly->tab_translate[$key]))
{
if ($val != $newlangfileonly->tab_translate[$key])
{
if (!empty($newlangfileonly->tab_translate[$key])) {
if ($val != $newlangfileonly->tab_translate[$key]) {
// retrieve rowid
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans";
$sql .= " WHERE transkey = '".$key."'";
$sql .= " WHERE transkey = '".$db->escape($key)."'";
$sql .= " AND entity IN (".getEntity('overwrite_trans').")";
dol_syslog("translation::select from table", LOG_DEBUG);
$result = $db->query($sql);
@ -508,16 +505,15 @@ if ($mode == 'searchkey')
{
$obj = $db->fetch_object($result);
}
print '<a class="editfielda reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=edit">'.img_edit().'</a>';
print '<a class="editfielda reposition marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode=overwrite&action=edit">'.img_edit().'</a>';
print ' ';
print '<a href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$obj->rowid.'&entity='.$conf->entity.'&mode='.urlencode($mode).'&action=delete&mode='.urlencode($mode).'&token='.newToken().'">'.img_delete().'</a>';
print '&nbsp;&nbsp;';
$htmltext = $langs->trans("OriginalValueWas", '<i>'.$newlangfileonly->tab_translate[$key].'</i>');
print $form->textwithpicto('', $htmltext, 1, 'info');
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
{
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
//print $key.'-'.$val;
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&amp;langcode='.$langcode.'&amp;transkey='.$key.'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
}
if (!empty($conf->global->MAIN_FEATURES_LEVEL))

View File

@ -167,7 +167,13 @@ class DolibarrApi
unset($object->libelle_statut);
unset($object->libelle_paiement);
if ($object->table_element != 'ticket') {
unset($object->prefix_comm);
unset($object->sendtoid);
unset($object->name_bis);
unset($object->newref);
if (!isset($object->table_element) || $object->table_element != 'ticket') {
unset($object->comments);
}

View File

@ -120,7 +120,7 @@ class Documents extends DolibarrApi
/**
* Build a document.
*
* Test sample 1: { "module_part": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
* Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
*
* @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...).
* @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf).
@ -497,6 +497,17 @@ class Documents extends DolibarrApi
$filearray = dol_dir_list($upload_dir, $type, $recursive, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1);
if (empty($filearray)) {
throw new RestException(404, 'Search for modulepart '.$modulepart.' with Id '.$object->id.(!empty($object->ref) ? ' or Ref '.$object->ref : '').' does not return any document.');
} else {
if (($object->id) > 0 && !empty($modulepart)) {
require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
$ecmfile = new EcmFiles($this->db);
$result = $ecmfile->fetchAll('', '', 0, 0, array('t.src_object_type' => $modulepart, 't.src_object_id' => $object->id));
if ($result < 0) {
throw new RestException(503, 'Error when retrieve ecm list : ' . $this->db->lasterror());
} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
$filearray['ecmfiles_infos'] = $ecmfile->lines;
}
}
}
return $filearray;
@ -524,13 +535,14 @@ class Documents extends DolibarrApi
* Test sample for supplier invoice: { "filename": "mynewfile.txt", "modulepart": "supplier_invoice", "ref": "FA1701-001", "subdir": "", "filecontent": "content text", "fileencoding": "", "overwriteifexists": "0" }.
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
* @param string $fileencoding File encoding (''=no encoding, 'base64'=Base 64)
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param string $filename Name of file to create ('FA1705-0123.txt')
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
* @param string $fileencoding File encoding (''=no encoding, 'base64'=Base 64)
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @param int $createdirifnotexists Create subdirectories if the doesn't exists (1 by default)
* @return string
*
* @throws RestException 400
@ -540,7 +552,7 @@ class Documents extends DolibarrApi
*
* @url POST /upload
*/
public function post($filename, $modulepart, $ref = '', $subdir = '', $filecontent = '', $fileencoding = '', $overwriteifexists = 0)
public function post($filename, $modulepart, $ref = '', $subdir = '', $filecontent = '', $fileencoding = '', $overwriteifexists = 0, $createdirifnotexists = 1)
{
global $db, $conf;
@ -567,6 +579,8 @@ class Documents extends DolibarrApi
// Define $uploadir
$object = null;
$entity = DolibarrApiAccess::$user->entity;
if (empty($entity)) $entity = 1;
if ($ref)
{
$tmpreldir = '';
@ -652,8 +666,7 @@ class Documents extends DolibarrApi
}
}
if (!($object->id > 0))
{
if (!($object->id > 0)) {
throw new RestException(404, 'The object '.$modulepart." with ref '".$ref."' was not found.");
}
@ -670,29 +683,32 @@ class Documents extends DolibarrApi
if (empty($upload_dir) || $upload_dir == '/')
{
throw new RestException(500, 'This value of modulepart does not support yet usage of ref. Check modulepart parameter or try to use subdir parameter instead of ref.');
throw new RestException(500, 'This value of modulepart ('.$modulepart.') does not support yet usage of ref. Check modulepart parameter or try to use subdir parameter instead of ref.');
}
} else {
if ($modulepart == 'invoice') $modulepart = 'facture';
if ($modulepart == 'member') $modulepart = 'adherent';
$relativefile = $subdir;
$tmp = dol_check_secure_access_document($modulepart, $relativefile, $entity, DolibarrApiAccess::$user, '', 'write');
$upload_dir = $tmp['original_file']; // No dirname here, tmp['original_file'] is already the dir because dol_check_secure_access_document was called with param original_file that is only the dir
if (empty($upload_dir) || $upload_dir == '/')
{
throw new RestException(500, 'This value of modulepart does not support yet usage of ref. Check modulepart parameter or try to use subdir parameter instead of ref.');
if (empty($upload_dir) || $upload_dir == '/') {
if (!empty($tmp['error'])) {
throw new RestException(401, 'Error returned by dol_check_secure_access_document: '.$tmp['error']);
} else {
throw new RestException(500, 'This value of modulepart ('.$modulepart.') is not allowed with this value of subdir ('.$relativefile.')');
}
}
}
// $original_file here is still value of filename without any dir.
$upload_dir = dol_sanitizePathName($upload_dir);
if (dol_mkdir($upload_dir) < 0) // needed by products
{
throw new RestException(500, 'Error while trying to create directory.');
if (!empty($createdirifnotexists)) {
if (dol_mkdir($upload_dir) < 0) { // needed by products
throw new RestException(500, 'Error while trying to create directory '.$upload_dir);
}
}
$destfile = $upload_dir.'/'.$original_file;
@ -704,8 +720,7 @@ class Documents extends DolibarrApi
throw new RestException(401, 'Directory not exists : '.dirname($destfile));
}
if (!$overwriteifexists && dol_is_file($destfile))
{
if (!$overwriteifexists && dol_is_file($destfile)) {
throw new RestException(500, "File with name '".$original_file."' already exists.");
}

View File

@ -48,8 +48,8 @@ class Login
* @param int $reset Reset token (0=get current token, 1=ask a new token and canceled old token. This means access using current existing API token of user will fails: new token will be required for new access)
* @return array Response status and user token
*
* @throws RestException 403
* @throws RestException 500
* @throws RestException 403 Access denied
* @throws RestException 500 System error
*
* @url GET /
* @url POST /
@ -109,7 +109,7 @@ class Login
}
// Generate token for user
$token = dol_hash($login.uniqid().$conf->global->MAIN_API_KEY, 1);
$token = dol_hash($login.uniqid().(empty($conf->global->MAIN_API_KEY)?'':$conf->global->MAIN_API_KEY), 1);
// We store API token into database
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
@ -132,7 +132,7 @@ class Login
'code' => 200,
'token' => $token,
'entity' => $tmpuser->entity,
'message' => 'Welcome '.$login.($reset ? ' - Token is new' : ' - This is your token (generated by a previous call). You can use it to make any REST API call, or enter it into the DOLAPIKEY field to use the Dolibarr API explorer.')
'message' => 'Welcome '.$login.($reset ? ' - Token is new' : ' - This is your token (recorded for your user). You can use it to make any REST API call, or enter it into the DOLAPIKEY field to use the Dolibarr API explorer.')
)
);
}

View File

@ -27,6 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/cstate.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';
/**
* API class for dictionaries
*
@ -74,10 +75,8 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_method as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -111,70 +110,68 @@ class Setup extends DolibarrApi
return $list;
}
/**
* Get the list of ordering origins.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Payment type is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
*
* @url GET dictionary/ordering_origins
*
* @return array [List of ordering reasons]
*
* @throws RestException 400
*/
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
/**
* Get the list of ordering origins.
*
* @param string $sortfield Sort field
* @param string $sortorder Sort order
* @param int $limit Number of items per page
* @param int $page Page number {@min 0}
* @param int $active Payment type is active or not {@min 0} {@max 1}
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
*
* @url GET dictionary/ordering_origins
*
* @return array [List of ordering reasons]
*
* @throws RestException 400
*/
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
if (!DolibarrApiAccess::$user->rights->commande->lire) {
throw new RestException(401);
}
if (!DolibarrApiAccess::$user->rights->commande->lire) {
throw new RestException(401);
}
$sql = "SELECT rowid, code, label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql = "SELECT rowid, code, label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
}
$sql .= $this->db->order($sortfield, $sortorder);
$sql .= $this->db->order($sortfield, $sortorder);
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
if ($limit) {
if ($page < 0) {
$page = 0;
}
$offset = $limit * $page;
$sql .= $this->db->plimit($limit, $offset);
}
$sql .= $this->db->plimit($limit, $offset);
}
$result = $this->db->query($sql);
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
if ($result) {
$num = $this->db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
for ($i = 0; $i < $min; $i++) {
$list[] = $this->db->fetch_object($result);
}
} else {
throw new RestException(400, $this->db->lasterror());
}
return $list;
}
return $list;
}
/**
* Get the list of payments types.
@ -205,10 +202,8 @@ class Setup extends DolibarrApi
$sql .= " WHERE t.entity IN (".getEntity('c_paiement').")";
$sql .= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -271,10 +266,8 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."c_departements as t";
$sql .= " WHERE 1 = 1";
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -373,10 +366,8 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."c_country as t";
$sql .= " WHERE 1 = 1";
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -439,7 +430,7 @@ class Setup extends DolibarrApi
/**
* Get country by Code.
*
* @param string $code Code of country
* @param string $code Code of country (2 characters)
* @param string $lang Code of the language the name of the
* country must be translated to
* @return array Array of cleaned object properties
@ -456,7 +447,7 @@ class Setup extends DolibarrApi
/**
* Get country by Iso.
*
* @param string $iso ISO of country
* @param string $iso ISO of country (3 characters)
* @param string $lang Code of the language the name of the
* country must be translated to
* @return array Array of cleaned object properties
@ -497,8 +488,8 @@ class Setup extends DolibarrApi
* Get country.
*
* @param int $id ID of country
* @param string $code Code of country
* @param string $iso ISO of country
* @param string $code Code of country (2 characters)
* @param string $iso ISO of country (3 characters)
* @param string $lang Code of the language the name of the
* country must be translated to
* @return array Array of cleaned object properties
@ -510,10 +501,11 @@ class Setup extends DolibarrApi
$country = new Ccountry($this->db);
$result = $country->fetch($id, $code, $iso);
if ($result < 0) {
throw new RestException(503, 'Error when retrieving country : '.$country->error);
} elseif ($result == 0) {
throw new RestException(404, 'country not found');
throw new RestException(404, 'Country not found');
}
$this->translateLabel($country, $lang, 'Country');
@ -549,10 +541,8 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_availability as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -657,10 +647,8 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_shipment_mode as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -718,13 +706,15 @@ class Setup extends DolibarrApi
$sql = "SELECT id, code, type, libelle as label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm as t";
$sql .= " WHERE t.active = ".$active;
if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'";
if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
if ($type) {
$sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'";
}
if ($module) {
$sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -782,12 +772,12 @@ class Setup extends DolibarrApi
$sql = "SELECT id, code, label, accountancy_code, active, module, position";
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_fees as t";
$sql .= " WHERE t.active = ".$active;
if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
if ($module) {
$sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -846,13 +836,15 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid, code, element as type, libelle as label, source, module, position";
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact as t";
$sql .= " WHERE t.active = ".$active;
if ($type) $sql .= " AND type LIKE '%".$this->db->escape($type)."%'";
if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
if ($type) {
$sql .= " AND type LIKE '%".$this->db->escape($type)."%'";
}
if ($module) {
$sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -909,12 +901,12 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid, code, label, module";
$sql .= " FROM ".MAIN_DB_PREFIX."c_civility as t";
$sql .= " WHERE t.active = ".$active;
if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
if ($module) {
$sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -968,7 +960,9 @@ class Setup extends DolibarrApi
{
$list = array();
$sql = "SELECT t.code_iso, t.label, t.unicode";
if (!empty($multicurrency)) $sql .= " , cr.date_sync, cr.rate ";
if (!empty($multicurrency)) {
$sql .= " , cr.date_sync, cr.rate ";
}
$sql .= " FROM ".MAIN_DB_PREFIX."c_currencies as t";
if (!empty($multicurrency)) {
$sql .= " JOIN ".MAIN_DB_PREFIX."multicurrency as m ON m.code=t.code_iso";
@ -983,10 +977,8 @@ class Setup extends DolibarrApi
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1041,18 +1033,22 @@ class Setup extends DolibarrApi
throw new RestException(401, 'Only an admin user can get list of extrafields');
}
if ($type == 'thirdparty') $type = 'societe';
if ($type == 'contact') $type = 'socpeople';
if ($type == 'thirdparty') {
$type = 'societe';
}
if ($type == 'contact') {
$type = 'socpeople';
}
$sql = "SELECT t.rowid, t.name, t.label, t.type, t.size, t.elementtype, t.fieldunique, t.fieldrequired, t.param, t.pos, t.alwayseditable, t.perms, t.list, t.fielddefault, t.fieldcomputed";
$sql .= " FROM ".MAIN_DB_PREFIX."extrafields as t";
$sql .= " WHERE t.entity IN (".getEntity('extrafields').")";
if (!empty($type)) $sql .= " AND t.elementtype = '".$this->db->escape($type)."'";
if (!empty($type)) {
$sql .= " AND t.elementtype = '".$this->db->escape($type)."'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1062,12 +1058,9 @@ class Setup extends DolibarrApi
$sql .= $this->db->order($sortfield, $sortorder);
$resql = $this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
{
while ($tab = $this->db->fetch_object($resql))
{
if ($resql) {
if ($this->db->num_rows($resql)) {
while ($tab = $this->db->fetch_object($resql)) {
// New usage
$list[$tab->elementtype][$tab->name]['type'] = $tab->type;
$list[$tab->elementtype][$tab->name]['label'] = $tab->label;
@ -1088,8 +1081,7 @@ class Setup extends DolibarrApi
throw new RestException(503, 'Error when retrieving list of extra fields : '.$this->db->lasterror());
}
if (!count($list))
{
if (!count($list)) {
throw new RestException(404, 'No extrafield found');
}
@ -1121,13 +1113,15 @@ class Setup extends DolibarrApi
$sql = "SELECT rowid AS id, zip, town, fk_county, fk_pays AS fk_country";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ziptown as t";
$sql .= " AND t.active = ".$active;
if ($zipcode) $sql .= " AND t.zip LIKE '%".$this->db->escape($zipcode)."%'";
if ($town) $sql .= " AND t.town LIKE '%".$this->db->escape($town)."%'";
if ($zipcode) {
$sql .= " AND t.zip LIKE '%".$this->db->escape($zipcode)."%'";
}
if ($town) {
$sql .= " AND t.town LIKE '%".$this->db->escape($town)."%'";
}
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1190,10 +1184,8 @@ class Setup extends DolibarrApi
$sql .= " WHERE t.entity IN (".getEntity('c_payment_term').")";
$sql .= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1250,10 +1242,8 @@ class Setup extends DolibarrApi
$sql .= " WHERE t.entity IN (".getEntity('c_shipment_mode').")";
$sql .= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(400, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1305,15 +1295,14 @@ class Setup extends DolibarrApi
public function getListOfMeasuringUnits($sortfield = "rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
{
$list = array();
//TODO link with multicurrency module
$sql = "SELECT t.rowid, t.code, t.label,t.short_label, t.active, t.scale, t.unit_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1377,10 +1366,8 @@ class Setup extends DolibarrApi
$sql .= " WHERE t.entity IN (".getEntity('c_socialnetworks').")";
$sql .= " AND t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1437,10 +1424,8 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1497,10 +1482,8 @@ class Setup extends DolibarrApi
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t";
$sql .= " WHERE t.active = ".$active;
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1559,10 +1542,8 @@ class Setup extends DolibarrApi
// if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'";
// if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
// Add sql filters
if ($sqlfilters)
{
if (!DolibarrApi::_checkFilters($sqlfilters))
{
if ($sqlfilters) {
if (!DolibarrApi::_checkFilters($sqlfilters)) {
throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
}
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
@ -1601,21 +1582,58 @@ class Setup extends DolibarrApi
*
* @url GET /company
*
* @return array|mixed Data without useless information
* @return array|mixed Mysoc object
*
* @throws RestException 403 Forbidden
*/
public function getCompany()
{
global $mysoc;
global $conf, $mysoc;
if (!DolibarrApiAccess::$user->admin
&& (empty($conf->global->API_LOGINS_ALLOWED_FOR_GET_COMPANY) || DolibarrApiAccess::$user->login != $conf->global->API_LOGINS_ALLOWED_FOR_GET_COMPANY)) {
throw new RestException(403, 'Error API open to admin users only or to the users with logins defined into constant API_LOGINS_ALLOWED_FOR_GET_COMPANY');
}
unset($mysoc->skype);
unset($mysoc->twitter);
unset($mysoc->facebook);
unset($mysoc->linkedin);
unset($mysoc->pays);
unset($mysoc->note);
unset($mysoc->nom);
unset($mysoc->lines);
unset($mysoc->effectif);
unset($mysoc->effectif_id);
unset($mysoc->forme_juridique_code);
unset($mysoc->forme_juridique);
unset($mysoc->mode_reglement_supplier_id);
unset($mysoc->cond_reglement_supplier_id);
unset($mysoc->transport_mode_supplier_id);
unset($mysoc->fk_prospectlevel);
unset($mysoc->total_ht);
unset($mysoc->total_tva);
unset($mysoc->total_localtax1);
unset($mysoc->total_localtax2);
unset($mysoc->total_ttc);
unset($mysoc->lastname);
unset($mysoc->firstname);
unset($mysoc->civility_id);
unset($mysoc->client);
unset($mysoc->prospect);
unset($mysoc->fournisseur);
unset($mysoc->contact_id);
unset($mysoc->fk_incoterms);
unset($mysoc->label_incoterms);
unset($mysoc->location_incoterms);
return $this->_cleanObjectDatas($mysoc);
}
@ -1660,6 +1678,7 @@ class Setup extends DolibarrApi
*
* @url GET checkintegrity
*
* @throws RestException 403 Forbidden
* @throws RestException 404 Signature file not found
* @throws RestException 500 Technical error
* @throws RestException 503 Forbidden
@ -1669,9 +1688,8 @@ class Setup extends DolibarrApi
global $langs, $conf;
if (!DolibarrApiAccess::$user->admin
&& (empty($conf->global->API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK) || DolibarrApiAccess::$user->login != $conf->global->API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK))
{
throw new RestException(503, 'Error API open to admin users only or to the users with logins defined into constant API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK');
&& (empty($conf->global->API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK) || DolibarrApiAccess::$user->login != $conf->global->API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK)) {
throw new RestException(403, 'Error API open to admin users only or to the users with logins defined into constant API_LOGIN_ALLOWED_FOR_INTEGRITY_CHECK');
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -1690,15 +1708,19 @@ class Setup extends DolibarrApi
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
// Remote file to compare to
$xmlremote = ($target == 'default' ? '' : $target);
if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) $xmlremote = $conf->global->MAIN_FILECHECK_URL;
if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) {
$xmlremote = $conf->global->MAIN_FILECHECK_URL;
}
$param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
if (empty($xmlremote) && !empty($conf->global->$param)) $xmlremote = $conf->global->$param;
if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
if (empty($xmlremote) && !empty($conf->global->$param)) {
$xmlremote = $conf->global->$param;
}
if (empty($xmlremote)) {
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
}
if ($target == 'local')
{
if (dol_is_file($xmlfile))
{
if ($target == 'local') {
if (dol_is_file($xmlfile)) {
$xml = simplexml_load_file($xmlfile);
} else {
throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
@ -1707,8 +1729,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'] != '400' && $xmlarray['http_code'] != '404')
{
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."endxmlfile";
$xml = simplexml_load_string($xmlfile);
@ -1718,17 +1739,13 @@ class Setup extends DolibarrApi
}
}
if ($xml)
{
if ($xml) {
$checksumconcat = array();
$file_list = array();
$out = '';
// Forced constants
if (is_object($xml->dolibarr_constants[0]))
{
if (is_object($xml->dolibarr_constants[0])) {
$out .= load_fiche_titre($langs->trans("ForcedConstants"));
$out .= '<div class="div-table-responsive-no-min">';
@ -1741,14 +1758,15 @@ class Setup extends DolibarrApi
$out .= '</tr>'."\n";
$i = 0;
foreach ($xml->dolibarr_constants[0]->constant as $constant) // $constant is a simpleXMLElement
{
foreach ($xml->dolibarr_constants[0]->constant as $constant) { // $constant is a simpleXMLElement
$constname = $constant['name'];
$constvalue = (string) $constant;
$constvalue = (empty($constvalue) ? '0' : $constvalue);
// Value found
$value = '';
if ($constname && $conf->global->$constname != '') $value = $conf->global->$constname;
if ($constname && $conf->global->$constname != '') {
$value = $conf->global->$constname;
}
$valueforchecksum = (empty($value) ? '0' : $value);
$checksumconcat[] = $valueforchecksum;
@ -1762,8 +1780,7 @@ class Setup extends DolibarrApi
$out .= "</tr>\n";
}
if ($i == 0)
{
if ($i == 0) {
$out .= '<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$out .= '</table>';
@ -1773,9 +1790,7 @@ class Setup extends DolibarrApi
}
// Scan htdocs
if (is_object($xml->dolibarr_htdocs_dir[0]))
{
//var_dump($xml->dolibarr_htdocs_dir[0]['includecustom']);exit;
if (is_object($xml->dolibarr_htdocs_dir[0])) {
$includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']);
// Defined qualified files (must be same than into generate_filelist_xml.php)
@ -1786,11 +1801,9 @@ class Setup extends DolibarrApi
// Fill file_list with files in signature, new files, modified files
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
// Complete with list of new files
foreach ($scanfiles as $keyfile => $valfile)
{
foreach ($scanfiles as $keyfile => $valfile) {
$tmprelativefilename = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', $valfile['fullname']);
if (!in_array($tmprelativefilename, $file_list['insignature']))
{
if (!in_array($tmprelativefilename, $file_list['insignature'])) {
$md5newfile = @md5_file($valfile['fullname']); // Can fails if we don't have permission to open/read file
$file_list['added'][] = array('filename'=>$tmprelativefilename, 'md5'=>$md5newfile);
}
@ -1807,11 +1820,9 @@ class Setup extends DolibarrApi
$out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
$out .= '</tr>'."\n";
$tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
if (is_array($tmpfilelist) && count($tmpfilelist))
{
if (is_array($tmpfilelist) && count($tmpfilelist)) {
$i = 0;
foreach ($tmpfilelist as $file)
{
foreach ($tmpfilelist as $file) {
$i++;
$out .= '<tr class="oddeven">';
$out .= '<td>'.$i.'</td>'."\n";
@ -1842,11 +1853,9 @@ class Setup extends DolibarrApi
$out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
$out .= '</tr>'."\n";
$tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
if (is_array($tmpfilelist2) && count($tmpfilelist2))
{
if (is_array($tmpfilelist2) && count($tmpfilelist2)) {
$i = 0;
foreach ($tmpfilelist2 as $file)
{
foreach ($tmpfilelist2 as $file) {
$i++;
$out .= '<tr class="oddeven">';
$out .= '<td>'.$i.'</td>'."\n";
@ -1890,11 +1899,9 @@ class Setup extends DolibarrApi
$out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
$out .= '</tr>'."\n";
$tmpfilelist3 = dol_sort_array($file_list['added'], 'filename');
if (is_array($tmpfilelist3) && count($tmpfilelist3))
{
if (is_array($tmpfilelist3) && count($tmpfilelist3)) {
$i = 0;
foreach ($tmpfilelist3 as $file)
{
foreach ($tmpfilelist3 as $file) {
$i++;
$out .= '<tr class="oddeven">';
$out .= '<td>'.$i.'</td>'."\n";
@ -1923,8 +1930,7 @@ class Setup extends DolibarrApi
// Show warning
if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3))
{
if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3)) {
//setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
} else {
//setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'warnings');
@ -1935,18 +1941,13 @@ class Setup extends DolibarrApi
// Scan scripts
asort($checksumconcat); // Sort list of checksum
//var_dump($checksumconcat);
$checksumget = md5(join(',', $checksumconcat));
$checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
$outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
if ($checksumget == $checksumtoget)
{
if (count($file_list['added']))
{
if ($checksumget == $checksumtoget) {
if (count($file_list['added'])) {
$resultcode = 'warning';
$resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
//$outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans("FileIntegrityIsOkButFilesWereAdded").'</span>';
@ -1969,4 +1970,28 @@ class Setup extends DolibarrApi
return array('resultcode'=>$resultcode, 'resultcomment'=>$resultcomment, 'expectedchecksum'=> $outexpectedchecksum, 'currentchecksum'=> $outcurrentchecksum, 'out'=>$out);
}
/**
* Get list of enabled modules
*
* @url GET /modules
*
* @return array|mixed Data without useless information
*
* @throws RestException 403 Forbidden
*/
public function getModules()
{
global $conf;
if (!DolibarrApiAccess::$user->admin
&& (empty($conf->global->API_LOGIN_ALLOWED_FOR_GET_MODULES) || DolibarrApiAccess::$user->login != $conf->global->API_LOGIN_ALLOWED_FOR_GET_MODULES)) {
throw new RestException(403, 'Error API open to admin users only or to the users with logins defined into constant API_LOGIN_ALLOWED_FOR_GET_MODULES');
}
sort($conf->modules);
return $this->_cleanObjectDatas($conf->modules);
}
}

View File

@ -84,9 +84,9 @@ class Asset extends CommonObject
'ref' => array('type'=>'varchar(10)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'showoncombobox'=>1),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1),
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'searchall'=>1),
'amount_ht' => array('type'=>'double(24,8)', 'label'=>'AmountHTShort', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'fk_asset_type' => array('type'=>'integer:AssetType:asset/class/asset_type.class.php', 'label'=>'AssetsType', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>1, 'index'=>1, 'searchall'=>1),
'amount_vat' => array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>-1, 'isameasure'=>'1', 'help'=>"Help text",),
'description' => array('type'=>'text', 'label'=>'Description', 'visible'=>-1, 'enabled'=>1, 'position'=>90, 'notnull'=>-1,),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>91, 'notnull'=>-1,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>-1,),

View File

@ -18,16 +18,6 @@
* See https://medium.com/@lhartikk/a-blockchain-in-200-lines-of-code-963cc1cc0e54
*/
/*ini_set('unserialize_callback_func', 'mycallback');
function mycallback($classname)
{
//var_dump($classname);
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
}*/
/**
* Class to manage Blocked Log
@ -182,8 +172,8 @@ class BlockedLog
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY';
if ($conf->banque->enabled) $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE';
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all POS modules
$moduleposenabled = ($conf->cashdesk->enabled || $conf->takepos->enabled || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
// $conf->global->BANK_ENABLE_POS_CASHCONTROL must be set to 1 by all external POS modules
$moduleposenabled = (!empty($conf->cashdesk->enabled) || !empty($conf->takepos->enabled) || !empty($conf->global->BANK_ENABLE_POS_CASHCONTROL));
if ($moduleposenabled) $this->trackedevents['CASHCONTROL_VALIDATE'] = 'logCASHCONTROL_VALIDATE';
if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
@ -454,7 +444,9 @@ class BlockedLog
'ref', 'multicurrency_code', 'multicurrency_total_ht', 'multicurrency_total_tva', 'multicurrency_total_ttc', 'qty', 'product_type', 'vat_src_code', 'tva_tx', 'info_bits', 'localtax1_tx', 'localtax2_tx', 'total_ht', 'total_tva', 'total_ttc', 'total_localtax1', 'total_localtax2'
))) continue; // Discard if not into a dedicated list
if (!is_object($this->object_data->invoiceline[$lineid])) $this->object_data->invoiceline[$lineid] = new stdClass();
if (empty($this->object_data->invoiceline[$lineid]) || !is_object($this->object_data->invoiceline[$lineid])) { // To avoid warning
$this->object_data->invoiceline[$lineid] = new stdClass();
}
$this->object_data->invoiceline[$lineid]->{$keyline} = $valueline;
}
@ -465,7 +457,7 @@ class BlockedLog
if (!empty($object->newref)) $this->object_data->ref = $object->newref;
} elseif ($this->element == 'invoice_supplier')
{
foreach ($object as $key=>$value)
foreach ($object as $key => $value)
{
if (in_array($key, $arrayoffieldstoexclude)) continue; // Discard some properties
if (!in_array($key, array(

View File

@ -28,20 +28,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
// Load translation files required by the page
$langs->load("admin");
if (!$user->admin)
accessforbidden();
if (!$user->admin) {
accessforbidden();
}
$action = GETPOST('action', 'aZ09');
if ($action == 'setvalue')
{
if ($action == 'setvalue') {
$showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha');
$res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity);
if (!$res > 0) $error++;
if (!$res > 0) {
$error++;
}
if (!$error)
{
if (!$error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {

View File

@ -38,20 +38,23 @@ function printDropdownBookmarksList()
$url = $_SERVER["PHP_SELF"];
if (!empty($_SERVER["QUERY_STRING"]))
{
if (!empty($_SERVER["QUERY_STRING"])) {
$url .= (dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '');
} else {
global $sortfield, $sortorder;
$tmpurl = '';
// No urlencode, all param $url will be urlencoded later
if ($sortfield) $tmpurl .= ($tmpurl ? '&' : '').'sortfield='.$sortfield;
if ($sortorder) $tmpurl .= ($tmpurl ? '&' : '').'sortorder='.$sortorder;
if (is_array($_POST))
{
foreach ($_POST as $key => $val)
{
if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val;
if ($sortfield) {
$tmpurl .= ($tmpurl ? '&' : '').'sortfield='.$sortfield;
}
if ($sortorder) {
$tmpurl .= ($tmpurl ? '&' : '').'sortorder='.$sortorder;
}
if (is_array($_POST)) {
foreach ($_POST as $key => $val) {
if (preg_match('/^search_/', $key) && $val != '') {
$tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val;
}
}
}
$url .= ($tmpurl ? '?'.$tmpurl : '');
@ -68,8 +71,7 @@ function printDropdownBookmarksList()
// Url to go on create new bookmark page
$newbtn = '';
if (!empty($user->rights->bookmark->creer))
{
if (!empty($user->rights->bookmark->creer)) {
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;urlsource='.urlencode($url).'&amp;url='.urlencode($url);
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$newbtn .= '<a class="top-menu-dropdown-link" title="'.$langs->trans('AddThisPageToBookmarks').'" href="'.dol_escape_htmltag($urltoadd).'" >';
@ -81,13 +83,11 @@ function printDropdownBookmarksList()
$sql .= " WHERE (fk_user = ".$user->id." OR fk_user is NULL OR fk_user = 0)";
$sql .= " AND entity IN (".getEntity('bookmarks').")";
$sql .= " ORDER BY position";
if ($resql = $db->query($sql))
{
if ($resql = $db->query($sql)) {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
{
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
@ -104,15 +104,13 @@ function printDropdownBookmarksList()
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
$searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
// Url to go on create new bookmark page
if (!empty($user->rights->bookmark->creer))
{
if (!empty($user->rights->bookmark->creer)) {
$urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&amp;url='.urlencode($url);
$searchForm .= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
$searchForm .= ' data-html="'.dol_escape_htmltag(img_picto('', 'bookmark').' '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
}
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql))
{
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
$searchForm .= dol_escape_htmltag($obj->title);
$searchForm .= '</option>';
@ -132,74 +130,74 @@ function printDropdownBookmarksList()
$html .= '<!-- script to open selected choice -->
<script>
$(document).ready(function () {
jQuery("#boxbookmark").change(function() {
var urlselected = jQuery("#boxbookmark option:selected").attr("rel");
$(document).ready(function () {
jQuery("#boxbookmark").change(function() {
var urlselected = jQuery("#boxbookmark option:selected").attr("rel");
if (! urlselected) console.log("Error, failed to get the URL to jump to from the rel attribute");
var urltarget = jQuery("#boxbookmark option:selected").attr("target");
if (! urltarget) { urltarget=""; }
jQuery("form#top-menu-action-bookmark").attr("target",urltarget);
jQuery("form#top-menu-action-bookmark").attr("action",urlselected);
var urltarget = jQuery("#boxbookmark option:selected").attr("target");
if (! urltarget) { urltarget=""; }
jQuery("form#top-menu-action-bookmark").attr("target",urltarget);
jQuery("form#top-menu-action-bookmark").attr("action",urlselected);
console.log("We change select bookmark. We choose urlselected="+urlselected+" with target="+urltarget);
console.log("We change select bookmark. We choose urlselected="+urlselected+" with target="+urltarget);
// Method is POST for internal link, GET for external
if (urlselected.startsWith(\'http\'))
{
var newmethod=\'GET\';
jQuery("form#top-menu-action-bookmark").attr("method", newmethod);
console.log("We change method to newmethod="+newmethod);
jQuery("form#top-menu-action-bookmark").submit();
console.log("We restore method to POST");
// Method is POST for internal link, GET for external
if (urlselected.startsWith(\'http\'))
{
var newmethod=\'GET\';
jQuery("form#top-menu-action-bookmark").attr("method", newmethod);
console.log("We change method to newmethod="+newmethod);
jQuery("form#top-menu-action-bookmark").submit();
console.log("We restore method to POST");
jQuery("form#top-menu-action-bookmark").attr("method", \'POST\');
}
else
{
jQuery("form#top-menu-action-bookmark").submit();
jQuery("form#top-menu-action-bookmark").submit();
}
});
})
});
})
</script>';
} else {
$html = '
<!-- search input -->
<div class="dropdown-header bookmark-header">
' . $searchForm.'
</div>
';
<!-- search input -->
<div class="dropdown-header bookmark-header">
' . $searchForm.'
</div>
';
$html .= '
<!-- Menu Body -->
<div class="bookmark-body dropdown-body">
'.$bookmarkList.'
</div>
';
<!-- Menu Body -->
<div class="bookmark-body dropdown-body">
'.$bookmarkList.'
</div>
';
$html .= '
<!-- Menu Footer-->
<div class="bookmark-footer">
'.$newbtn.$listbtn.'
<div style="clear:both;"></div>
</div>
';
<!-- Menu Footer-->
<div class="bookmark-footer">
'.$newbtn.$listbtn.'
<div style="clear:both;"></div>
</div>
';
$html .= '<!-- script to open/close the popup -->
<script>
$( document ).on("keyup", "#top-bookmark-search-input", function () {
$( document ).on("keyup", "#top-bookmark-search-input", function () {
var filter = $(this).val(), count = 0;
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
var filter = $(this).val(), count = 0;
$("#dropdown-bookmarks-list .bookmark-item").each(function () {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).addClass("hidden-search-result");
} else {
$(this).removeClass("hidden-search-result");
count++;
}
});
$("#top-bookmark-search-filter-count").text(count);
});
</script>';
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).addClass("hidden-search-result");
} else {
$(this).removeClass("hidden-search-result");
count++;
}
});
$("#top-bookmark-search-filter-count").text(count);
});
</script>';
}
return $html;

View File

@ -83,8 +83,14 @@ class Bookmark extends CommonObject
*/
public $title;
/**
* @var int position of bookmark
*/
public $position;
/**
* @var string favicon
*/
public $favicon;
@ -116,8 +122,7 @@ class Bookmark extends CommonObject
dol_syslog("Bookmark::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid;
@ -151,7 +156,9 @@ class Bookmark extends CommonObject
// Clean parameters
$this->url = trim($this->url);
$this->title = trim($this->title);
if (empty($this->position)) $this->position = 0;
if (empty($this->position)) {
$this->position = 0;
}
$now = dol_now();
@ -164,17 +171,15 @@ class Bookmark extends CommonObject
$sql .= ($this->fk_user > 0 ? $this->fk_user : "0").",";
$sql .= " '".$this->db->idate($now)."',";
$sql .= " '".$this->db->escape($this->url)."', '".$this->db->escape($this->target)."',";
$sql .= " '".$this->db->escape($this->title)."', '".$this->db->escape($this->favicon)."', '".$this->db->escape($this->position)."'";
$sql .= ", ".$this->db->escape($conf->entity);
$sql .= " '".$this->db->escape($this->title)."', '".$this->db->escape($this->favicon)."', ".(int) $this->position;
$sql .= ", ".(int) $conf->entity;
$sql .= ")";
dol_syslog("Bookmark::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."bookmark");
if ($id > 0)
{
if ($id > 0) {
$this->id = $id;
$this->db->commit();
return $id;
@ -202,7 +207,9 @@ class Bookmark extends CommonObject
// Clean parameters
$this->url = trim($this->url);
$this->title = trim($this->title);
if (empty($this->position)) $this->position = 0;
if (empty($this->position)) {
$this->position = 0;
}
$sql = "UPDATE ".MAIN_DB_PREFIX."bookmark";
$sql .= " SET fk_user = ".($this->fk_user > 0 ? $this->fk_user : "0");
@ -211,12 +218,11 @@ class Bookmark extends CommonObject
$sql .= " ,target = '".$this->db->escape($this->target)."'";
$sql .= " ,title = '".$this->db->escape($this->title)."'";
$sql .= " ,favicon = '".$this->db->escape($this->favicon)."'";
$sql .= " ,position = '".$this->db->escape($this->position)."'";
$sql .= " ,position = ".(int) $this->position;
$sql .= " WHERE rowid = ".$this->id;
dol_syslog("Bookmark::update", LOG_DEBUG);
if ($this->db->query($sql))
{
if ($this->db->query($sql)) {
return 1;
} else {
$this->error = $this->db->lasterror();
@ -237,8 +243,7 @@ class Bookmark extends CommonObject
dol_syslog("Bookmark::remove", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
return 1;
} else {
$this->error = $this->db->lasterror();
@ -288,7 +293,9 @@ class Bookmark extends CommonObject
{
global $conf, $langs, $hookmanager;
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 = '';
@ -298,33 +305,40 @@ class Bookmark extends CommonObject
$url = DOL_URL_ROOT.'/bookmarks/card.php?id='.$this->id;
if ($option != 'nolink')
{
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 ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
$add_save_lastsearch_values = 1;
}
if ($add_save_lastsearch_values) {
$url .= '&save_lastsearch_values=1';
}
}
$linkclose = '';
if (empty($notooltip))
{
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("ShowBookmark");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
} else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
}
$linkstart = '<a href="'.$url.'"';
$linkstart .= $linkclose.'>';
$linkend = '</a>';
$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 .= $this->ref;
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 .= $this->ref;
}
$result .= $linkend;
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
@ -332,8 +346,11 @@ class Bookmark extends CommonObject
$hookmanager->initHooks(array('mybookmarkdao'));
$parameters = array('id'=>$this->id, 'getnomurl'=>$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $result = $hookmanager->resPrint;
else $result .= $hookmanager->resPrint;
if ($reshook > 0) {
$result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}
return $result;
}

View File

@ -98,6 +98,7 @@ class Categorie extends CommonObject
8 => 'bank_line',
9 => 'warehouse',
10 => 'actioncomm',
11 => 'website_page'
);
/**
@ -221,7 +222,6 @@ class Categorie extends CommonObject
/**
* @var string Category type
*
* @see Categorie::TYPE_ACCOUNT
* @see Categorie::TYPE_PRODUCT
* @see Categorie::TYPE_SUPPLIER
* @see Categorie::TYPE_CUSTOMER
@ -229,9 +229,11 @@ class Categorie extends CommonObject
* @see Categorie::TYPE_CONTACT
* @see Categorie::TYPE_USER
* @see Categorie::TYPE_PROJECT
* @see Categorie::TYPE_ACCOUNT
* @see Categorie::TYPE_BANK_LINE
* @see Categorie::TYPE_WAREHOUSE
* @see Categorie::TYPE_ACTIONCOMM
* @see Categorie::TYPE_WAREHOUSE
* @see Categorie::TYPE_ACTIONCOMM
* @see Categorie::TYPE_WEBSITE_PAGE
*/
public $type;
@ -312,7 +314,7 @@ class Categorie extends CommonObject
// Check parameters
if (empty($id) && empty($label) && empty($ref_ext)) return -1;
if (!is_numeric($type)) $type = $this->MAP_ID[$type];
if (!is_null($type) && !is_numeric($type)) $type = $this->MAP_ID[$type];
$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";
@ -1058,7 +1060,7 @@ class Categorie extends CommonObject
$current_lang = $langs->getDefaultLang();
// Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
$sql = "SELECT DISTINCT c.rowid, c.label, c.ref_ext, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
if (!empty($conf->global->MAIN_MULTILANGS)) $sql .= ", t.label as label_trans, t.description as description_trans";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (!empty($conf->global->MAIN_MULTILANGS)) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$this->db->escape($current_lang)."'";

View File

@ -35,7 +35,7 @@ $langs->load("categories");
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alphanohtml');
$type = (int) GETPOST('type', 'int');
$type = GETPOST('type', 'aZ09'); // Can be int or string
$action = (GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'edit');
$confirm = GETPOST('confirm');
$cancel = GETPOST('cancel', 'alpha');

View File

@ -172,7 +172,7 @@ foreach ($fulltree as $key => $val)
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #bbb"';
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
$data[] = array(
'rowid'=>$val['rowid'],

View File

@ -1246,17 +1246,18 @@ if ($action == 'create')
//Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
print '<input class="width50" type="number" name="offsetvalue" value="'.(GETPOSTISSET('offsetvalue') ? GETPOST('offsetvalue', 'int') : '15').'"> '.$form->selectTypeDuration('offsetunit', 'i');
print '<input class="width50" type="number" name="offsetvalue" value="'.(GETPOSTISSET('offsetvalue') ? GETPOST('offsetvalue', 'int') : '15').'"> ';
print $form->selectTypeDuration('offsetunit', 'i', array('y', 'm'));
print '</td></tr>';
//Reminder Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
print $form->selectarray('selectremindertype', $TRemindTypes);
print $form->selectarray('selectremindertype', $TRemindTypes, '', 0, 0, 0, '', 0, 0, 0, '', 'mimnwidth200', 1);
print '</td></tr>';
//Mail Model
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
print '</td></tr>';
@ -1719,21 +1720,23 @@ if ($id > 0)
$actionCommReminder->typeremind = 'email';
}
print '<tr><td>'.$langs->trans("AddReminder").'</td><td colspan="3"><input type="checkbox" id="addreminder" name="addreminder" '.$checked.'></td></tr>';
print '<label for="addreminder">'.$langs->trans("AddReminder").'</label> <input type="checkbox" id="addreminder" name="addreminder" '.$checked.'><br>';
print '<div class="reminderparameters" '.(empty($checked) ? 'style="display: none;"' : '').'>';
print '<br>';
print '<table class="border centpercent">';
// Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderTime").'</td><td colspan="3">';
print '<input type="number" name="offsetvalue" class="width50" value="'.$actionCommReminder->offsetvalue.'"> '.$form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit);
print '<input type="number" name="offsetvalue" class="width50" value="'.$actionCommReminder->offsetvalue.'"> ';
print $form->selectTypeDuration('offsetunit', $actionCommReminder->offsetunit, array('y', 'm'));
print '</td></tr>';
// Reminder Type
$TRemindTypes = array();
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind);
print $form->selectarray('selectremindertype', $TRemindTypes, $actionCommReminder->typeremind, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
print '</td></tr>';
$hide = '';
@ -1741,7 +1744,7 @@ if ($id > 0)
// Mail Model
print '<tr '.$hide.'><td class="titlefieldcreate nowrap">'.$langs->trans("EMailTemplates").'</td><td colspan="3">';
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1);
print $form->selectModelMail('actioncommsend', 'actioncomm_send', 1, 1);
print '</td></tr>';
print '</table>';
@ -1767,6 +1770,8 @@ if ($id > 0)
})';
print '</script>'."\n";
print '</div>'; // End of div for reminderparameters
}
print dol_get_fiche_end();

View File

@ -518,7 +518,7 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
}
// Birthdays
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday" class="check_birthday"> <span class="check_birthday_text">'.$langs->trans("AgendaShowBirthdayEvents").'</span> &nbsp; </div>';
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday" class="check_birthday"><label for="check_birthday"> <span class="check_birthday_text">'.$langs->trans("AgendaShowBirthdayEvents").'</span></label> &nbsp; </div>';
// Calendars from hooks
$parameters = array(); $object = null;

View File

@ -38,7 +38,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other"));
$langs->loadLangs(array("users", "companies", "agenda", "commercial", "other", "orders", "bills"));
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
@ -141,14 +141,8 @@ $arrayfields = array(
'a.tms'=>array('label'=>'DateModification', 'checked'=>0)
);
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
}
}
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');

View File

@ -673,7 +673,7 @@ while ($currentdaytoshow < $lastdaytoshow) {
echo '<table width="100%" class="noborder nocellnopadd cal_month">';
echo '<tr class="liste_titre">';
echo '<td class="nopaddingtopimp nopaddingbottomimp">';
echo '<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">';
if ($canedit && $action == 'show_peruser')
{

View File

@ -286,7 +286,10 @@ if ($object->id > 0)
print '<tr><td>';
print $langs->trans('CustomerCode').'</td><td>';
print $object->code_client;
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
$tmpcheck = $object->check_codeclient();
if ($tmpcheck != 0 && $tmpcheck != -5) {
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
}
print '</td></tr>';
print '<tr>';

View File

@ -137,8 +137,12 @@ if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) {
* Draft customer proposals
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,";
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -171,13 +175,17 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->entity = $obj->entity;
$companystatic->email = $obj->email;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
@ -204,8 +212,12 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
* Draft supplier proposals
*/
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) {
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status,";
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email";
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -237,12 +249,17 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->entity = $obj->entity;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
@ -269,8 +286,12 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
* Draft customer orders
*/
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status,";
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta";
$sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, c.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -303,12 +324,17 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
@ -335,8 +361,12 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
* Draft purchase orders
*/
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) {
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status,";
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.entity, s.email";
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, cf.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -369,12 +399,17 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->entity = $obj->entity;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
@ -403,7 +438,12 @@ print '<div class="ficheaddleft">';
* Last modified customers or prospects
*/
if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas, s.code_client, s.code_compta, s.entity, s.email";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= ", s.datec, s.tms";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
@ -434,15 +474,19 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
while ($i < $num && $i < $max) {
$objp = $db->fetch_object($resql);
$companystatic->id = $objp->rowid;
$companystatic->id = $objp->socid;
$companystatic->name = $objp->name;
$companystatic->client = $objp->client;
$companystatic->name_alias = $objp->name_alias;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
$companystatic->code_compta = $objp->code_compta;
$companystatic->entity = $objp->entity;
$companystatic->client = $objp->client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
$companystatic->fournisseur = $objp->fournisseur;
$companystatic->logo = $objp->logo;
$companystatic->email = $objp->email;
$companystatic->entity = $objp->entity;
$companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
@ -488,7 +532,12 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
* Last suppliers
*/
if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) && $user->rights->societe->lire) {
$sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm, s.code_fournisseur, s.entity, s.email, s.fournisseur";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= ", s.datec as dc, s.tms as dm";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
@ -508,14 +557,19 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
while ($i < $num && $i < $max) {
$objp = $db->fetch_object($resql);
$companystatic->id = $objp->rowid;
$companystatic->id = $objp->socid;
$companystatic->name = $objp->name;
$companystatic->name_alias = $objp->name_alias;
$companystatic->code_client = $objp->code_client;
$companystatic->code_compta = $objp->code_compta;
$companystatic->client = $objp->client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
$companystatic->entity = $objp->entity;
$companystatic->email = $objp->email;
$companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur;
$companystatic->fournisseur = $objp->fournisseur;
$companystatic->logo = $objp->logo;
$companystatic->email = $objp->email;
$companystatic->entity = $objp->entity;
$companystatic->canvas = $objp->canvas;
print '<tr class="oddeven">';
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
@ -577,7 +631,11 @@ if ($user->rights->agenda->myactions->read) {
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
$staticcontrat = new Contrat($db);
$sql = "SELECT s.nom as name, s.rowid, s.canvas, s.code_client, s.entity, s.email";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= ", c.statut, c.rowid as contratid, p.ref, c.fin_validite as datefin, c.date_cloture as dateclo";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
@ -602,13 +660,19 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
while ($i < $num) {
$obj = $db->fetch_object($resql);
$companystatic->id = $objp->rowid;
$companystatic->name = $objp->name;
$companystatic->code_client = $objp->code_client;
$companystatic->code_fournisseur = $objp->code_fournisseur;
$companystatic->canvas = $objp->canvas;
$companystatic->entity = $objp->entity;
$companystatic->email = $objp->email;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
$staticcontrat->id = $obj->contratid;
$staticcontrat->ref = $obj->ref;
@ -638,7 +702,11 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
*/
if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql = "SELECT p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.nom as name, s.rowid, s.code_client, s.entity, s.email";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -678,14 +746,19 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$propalstatic->total_tva = $obj->total_tva;
$propalstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->rowid;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->entity = $obj->entity;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
@ -739,7 +812,11 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
*/
if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
$sql .= ", s.nom as name, s.rowid, s.code_client, s.entity, s.email";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
$sql .= ", s.logo, s.email, s.entity";
$sql .= ", s.canvas";
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -779,14 +856,19 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$orderstatic->total_tva = $obj->total_tva;
$orderstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->rowid;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->name;
$companystatic->client = $obj->client;
$companystatic->name_alias = $obj->name_alias;
$companystatic->code_client = $obj->code_client;
$companystatic->code_compta = $obj->code_compta;
$companystatic->client = $obj->client;
$companystatic->code_fournisseur = $obj->code_fournisseur;
$companystatic->canvas = $obj->canvas;
$companystatic->entity = $obj->entity;
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
$companystatic->fournisseur = $obj->fournisseur;
$companystatic->logo = $obj->logo;
$companystatic->email = $obj->email;
$companystatic->entity = $obj->entity;
$companystatic->canvas = $obj->canvas;
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);

View File

@ -335,7 +335,7 @@ if (empty($reshook)) {
if (!empty($conf->global->MAILING_DELAY)) {
dol_syslog("Wait a delay of MAILING_DELAY=".$conf->global->MAILING_DELAY);
sleep($conf->global->MAILING_DELAY);
usleep((float) $conf->global->MAILING_DELAY * 1000000);
}
//test if CHECK READ change statut prospect contact

View File

@ -463,24 +463,51 @@ if ($object->fetch($id) >= 0)
$sql .= " mc.source_url, mc.source_id, mc.source_type, mc.error_text";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.fk_mailing=".$object->id;
if ($search_lastname) $sql .= natural_search("mc.lastname", $search_lastname);
if ($search_firstname) $sql .= natural_search("mc.firstname", $search_firstname);
if ($search_email) $sql .= natural_search("mc.email", $search_email);
if ($search_other) $sql .= natural_search("mc.other", $search_other);
if ($search_dest_status != '' && $search_dest_status >= -1) $sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
$asearchcriteriahasbeenset = 0;
if ($search_lastname) {
$sql .= natural_search("mc.lastname", $search_lastname);
$asearchcriteriahasbeenset++;
}
if ($search_firstname) {
$sql .= natural_search("mc.firstname", $search_firstname);
$asearchcriteriahasbeenset++;
}
if ($search_email) {
$sql .= natural_search("mc.email", $search_email);
$asearchcriteriahasbeenset++;
}
if ($search_other) {
$sql .= natural_search("mc.other", $search_other);
$asearchcriteriahasbeenset++;
}
if ($search_dest_status != '' && $search_dest_status >= -1) {
$sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
$asearchcriteriahasbeenset++;
}
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
$offset = 0;
}
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0;
$offset = 0;
}
// Fix/update nbemail on emailing record if it differs (may happen if user edit lines from database directly)
if (empty($asearchcriteriahasbeenset)) {
if ($nbtotalofrecords != $object->email) {
dol_syslog("We found a difference in nb of record in target table and the property ->nbemail, we fix ->nbemail");
//print "nbemail=".$object->nbemail." nbtotalofrecords=".$nbtotalofrecords;
$resultrefresh = $object->refreshNbOfTargets();
if ($resultrefresh < 0) {
dol_print_error($db, $object->error, $object->errors);
}
}
}
}
//$nbtotalofrecords=$object->nbemail; // nbemail is a denormalized field storing nb of targets

View File

@ -526,6 +526,8 @@ class Mailing extends CommonObject
dol_syslog("Mailing::delete_targets", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->refreshNbOfTargets();
return 1;
} else {
$this->error = $this->db->lasterror();
@ -593,6 +595,38 @@ class Mailing extends CommonObject
return 0;
}
/**
* Refresh denormalized value ->nbemail into emailing record
* Note: There is also the method update_nb into modules_mailings that is used for this.
*
* @return int <0 if KO, >0 if OK
*/
public function refreshNbOfTargets()
{
$sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " WHERE fk_mailing = ".$this->id;
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
$nbforupdate = $obj->nb;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'mailing SET nbemail = '.((int) $nbforupdate);
$sql .= ' WHERE rowid = '.$this->id;
$resqlupdate = $this->db->query($sql);
if (! $resqlupdate) {
$this->error = $this->db->lasterror();
return -1;
}
}
} else {
$this->error = $this->db->lasterror();
return -1;
}
return 1;
}
/**
* Return a link to the object card (with optionally the picto)

View File

@ -911,6 +911,7 @@ if (empty($reshook))
if (count($prodcustprice->lines) > 0) {
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_min = price($prodcustprice->lines[0]->price_min);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';

View File

@ -598,6 +598,7 @@ class Propal extends CommonObject
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code
$reg = array();
$vat_src_code = '';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
@ -654,8 +655,8 @@ class Propal extends CommonObject
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->fk_product = $fk_product;
$this->line->product_type = $type;
$this->line->fk_remise_except = $fk_remise_except;

View File

@ -644,8 +644,8 @@ if (empty($reshook))
$tva_tx = '';
}
$qty = GETPOST('qty'.$predef);
$remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0);
$qty = price2num(GETPOST('qty'.$predef, 'alpha'));
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@ -749,6 +749,7 @@ if (empty($reshook))
{
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_min = price($prodcustprice->lines[0]->price_min);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) $tva_tx .= ' ('.$prodcustprice->lines[0]->default_vat_code.')';

View File

@ -492,26 +492,21 @@ class Commande extends CommonOrder
$error++;
}
if (!$error)
{
if (!$error) {
// If stock is incremented on validate order, we must increment it
if ($result >= 0 && !empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
if ($result >= 0 && !empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
// Loop on each line
$cpt = count($this->lines);
for ($i = 0; $i < $cpt; $i++)
{
if ($this->lines[$i]->fk_product > 0)
{
for ($i = 0; $i < $cpt; $i++) {
if ($this->lines[$i]->fk_product > 0) {
$mouvP = new MouvementStock($this->db);
$mouvP->origin = &$this;
// We decrement stock of product (and sub-products)
$result = $mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderValidatedInDolibarr", $num));
if ($result < 0)
{
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
}
@ -521,16 +516,14 @@ class Commande extends CommonOrder
}
}
if (!$error && !$notrigger)
{
if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('ORDER_VALIDATE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
{
if (!$error) {
$this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
@ -631,7 +624,7 @@ class Commande extends CommonOrder
}
// If stock is decremented on validate order, we must reincrement it
if (!empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
$result = 0;
@ -817,7 +810,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
if (!empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@ -962,8 +955,8 @@ class Commande extends CommonOrder
$sql .= ", ".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null");
$sql .= ", ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : "null");
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : 'NULL');
$sql .= ", ".($this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".($this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
$sql .= ", ".(!empty($this->shipping_method_id) && $this->shipping_method_id > 0 ? $this->shipping_method_id : 'NULL');
$sql .= ", ".(!empty($this->warehouse_id) && $this->warehouse_id > 0 ? $this->warehouse_id : 'NULL');
$sql .= ", ".($this->remise_absolue > 0 ? $this->db->escape($this->remise_absolue) : 'NULL');
$sql .= ", ".($this->remise_percent > 0 ? $this->db->escape($this->remise_percent) : 0);
$sql .= ", ".(int) $this->fk_incoterms;
@ -1081,7 +1074,7 @@ class Commande extends CommonOrder
}
// Add object linked
if (!$error && $this->id && is_array($this->linked_objects) && !empty($this->linked_objects))
if (!$error && $this->id && !empty($this->linked_objects) && is_array($this->linked_objects))
{
foreach ($this->linked_objects as $origin => $tmp_origin_id)
{
@ -1605,8 +1598,8 @@ class Commande extends CommonOrder
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->fk_product = $fk_product;
$this->line->product_type = $product_type;
$this->line->fk_remise_except = $fk_remise_except;
@ -3166,8 +3159,8 @@ class Commande extends CommonOrder
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = $txlocaltax1;
$this->line->localtax2_tx = $txlocaltax2;
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = $subprice;
$this->line->info_bits = $info_bits;
@ -3924,7 +3917,9 @@ class Commande extends CommonOrder
if (!dol_strlen($modele)) {
$modele = 'einstein';
if (!empty($this->modelpdf)) {
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
} elseif (!empty($this->modelpdf)) { // dperecated
$modele = $this->modelpdf;
} elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) {
$modele = $conf->global->COMMANDE_ADDON_PDF;

View File

@ -675,7 +675,7 @@ if ($resql)
if (!empty($arrayfields['s.nom']['checked']))
{
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '<input class="flat maxwidth100" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
print '</td>';
}
// Town

View File

@ -529,7 +529,7 @@ print '<span class="opacitymedium">'.$langs->trans("ExportAccountingSourceDocHel
print '<br>';
print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0);
print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n</a>";
print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n";
// Export is for current company only
if (!empty($conf->multicompany->enabled) && is_object($mc))
@ -560,7 +560,7 @@ $listofchoices = array(
);
foreach ($listofchoices as $choice => $val) {
$checked = (((!GETPOSTISSET('search') && $action != 'searchfiles') || GETPOST($choice)) ? ' checked="checked"' : '');
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" name="'.$choice.'" value="1"'.$checked.'> '.$langs->trans($val['label']).'</div>';
print '<div class="paddingleft inline-block marginrightonly"><input type="checkbox" id="'.$choice.'" name="'.$choice.'" value="1"'.$checked.'> <label for="'.$choice.'">'.$langs->trans($val['label']).'</label></div>';
}
print '<input class="button" type="submit" name="search" value="'.$langs->trans("Search").'">';

View File

@ -155,14 +155,8 @@ $arrayfields = array(
'b.conciliated'=>array('label'=>$langs->trans("Conciliated"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile' ? 1 : 0), 'position'=>1020),
);
// Extra fields
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
if (!empty($extrafields->attributes[$object->table_element]['list'][$key]))
$arrayfields["ef.".$key] = array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
}
}
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
@ -496,7 +490,7 @@ if (dol_strlen($search_dv_end) > 0) $sql .= " AND b.datev <= '".$db->idate($sear
if ($search_ref) $sql .= natural_search("b.rowid", $search_ref, 1);
if ($search_req_nb) $sql .= natural_search("b.num_chq", $search_req_nb);
if ($search_num_releve) $sql .= natural_search("b.num_releve", $search_num_releve);
if ($search_conciliated != '' && $search_conciliated != '-1') $sql .= " AND b.rappro = ".$search_conciliated;
if ($search_conciliated != '' && $search_conciliated != '-1') $sql .= " AND b.rappro = ".urlencode($search_conciliated);
if ($search_thirdparty) $sql .= natural_search("s.nom", $search_thirdparty);
if ($search_description)
{
@ -861,6 +855,10 @@ if ($resql)
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
// When action is 'reconcile', we force to have the column num_releve always enabled (otherwise we can't make reconciliation).
if ($action == 'reconcile') {
$arrayfields['b.num_releve']['checked'] = 1;
}
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
@ -993,9 +991,8 @@ if ($resql)
while ($i < min($num, $limit))
{
$objp = $db->fetch_object($resql);
// If we are in a situation where we need/can show balance, we calculate the start of balance
if (!$balancecalculated && (!empty($arrayfields['balancebefore']['checked']) || !empty($arrayfields['balance']['checked'])) && $mode_balance_ok)
if (!$balancecalculated && (!empty($arrayfields['balancebefore']['checked']) || !empty($arrayfields['balance']['checked'])) && ($mode_balance_ok || $search_conciliated === '0'))
{
if (!$search_account)
{
@ -1016,11 +1013,9 @@ if ($resql)
$sqlforbalance .= " AND (b.datev < '".$db->idate($db->jdate($objp->dv))."' OR (b.datev = '".$db->idate($db->jdate($objp->dv))."' AND (b.dateo < '".$db->idate($db->jdate($objp->do))."' OR (b.dateo = '".$db->idate($db->jdate($objp->do))."' AND b.rowid < ".$objp->rowid."))))";
$resqlforbalance = $db->query($sqlforbalance);
//print $sqlforbalance;
if ($resqlforbalance)
{
if ($resqlforbalance) {
$objforbalance = $db->fetch_object($resqlforbalance);
if ($objforbalance)
{
if ($objforbalance) {
// If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc')
{
@ -1081,24 +1076,30 @@ if ($resql)
if (!empty($arrayfields['balancebefore']['checked']))
{
print '<td class="right">';
print price(price2num($balance, 'MT'), 1, $langs);
if ($search_conciliated !== '0') {
print price(price2num($balance, 'MT'), 1, $langs);
}
print '</td>';
}
if (!empty($arrayfields['balance']['checked']))
{
print '<td class="right">';
print price(price2num($balance, 'MT'), 1, $langs);
if ($search_conciliated !== '0') {
print price(price2num($balance, 'MT'), 1, $langs);
}
print '</td>';
}
if (!empty($arrayfields['b.num_releve']['checked']))
{
print '<td class="center">';
print '<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans("SelectAll")).'" />';
print ' <script type="text/javascript">
$("input#selectAll").change(function() {
$("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
});
</script>';
print '</td>';
}
print '<td class="center">';
print '<input type="checkbox" id="selectAll" title="'.dol_escape_htmltag($langs->trans("SelectAll")).'" />';
print ' <script type="text/javascript">
$("input#selectAll").change(function() {
$("input[type=checkbox][name^=rowid]").prop("checked", $(this).is(":checked"));
});
</script>';
print '</td>';
print '<td colspan="'.($tmpnbfieldafterbalance + 2).'">';
print '&nbsp;';
print '</td>';

View File

@ -1741,13 +1741,6 @@ class AccountLine extends CommonObject
public $amount;
/**
* @var string bank transaction lines label
*/
public $label;
public $note;
/**
* @var int ID
*/
@ -1763,11 +1756,6 @@ class AccountLine extends CommonObject
*/
public $fk_type;
public $rappro; // Is it conciliated
public $num_releve; // If conciliated, what is bank statement
public $num_chq; // Num of cheque
public $bank_chq; // Bank of cheque
/**
* @var int ID of cheque receipt
*/
@ -1778,16 +1766,40 @@ class AccountLine extends CommonObject
*/
public $fk_account;
/**
* @var string Ref of bank account
*/
public $bank_account_ref;
/**
* @var string Label of bank account
*/
public $bank_account_label;
/**
* @var string Bank account numero
*/
public $numero_compte;
/**
* @var string Name of check issuer
*/
public $emetteur;
public $rappro; // Is it conciliated
public $num_releve; // If conciliated, what is bank statement
public $num_chq; // Num of cheque
public $bank_chq; // Bank of cheque
/**
* @var string bank transaction lines label
*/
public $label;
public $note;
/**
* Constructor
*

View File

@ -93,7 +93,18 @@ class PaymentVarious extends CommonObject
public $fk_project;
/**
* @var int ID
* @var int Bank account ID
*/
public $fk_account;
/**
* @var int Bank account ID
* @deprecated See fk_account
*/
public $accountid;
/**
* @var int ID record into llx_bank
*/
public $fk_bank;
@ -102,11 +113,6 @@ class PaymentVarious extends CommonObject
*/
public $categorie_transaction;
/**
* @var int Account ID
*/
public $accountid;
/**
* @var int ID
*/
@ -397,6 +403,10 @@ class PaymentVarious extends CommonObject
$this->fk_bank = (int) $this->fk_bank;
$this->fk_user_author = (int) $this->fk_user_author;
$this->fk_user_modif = (int) $this->fk_user_modif;
$this->fk_account = (int) $this->fk_account;
if (empty($this->fk_account) && isset($this->accountid)) { // For compatibility
$this->fk_account = $this->accountid;
}
// Check parameters
if (!$this->label)
@ -409,9 +419,9 @@ class PaymentVarious extends CommonObject
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
return -5;
}
if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
if (!empty($conf->banque->enabled) && (empty($this->fk_account) || $this->fk_account <= 0))
{
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
$this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
return -6;
}
if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0))
@ -454,7 +464,7 @@ class PaymentVarious extends CommonObject
$sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 0);
$sql .= ", ".$user->id;
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", NULL";
$sql .= ", NULL"; // Filled later
$sql .= ", ".$conf->entity;
$sql .= ")";
@ -473,7 +483,7 @@ class PaymentVarious extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$acc = new Account($this->db);
$result = $acc->fetch($this->accountid);
$result = $acc->fetch($this->fk_account);
if ($result <= 0) dol_print_error($this->db);
// Insert payment into llx_bank
@ -495,7 +505,7 @@ class PaymentVarious extends CommonObject
$this->datev
);
// Update fk_bank into llx_paiement.
// Update fk_bank into llx_payment_various
// So we know the payment which has generate the banking ecriture
if ($bank_line_id > 0) {
$this->update_fk_bank($bank_line_id);

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