commit
6e8828a56a
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@ -4,13 +4,14 @@ How to contribute to Dolibarr
|
|||||||
Bug reports and feature requests
|
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.
|
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.
|
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).
|
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.
|
4. Commit and push your changes.
|
||||||
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
|
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.
|
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
|
||||||
|
|
||||||
@ -141,7 +143,7 @@ Translations done on transifex are available in the next major release.
|
|||||||
|
|
||||||
Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
|
Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
|
||||||
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
|
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
|
||||||
to retreive all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.
|
to retrieve all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.
|
||||||
|
|
||||||
|
|
||||||
### Resources
|
### Resources
|
||||||
|
|||||||
4
.github/workflows/exakat.yml
vendored
4
.github/workflows/exakat.yml
vendored
@ -13,5 +13,5 @@ jobs:
|
|||||||
- name: Exakat
|
- name: Exakat
|
||||||
uses: docker://exakat/exakat-ga
|
uses: docker://exakat/exakat-ga
|
||||||
with:
|
with:
|
||||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/WrongNumberOfArguments,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/UselessParenthesis,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UseConstant'
|
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||||
ignore_dirs: '/htdocs/includes,/htdocs/build,/htdocs/dev,/htdocs/doc,/htdocs/scripts,/htdocs/test'
|
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,6 +16,7 @@ default.properties
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
*.orig
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
/dolibarr_genesis.mp4
|
/dolibarr_genesis.mp4
|
||||||
# Log files
|
# Log files
|
||||||
|
|||||||
@ -17,8 +17,10 @@ filter:
|
|||||||
- build/*
|
- build/*
|
||||||
- dev/*
|
- dev/*
|
||||||
- doc/*
|
- doc/*
|
||||||
- test/*
|
- documents/*
|
||||||
- htdocs/includes/*
|
- htdocs/includes/*
|
||||||
|
- node_modules/*
|
||||||
|
- test/*
|
||||||
paths:
|
paths:
|
||||||
- htdocs/*
|
- htdocs/*
|
||||||
- scripts/*
|
- scripts/*
|
||||||
|
|||||||
122
.travis.yml
122
.travis.yml
@ -6,8 +6,6 @@
|
|||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
#dist: bionic
|
#dist: bionic
|
||||||
# Deprecated: The key sudo has no effect anymore.
|
|
||||||
#sudo: required
|
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
@ -33,53 +31,28 @@ addons:
|
|||||||
# We need pgloader for import mysql database into pgsql
|
# We need pgloader for import mysql database into pgsql
|
||||||
- pgloader
|
- pgloader
|
||||||
|
|
||||||
php:
|
|
||||||
- '5.6'
|
|
||||||
- '7.0'
|
|
||||||
- '7.1'
|
|
||||||
- '7.2'
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- nightly
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# Set to true for very verbose output
|
# Set to true for very verbose output
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
jobs:
|
|
||||||
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
|
||||||
#- DB=mariadb
|
|
||||||
- DB=mysql
|
|
||||||
- DB=postgresql
|
|
||||||
# See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
|
|
||||||
#- WS=apache
|
|
||||||
# See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
|
|
||||||
#- WS=nginx
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
#allow_failures:
|
||||||
- php: nightly
|
#- php: nightly
|
||||||
# We exclude some combinations not usefull to save Travis CPU
|
include:
|
||||||
exclude:
|
- if: type = push
|
||||||
- php: '7.0'
|
php: '5.6'
|
||||||
env: DB=mysql
|
env: DB=postgresql
|
||||||
- php: '7.1'
|
- if: type = pull_request OR type = push
|
||||||
env: DB=mysql
|
php: '7.4'
|
||||||
- php: '7.2'
|
env: DB=mysql
|
||||||
env: DB=mysql
|
- if: type = push AND branch = develop
|
||||||
- php: '7.3'
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.0'
|
- if: type = push AND branch = 14.0
|
||||||
env: DB=postgresql
|
php: nightly
|
||||||
- php: '7.1'
|
env: DB=mysql
|
||||||
env: DB=postgresql
|
|
||||||
- php: '7.2'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: '7.3'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: nightly
|
|
||||||
env: DB=postgresql
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
@ -100,45 +73,53 @@ before_install:
|
|||||||
phpenv config-rm xdebug.ini
|
phpenv config-rm xdebug.ini
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
|
||||||
if [ "$DB" = 'postgresql' ]; then
|
|
||||||
echo "Check pgloader version"
|
|
||||||
pgloader --version
|
|
||||||
echo
|
|
||||||
fi
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
echo "Updating Composer"
|
echo "Updating Composer"
|
||||||
rm $TRAVIS_BUILD_DIR/composer.json
|
rm $TRAVIS_BUILD_DIR/composer.json
|
||||||
rm $TRAVIS_BUILD_DIR/composer.lock
|
rm $TRAVIS_BUILD_DIR/composer.lock
|
||||||
|
composer -V
|
||||||
composer self-update
|
composer self-update
|
||||||
# To have composer making parallel downloads
|
|
||||||
composer global require hirak/prestissimo
|
|
||||||
composer -n init
|
composer -n init
|
||||||
composer -n config vendor-dir htdocs/includes
|
composer -n config vendor-dir htdocs/includes
|
||||||
|
composer -n config -g vendor-dir htdocs/includes
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \
|
if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then
|
||||||
[ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
|
||||||
composer -n require phpunit/phpunit ^5 \
|
composer -n require phpunit/phpunit ^5 \
|
||||||
php-parallel-lint/php-parallel-lint ^1 \
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||||
|
composer -n require phpunit/phpunit ^6 \
|
||||||
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
|
squizlabs/php_codesniffer ^3
|
||||||
|
fi
|
||||||
|
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||||
|
composer -n require phpunit/phpunit ^7 \
|
||||||
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
|
squizlabs/php_codesniffer ^3
|
||||||
|
fi
|
||||||
|
# phpunit 9 is required for php 8
|
||||||
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \
|
composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \
|
||||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Adding path of binaries tools installed by composer to the PATH"
|
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||||
|
echo $PATH
|
||||||
|
ls $TRAVIS_BUILD_DIR/vendor
|
||||||
|
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
||||||
@ -165,15 +146,20 @@ before_script:
|
|||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Versions information"
|
echo "Versions information"
|
||||||
|
echo
|
||||||
# Check PHP
|
# Check PHP
|
||||||
echo "PHP version"
|
echo "PHP version"
|
||||||
php -i | head -
|
php -i | head -
|
||||||
# Check PHP CodeSniffer installation
|
# Check Parallel-lint version
|
||||||
|
echo "Parallel-lint version"
|
||||||
|
which parallel-lint
|
||||||
|
parallel-lint -V
|
||||||
|
# Check PHP CodeSniffer version
|
||||||
echo "PHPCS version"
|
echo "PHPCS version"
|
||||||
which phpcs
|
which phpcs
|
||||||
phpcs --version | head -
|
phpcs --version | head -
|
||||||
phpcs -i | head -
|
phpcs -i | head -
|
||||||
# Check PHPUnit installation
|
# Check PHPUnit version
|
||||||
echo "PHPUnit version"
|
echo "PHPUnit version"
|
||||||
which phpunit
|
which phpunit
|
||||||
phpunit --version | head -
|
phpunit --version | head -
|
||||||
@ -185,6 +171,10 @@ before_script:
|
|||||||
mysql --version | head -
|
mysql --version | head -
|
||||||
mysql -e "SELECT VERSION();" | head -
|
mysql -e "SELECT VERSION();" | head -
|
||||||
psql --version
|
psql --version
|
||||||
|
if [ "$DB" = 'postgresql' ]; then
|
||||||
|
echo "Check pgloader version"
|
||||||
|
pgloader --version
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
@ -278,8 +268,8 @@ script:
|
|||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
#parallel-lint --exclude htdocs/includes --blame .
|
#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 \
|
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/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
--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/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/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||||
@ -287,12 +277,13 @@ script:
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Checking coding style (excluding Pull Requests builds)"
|
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# Exclusions are defined in the ruleset.xml file
|
||||||
#phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
|
||||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||||
|
fi
|
||||||
set +e
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -407,9 +398,14 @@ script:
|
|||||||
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade12001300.log
|
||||||
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
php upgrade2.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-2.log
|
||||||
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
||||||
|
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log
|
||||||
|
php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log
|
||||||
|
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
|
||||||
|
|
||||||
# Enable modules not enabled into original dump
|
# 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_TICKETSUP,MAIN_MODULE_ACCOUNTING > $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_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
|
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
|
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
echo $?
|
echo $?
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
|
|||||||
10
COPYRIGHT
10
COPYRIGHT
@ -21,24 +21,24 @@ Mobiledetect 2.8.34 MIT License Yes
|
|||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
ParseDown 1.6 MIT License Yes Markdown parser
|
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
|
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
|
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
|
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
|
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
|
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||||
PSR/Logs 1.0 Library for logs (used by DebugBar)
|
PSR/Logs 1.0 Library for logs (used by DebugBar)
|
||||||
PSR/simple-cache ? Library for cache (used by PHPSpreadSheet)
|
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
|
Sabre 3.2.2 BSD Yes DAV support
|
||||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
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
|
Stripe 7.67.0 MIT licence Yes Library for Stripe module
|
||||||
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
||||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||||
ChartJS 2.9.3 MIT License Yes JS library for graph
|
ChartJS 2.9.4 MIT License Yes JS library for graph
|
||||||
jQuery 3.5.1 MIT License Yes JS library
|
jQuery 3.5.1 MIT License Yes JS library
|
||||||
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
||||||
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
||||||
@ -52,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 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 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
|
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
|
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
|
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer
|
||||||
|
|
||||||
|
|||||||
500
ChangeLog
500
ChangeLog
@ -3,32 +3,483 @@ English Dolibarr ChangeLog
|
|||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
----------
|
||||||
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
|
|
||||||
|
|
||||||
|
For developers:
|
||||||
|
---------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
* Properties ->contactid have been renamed into ->contact_id
|
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
|
||||||
* Properties ->titre have been renamed into ->title
|
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
|
||||||
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english)
|
* Field "tva" renamed into "total_tva" in llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
|
||||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in
|
* Field "total" renamed into "total_ttc" in llx_propal, llx_supplier_proposal for better field name consistency
|
||||||
your email templates.
|
|
||||||
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
|
|
||||||
days of holiday.
|
***** ChangeLog for 13.0.1 compared to 13.0.0 *****
|
||||||
|
|
||||||
|
FIX: 10.0 before crediting a withdrawal receipt, check whether it has been credited already.
|
||||||
|
FIX: 11.0 when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion
|
||||||
|
FIX: 11.0 when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
|
||||||
|
FIX: create MO, Column 'tms' cannot be null
|
||||||
|
FIX: #14290 #15900
|
||||||
|
FIX: #16076 patch user/list.php for extrafields
|
||||||
|
FIX: #16077 patch wrong timezone
|
||||||
|
FIX: #16079 error of service date at duplicated invoice
|
||||||
|
FIX: #16080 mailing list title
|
||||||
|
FIX: #16084 DB error at projects
|
||||||
|
FIX: #16107
|
||||||
|
FIX: #16118 Timezone problem on some fields
|
||||||
|
FIX: #16131
|
||||||
|
FIX: #16135
|
||||||
|
FIX: #16143
|
||||||
|
FIX: #16156
|
||||||
|
FIX: #16160
|
||||||
|
FIX: #16165 Create customer discount without vat
|
||||||
|
FIX: #16185
|
||||||
|
FIX: #16189, fix download/see check deposit PDF
|
||||||
|
FIX: #16215
|
||||||
|
FIX: Accountancy - label_operation is used instead of label_compte
|
||||||
|
FIX: Add critical price patch
|
||||||
|
FIX: Assignement of actors on tasks
|
||||||
|
FIX: Bad dates on info tabs
|
||||||
|
FIX: cash fence for takepos with multientity
|
||||||
|
FIX: CSRF errors on margin forms
|
||||||
|
FIX: encoding status in graph of vendor proposals
|
||||||
|
FIX: Fix detect dispached product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES)
|
||||||
|
FIX: Hide/Unhide external ICSS calendars
|
||||||
|
FIX: link to create event when task is in a project with a thirdparty
|
||||||
|
FIX: Localtax must be converted with price2num
|
||||||
|
FIX: manage price min for PRODUIT_CUSTOMER_PRICES
|
||||||
|
FIX: Missing language ico
|
||||||
|
FIX: Must not be able to edit vat of all lines if not draft
|
||||||
|
FIX: Bad "htdocs" found into a path
|
||||||
|
FIX: removed no more used proc update_modified_column_date_m on pgsql (its presence triggered errors)
|
||||||
|
FIX: Vulnerability report by Ricardo Matias
|
||||||
|
FIX: select default mail template
|
||||||
|
FIX: Select transport mode function when creating a supplier invoice and add unique key to the table llx_c_transport_mode in migrate sql
|
||||||
|
FIX: Merge of thirdparties : "unknow column fk_soc" + "Delivery" label
|
||||||
|
FIX: SQL Error in group by with postgres or mysql strict mode
|
||||||
|
FIX: TakePOS : load date function
|
||||||
|
FIX: Timeout during import
|
||||||
|
FIX: Trigger on expense report was not fired
|
||||||
|
FIX: User creation of expense report not visible
|
||||||
|
FIX: warning when adding a line if $remise_percent is an empty string
|
||||||
|
FIX: status late on purchase orders
|
||||||
|
FIX: ODT generation very slow
|
||||||
|
FIX: amount in summary of report
|
||||||
|
FIX: vat value when code contains number
|
||||||
|
FIX: payment term label on PDF
|
||||||
|
FIX: date selector when using reduced year (like on smartphone)
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||||
|
|
||||||
|
For users:
|
||||||
|
----------
|
||||||
|
NEW: Module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
||||||
|
NEW: Module Intracomm report
|
||||||
|
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
|
||||||
|
NEW: Module Recruitment to manage Job position and applications.
|
||||||
|
NEW: Several security issues after a private bug bounty campaign.
|
||||||
|
NEW: Accountancy - add chart of sub accounts
|
||||||
|
NEW: Accountancy - add options to disable binding on sales, purchases & expense reports independently of the modules
|
||||||
|
NEW: Accountancy balance - add a menu entry to show subtotal by group
|
||||||
|
NEW: Accountancy - change menu disposition
|
||||||
|
NEW: Accountancy - on transfers, select the periodicity by default
|
||||||
|
NEW: Accountancy - Add export for Gestinum (v3 & v5) #15180
|
||||||
|
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
|
||||||
|
NEW: add a page to list Stock at a given date in the past
|
||||||
|
NEW: add a start date to begin binding in accountancy
|
||||||
|
NEW: add a statistics page to list popularity of products on invoices
|
||||||
|
NEW: add calendar selection for agenda view
|
||||||
|
NEW: Support documents generation for ticket edition (PDF or ODT)
|
||||||
|
NEW: add column payment term into list of supplier invoices
|
||||||
|
NEW: add column quantity in product margin page
|
||||||
|
NEW: add column vat rate in page to define accounting account on product/service
|
||||||
|
NEW: add costprice in fields of products list
|
||||||
|
NEW: add an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
|
||||||
|
NEW: add employee link in expense report binding page
|
||||||
|
NEW: add EORI No. as ProfID5 #15382
|
||||||
|
NEW: add export for various payments
|
||||||
|
NEW: add Extrafields labels and values in mail on create ticket
|
||||||
|
NEW: add Extrafields support on ECM module
|
||||||
|
NEW: add filter rules "is answer" and "is not answer" in email collector
|
||||||
|
NEW: add focus when editing on product/stock/product.php -> close #14548
|
||||||
|
NEW: add free text on each terminal of cash desk
|
||||||
|
NEW: add global search for customer payments and vendor payments
|
||||||
|
NEW: add global search for miscellaneous payments
|
||||||
|
NEW: add helper function for table headers with numbers
|
||||||
|
NEW: add link to edit property from the search result of website pages
|
||||||
|
NEW: add link to reset qty on supplier dispatch page
|
||||||
|
NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header stored by email collector
|
||||||
|
NEW: add Manufacturing Orders attached files into the automatic ECM view
|
||||||
|
NEW: add margin info in invoice list
|
||||||
|
NEW: add mass action to set category on a list of website pages
|
||||||
|
NEW: add mass deletion for events
|
||||||
|
NEW: add mass deletion for draft invoices
|
||||||
|
NEW: add more filters on monthly statement list
|
||||||
|
NEW: add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
|
||||||
|
NEW: add option to define a default warehouse at user level
|
||||||
|
NEW: add option to include products without alert in replenish
|
||||||
|
NEW: add order by lastname and firstname by default in get sales representatives
|
||||||
|
NEW: add PDF document templates for warehouses (list of stock)
|
||||||
|
NEW: add a prospect status for the contact with managment of custom icon
|
||||||
|
NEW: add public note on products ; this also partially fix the #14342
|
||||||
|
NEW: add quick dropdown menu in top right menu (experimental with MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
|
||||||
|
NEW: add region in export companies and contacts
|
||||||
|
NEW: add rights on margin info on invoice list
|
||||||
|
NEW: add search param for close date on order list
|
||||||
|
NEW: add show preview for mail attachement on form mail
|
||||||
|
NEW: add State/Province origin for products
|
||||||
|
NEW: add the workflow interaction close intervention on closing ticket
|
||||||
|
NEW: add tracking number in list and search_all items
|
||||||
|
NEW: add vcard for adherent and user
|
||||||
|
NEW: add week number for month view in agenda
|
||||||
|
NEW: Algeria data (VAT and forme_juridique)
|
||||||
|
NEW: allow click on all header numbers on commerce area
|
||||||
|
NEW: allow to reopen interventions (green button)
|
||||||
|
NEW: allow zero quantity on supplier/vendor order line
|
||||||
|
NEW: better currency rate editor
|
||||||
|
NEW: can build vendor invoice from vendor orders
|
||||||
|
NEW: can change a product in lines of a recurring invoice or contract
|
||||||
|
NEW: can set the size of the logo on PDF documents
|
||||||
|
NEW: can change VAT rate of all lines of a draft object in one step
|
||||||
|
NEW: can define date range of validity of a login during creation
|
||||||
|
NEW: can disable, from edit page, the whole web site
|
||||||
|
NEW: can edit and set sales representatives directly on thirdparty card
|
||||||
|
NEW: can edit the list of sending email profiles
|
||||||
|
NEW: can enable/disable users in bulk actions
|
||||||
|
NEW: can filter on accounting system ref in export of chart of account
|
||||||
|
NEW: can filter on container type, language and tags in the list of web pages
|
||||||
|
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_EATBY and PRODUCT_DISABLE_SELLBY
|
||||||
|
NEW: can import proposals, sales orders, supplier invoices
|
||||||
|
NEW: can set a dedicated SMTP config for sending email from public ticket interface
|
||||||
|
NEW: can set tags/categories to website pages
|
||||||
|
NEW: can set type of price without tax per default for new sale price creation
|
||||||
|
NEW: can use desired stock of a given warehouse for replenishment
|
||||||
|
NEW: common behavior for monthly leave list view
|
||||||
|
NEW: convert all subscription in datetime
|
||||||
|
NEW: date shipment from order accepts hours
|
||||||
|
NEW: price level compatibility for variant
|
||||||
|
NEW: display stat for BOM on "object referent"/linked Object product tab
|
||||||
|
NEW: Email configuration - allow auto signed certificate when smtp ssl activated
|
||||||
|
NEW: enable free emails input with select2
|
||||||
|
NEW: Events in agenda for contact
|
||||||
|
NEW: filter on progress column in task list
|
||||||
|
NEW: filter product list by country and/or state/province
|
||||||
|
NEW: format tickets sent by mail in public interface
|
||||||
|
NEW: form to add customer/supplier into categories
|
||||||
|
NEW: Framework is ready for CSRF token protection on explicit GET URLs
|
||||||
|
NEW: helper functions for export with phpspreadsheet
|
||||||
|
NEW: hide closed contract lines
|
||||||
|
NEW: hide label in PDF for variants
|
||||||
|
NEW: if specific help page is available, we change color of icon
|
||||||
|
NEW: include the tag editor of page as a popup into website editor
|
||||||
|
NEW: introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
|
||||||
|
NEW: introducing new modal boxes in TakePOS
|
||||||
|
NEW: keep TakePOS terminal when login/logout
|
||||||
|
NEW: link on balance to the ledger
|
||||||
|
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
|
||||||
|
NEW: manage errors on update extra fields in ticket card
|
||||||
|
NEW: mass-actions for the event list view
|
||||||
|
NEW: more filter for "View change logs"
|
||||||
|
NEW: multiselect type and date to date filter
|
||||||
|
NEW: new line template: hidden conf to fill service dates from the last service line
|
||||||
|
NEW: PDF model storm for delivery
|
||||||
|
NEW: possibilty to group payments by mode and show their subtotal
|
||||||
|
NEW: Priority and transparency from external calendar events
|
||||||
|
NEW: Products - Nature of product is now a dictionary #13287
|
||||||
|
NEW: Products Import/Export 'default warehouse' and 'use batch number' fields
|
||||||
|
NEW: Purchase price table: added filterable table columns
|
||||||
|
NEW: rate editor for multicurrency
|
||||||
|
NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines
|
||||||
|
NEW: remove new lines in mail on add ticket message
|
||||||
|
NEW: Rule "email to" accept wildcard *
|
||||||
|
NEW: save filter of the project homepage
|
||||||
|
NEW: select-able columns on customer and supplier invoice paymnet list
|
||||||
|
NEW: select-able columns on miscellaneous payments + more data columns
|
||||||
|
NEW: select-able columns on social taxes list
|
||||||
|
NEW: send context and remove new lines on create ticket
|
||||||
|
NEW: show category filter on lists only when user have rights to read categories
|
||||||
|
NEW: show header number and make it clickable in warehouse area, payment area, shipment area
|
||||||
|
NEW: show image of user in the combo select of users
|
||||||
|
NEW: show label on batch card
|
||||||
|
NEW: show links for select and multi-select in category extra field
|
||||||
|
NEW: show module and permission ids on user/group rights (only admin)
|
||||||
|
NEW: show place from events on import calender
|
||||||
|
NEW: show references in contract form on interventions
|
||||||
|
NEW: show tags and status in search list of website pages
|
||||||
|
NEW: show user on external calender events (when found)
|
||||||
|
NEW: subject title with company name instead of application title in ticket message
|
||||||
|
NEW: Support for Samba4 AD
|
||||||
|
NEW: TakePOS appearance tab with more visual parameters
|
||||||
|
NEW: TakePOS add alert before changing thirdparty
|
||||||
|
NEW: TakePOS add third order printer
|
||||||
|
NEW: TakePOS can change thirdparty with barcode scan
|
||||||
|
NEW: TakePOS can create a thirdparty customer from TakePOS frontend
|
||||||
|
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
|
||||||
|
NEW: TakePOS add delayed payment
|
||||||
|
NEW: TakePOS display date range if exist
|
||||||
|
NEW: TakePOS display resiliate status for members
|
||||||
|
NEW: TakePOS Gift Receipt
|
||||||
|
NEW: TakePOS multicurrency compatibility
|
||||||
|
NEW: TakePOS multicurrency total
|
||||||
|
NEW: TakePOS print payment method and change
|
||||||
|
NEW: TakePOS restrict thirdparty to customer
|
||||||
|
NEW: TakePOS show available stock
|
||||||
|
NEW: TakePOS Weighing Scale compatibility with TakePOS connector #14725
|
||||||
|
NEW: Thirdparty Import new fields: mother company,outstanding debt limit,bank account,incoterms
|
||||||
|
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
|
||||||
|
NEW: Ticket classification on create from email collector
|
||||||
|
NEW: Ticket message notifications when edited from public interface
|
||||||
|
NEW: Ticket translate classification labels in ticket
|
||||||
|
NEW: VAT rate for Angola #15606
|
||||||
|
NEW: VAT and juridical status for Algeria
|
||||||
|
NEW: VAT report - Invert constant to show by default zero VAT in reports
|
||||||
|
NEW: website page fields selection
|
||||||
|
NEW: website - global header of a website can also have dynamic content
|
||||||
|
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: add option to put the product label in bold in the PDF templates if configured #15065
|
||||||
|
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__ and __TYPE__ substitution key
|
||||||
|
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
|
||||||
|
NEW: fill ECM src object fields in dol_add_file_process
|
||||||
|
NEW: conf to allow to show the full tree in warehouse popup
|
||||||
|
NEW: can use parameter ?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: field ref_ext in llx_commandedet
|
||||||
|
NEW: fields ref_ext for Attributes and Combinations
|
||||||
|
NEW: OAuth SCOPE for Admin SDK
|
||||||
|
NEW: standardizes API thirdparties by email like other object
|
||||||
|
NEW: Triggers Attributes and Attributes values
|
||||||
|
NEW: add incoterms data into the substitution array
|
||||||
|
NEW: add send context for ticket
|
||||||
|
NEW: add a message in error_log after detection of SQL or script injection
|
||||||
|
NEW: add validation of MX domain for emails
|
||||||
|
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
|
||||||
|
NEW: Graphics can be horizontal bars
|
||||||
|
NEW: add param to not show links when output tags
|
||||||
|
|
||||||
|
APIs
|
||||||
|
NEW: API get contacts list of a given order
|
||||||
|
NEW: API endpoint getContacts and clean results
|
||||||
|
NEW: API can update a payment
|
||||||
|
NEW: API get member by thirdparty
|
||||||
|
NEW: API get thirdparty by barcode
|
||||||
|
NEW: API get users by email / login
|
||||||
|
NEW: fetch contact by email with REST API
|
||||||
|
NEW: get state dictionnary by REST API
|
||||||
|
NEW: improve Product API for variant products
|
||||||
|
NEW: retrieve discount from invoice from API
|
||||||
|
NEW: Thirdparty REST API: endpoint to set price level
|
||||||
|
NEW: use new category API for project list view
|
||||||
|
|
||||||
|
HOOKs
|
||||||
|
NEW: add hook on propal card
|
||||||
|
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:
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* The object "livraison" has been renamed into "delivery" (directory, class, keys, methods with livraison in name ...).
|
||||||
|
* All properties ->contactid have been renamed into ->contact_id
|
||||||
|
* All properties ->titre have been renamed into ->title
|
||||||
|
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id
|
||||||
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
|
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
|
||||||
|
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace it with __USER_SIGNATURE__ if you used the old syntax in your email templates.
|
||||||
|
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday.
|
||||||
* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
|
* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
|
||||||
you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
|
you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
|
||||||
* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML.
|
* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML.
|
||||||
* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors.
|
* If you have links in your code with '&action=add', '&action=update', '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors.
|
||||||
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of amount.
|
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount.
|
||||||
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
|
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
|
||||||
* Depreciate all methods with name valide(). Use instead methods validate().
|
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
|
||||||
|
* 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)
|
||||||
|
* Database transaction in your triggers must be correctly balanced (one close for one open). If not, an error will be returned by the trigger, even if trigger did return error code.
|
||||||
|
* Dolibarr v13 is still compatible with any PHP version between 5.6.0 and 7.4.*; Unit tests are OK with PHP 8.0 but some warnings or troubles may appears with PHP 8.0.
|
||||||
|
* All your Ajax services must contains such a line at begin of file: if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 12.0.5 compared to 12.0.4 *****
|
||||||
|
FIX: before crediting a withdrawal receipt, check whether it has been credited already
|
||||||
|
FIX: mandatory extrafields of type sellist
|
||||||
|
FIX: when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion
|
||||||
|
FIX: when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
|
||||||
|
FIX: "openall" filter on ticket list does not include read tickets
|
||||||
|
FIX: ticket - extrafields of type 'date' are not saved
|
||||||
|
FIX: ticket - the "openall" filter on the ticket list does not include tickets with status READ
|
||||||
|
FIX: #14290 #15900
|
||||||
|
FIX: #15388 #15891
|
||||||
|
FIX: #15465 External user sees last 5 shipments to other customers in the dashboard
|
||||||
|
FIX: #15629
|
||||||
|
FIX: #15751 Miscellaneous payment type change to 0 after updating subledger account
|
||||||
|
FIX: #15946
|
||||||
|
FIX: #15966 #15967
|
||||||
|
FIX: Accountancy - Fix some problems on CEGID export
|
||||||
|
FIX: Accountancy - label_operation is used instead of label_compte
|
||||||
|
FIX: Accountancy - Retire entire opening balance feature
|
||||||
|
FIX: add autofix of count of email target when data is corrupted
|
||||||
|
FIX: add categories params on llxHeader filter
|
||||||
|
FIX: Add critical price patch from 12 to 11.
|
||||||
|
FIX: Bad cleaning of VAT rate when numbers are into code
|
||||||
|
FIX: Bad dates filtering in the ticket list causes sql error
|
||||||
|
FIX: balance starting and ending fiscal month #14197
|
||||||
|
FIX: bom line unit display #13831
|
||||||
|
FIX: cash fence for takepos with multientity
|
||||||
|
FIX: Check of customer/vendor code fails in some cases
|
||||||
|
FIX: create ticket : thirdparty/contact notification #15629
|
||||||
|
FIX: Creation of thirdparty when setup is empty
|
||||||
|
FIX: Dates of sales start in TakePOS
|
||||||
|
FIX: dupliacete customer or supplier code must be error dipslayed with new code proposed
|
||||||
|
FIX: Export FEC - Force Carriage Return Line Feed
|
||||||
|
FIX: Facture Situation Out : status condition
|
||||||
|
FIX: Filter on date of next generation on template invoices
|
||||||
|
FIX: Fix detect dispatched product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES)
|
||||||
|
FIX: Invoice Situation Out : status condition
|
||||||
|
FIX: issue 15659 : Missing test if supplier conf is enabled
|
||||||
|
FIX: link to create event when task is in a project with a thirdparty
|
||||||
|
FIX: Localtax must be converted with price2num
|
||||||
|
FIX: manage price min for PRODUIT_CUSTOMER_PRICES
|
||||||
|
FIX: missing GETPOST parameters on card_presend.tpl.php
|
||||||
|
FIX: missing socid into link to create event from project agenda tab
|
||||||
|
FIX: Must delete extrafields before main table on product deletion.
|
||||||
|
FIX: (path) htdocs removed
|
||||||
|
FIX: php alert sms.php
|
||||||
|
FIX: right to show VAT rate in product list
|
||||||
|
FIX: select default mail template
|
||||||
|
FIX: Timeout during import
|
||||||
|
FIX: update order by api
|
||||||
|
FIX: useless tracking number displayed on pdf if empty issue #14501
|
||||||
|
FIX: Visible date of payment
|
||||||
|
FIX: warning when adding a line if $remise_percent is an empty string
|
||||||
|
FIX: When creating a new POS sell, the creation date must be modified.
|
||||||
|
FIX: wrong name for search status param issue #15516
|
||||||
|
|
||||||
|
***** 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 *****
|
***** 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: 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
|
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
||||||
@ -55,7 +506,7 @@ FIX: Look and feel v12: First tab must be name of object
|
|||||||
FIX: missing entity check
|
FIX: missing entity check
|
||||||
FIX: missing param for hook
|
FIX: missing param for hook
|
||||||
FIX: Missing transaction on PO actions
|
FIX: Missing transaction on PO actions
|
||||||
FIX: MySql Strict mode
|
FIX: MySQL Strict mode
|
||||||
FIX: param entity in html form file
|
FIX: param entity in html form file
|
||||||
FIX: Problems on FEC format
|
FIX: Problems on FEC format
|
||||||
FIX: round stock value on product list
|
FIX: round stock value on product list
|
||||||
@ -74,6 +525,7 @@ FIX: Visualization rights correction on last modified contacts box
|
|||||||
FIX: Wrong redirection
|
FIX: Wrong redirection
|
||||||
FIX: Yogosha report 4425 (backport)
|
FIX: Yogosha report 4425 (backport)
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||||
FIX: DebugBar hides content at page bottom
|
FIX: DebugBar hides content at page bottom
|
||||||
@ -162,8 +614,8 @@ FIX: SQL Problem in customer invoice list
|
|||||||
FIX: SQL Problem in social contribution list
|
FIX: SQL Problem in social contribution list
|
||||||
FIX: SQL Problem in supplier invoice list
|
FIX: SQL Problem in supplier invoice list
|
||||||
FIX: SQL syntax error when editing extrafields
|
FIX: SQL syntax error when editing extrafields
|
||||||
FIX: Sql type
|
FIX: SQL type
|
||||||
FIX: takepos 12 hook
|
FIX: TakePOS 12 hook
|
||||||
FIX: Update form erased extrafields that were hidden
|
FIX: Update form erased extrafields that were hidden
|
||||||
FIX: Update of extrafields date
|
FIX: Update of extrafields date
|
||||||
FIX: Update of extrafiels on draft object
|
FIX: Update of extrafiels on draft object
|
||||||
@ -177,7 +629,7 @@ For users:
|
|||||||
|
|
||||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||||
NEW: Receipt printer module moved from 'development' to 'experimental'
|
NEW: Receipt printer module moved from 'development' to 'experimental'
|
||||||
NEW: Add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists.
|
NEW: add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists
|
||||||
NEW: add numbering module for TakePOS module
|
NEW: add numbering module for TakePOS module
|
||||||
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
||||||
NEW: Accountancy add column thirdparty on binding page
|
NEW: Accountancy add column thirdparty on binding page
|
||||||
@ -188,19 +640,19 @@ NEW: Accountancy - Add possibility to manage a short alternative label for accou
|
|||||||
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
||||||
NEW: Add accountancy code of thirdparty in contact and supplier export
|
NEW: Add accountancy code of thirdparty in contact and supplier export
|
||||||
NEW: support webp image format
|
NEW: support webp image format
|
||||||
NEW: Add checkbox "overwrite if exists" into ECM/DMS module
|
NEW: add checkbox "overwrite if exists" into ECM/DMS module
|
||||||
NEW: add a link to notes in members list
|
NEW: add a link to notes in members list
|
||||||
NEW: add a parameter to group same products in TakePOS
|
NEW: add a parameter to group same products in TakePOS
|
||||||
NEW: add a parameter to sort product by label in TakePOS
|
NEW: add a parameter to sort product by label in TakePOS
|
||||||
NEW: Add a profil to import contact categories
|
NEW: add a profil to import contact categories
|
||||||
NEW: Add company extrafields into order export
|
NEW: add company extrafields into order export
|
||||||
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
||||||
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
||||||
NEW: add csv separator setup in module admin
|
NEW: add csv separator setup in module admin
|
||||||
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
||||||
NEW: add default warehouse for dispatch
|
NEW: add default warehouse for dispatch
|
||||||
NEW: Add due date in feature "Export accounting documents"
|
NEW: add due date in feature "Export accounting documents"
|
||||||
NEW: Add duration information for fichinter
|
NEW: add duration information for fichinter
|
||||||
NEW: Start support of Dark theme into ELDY theme
|
NEW: Start support of Dark theme into ELDY theme
|
||||||
NEW: Add field author public alias for blog post on website module
|
NEW: Add field author public alias for blog post on website module
|
||||||
NEW: Add "finished" field on product list
|
NEW: Add "finished" field on product list
|
||||||
@ -3387,7 +3839,7 @@ Following changes may create regression for some external modules, but were nece
|
|||||||
entities and to review completely the rights of the groups and the users.
|
entities and to review completely the rights of the groups and the users.
|
||||||
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
||||||
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
||||||
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
retrieve the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
||||||
* The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output
|
* The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output
|
||||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||||
hook specifications so you must return output into "resprint".
|
hook specifications so you must return output into "resprint".
|
||||||
@ -6133,7 +6585,7 @@ For users:
|
|||||||
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
|
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
|
||||||
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
|
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
|
||||||
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
|
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
|
||||||
- Fix: Expedition creation, can retreive product from other expedition
|
- Fix: Expedition creation, can retrieve product from other expedition
|
||||||
|
|
||||||
For translators:
|
For translators:
|
||||||
- Update language files.
|
- Update language files.
|
||||||
|
|||||||
6
INSTALL
6
INSTALL
@ -1,6 +0,0 @@
|
|||||||
INSTALL
|
|
||||||
-------
|
|
||||||
|
|
||||||
English: See README.md file.
|
|
||||||
|
|
||||||
French: Voir fichier README-FR.md.
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
||||||
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## LICENCE
|
## LICENCE
|
||||||
|
|
||||||
|
|||||||
36
README.md
36
README.md
@ -13,9 +13,9 @@ You can freely use, study, modify or distribute it according to its licence.
|
|||||||
|
|
||||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||||
|
|
||||||
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||||||
|
|
||||||
#### Generic install steps:
|
#### Generic install steps:
|
||||||
|
|
||||||
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Versions).
|
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
|
||||||
|
|
||||||
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
|
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
|
||||||
|
|
||||||
@ -71,6 +71,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||||||
|
|
||||||
- Follow the installer instructions
|
- Follow the installer instructions
|
||||||
|
|
||||||
|
|
||||||
### Saas/Cloud setup
|
### Saas/Cloud setup
|
||||||
|
|
||||||
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
|
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,10 +87,12 @@ 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.
|
- 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*").
|
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
|
## WHAT'S NEW
|
||||||
|
|
||||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||||
|
|
||||||
|
|
||||||
## FEATURES
|
## FEATURES
|
||||||
|
|
||||||
### Main application/modules (all optional)
|
### Main application/modules (all optional)
|
||||||
@ -139,15 +142,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
### Other general features
|
### Other general features
|
||||||
|
|
||||||
- Localization in most major languages
|
- Localization in most major languages
|
||||||
|
- Multi-Language Support
|
||||||
- Multi-Users and groups with finely grained rights
|
- Multi-Users and groups with finely grained rights
|
||||||
- Multi-currency
|
- Multi-Currency
|
||||||
- Multi-company by adding of an external module
|
- Multi-Company (by adding of an external module)
|
||||||
|
|
||||||
- Very user friendly and easy to use
|
- Very user friendly and easy to use
|
||||||
- customizable Dashboard
|
- customizable Dashboard
|
||||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||||
|
|
||||||
- APIs
|
- APIs (REST, SOAP)
|
||||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||||
|
|
||||||
- Support a lot of country specific features:
|
- Support a lot of country specific features:
|
||||||
- Spanish Tax RE and ISPF
|
- Spanish Tax RE and ISPF
|
||||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||||
@ -160,15 +166,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||||
- …
|
- …
|
||||||
|
|
||||||
|
|
||||||
### System Environment / Requirements
|
### System Environment / Requirements
|
||||||
|
|
||||||
- Works with PHP 5.5+ 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))
|
- 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 MySQL, PHP or PostgreSQL prerequisites.
|
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
|
||||||
|
|
||||||
|
|
||||||
### Extending
|
### 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).
|
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
|
## WHAT DOLIBARR CAN'T DO YET
|
||||||
|
|
||||||
These are features that Dolibarr does **not** yet fully support:
|
These are features that Dolibarr does **not** yet fully support:
|
||||||
@ -178,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.
|
- 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)
|
- Dolibarr can't do coffee (yet)
|
||||||
|
|
||||||
|
|
||||||
## DOCUMENTATION
|
## DOCUMENTATION
|
||||||
|
|
||||||
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
|
||||||
## CONTRIBUTING
|
## 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>
|
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|
||||||
|
|
||||||
## CREDITS
|
## CREDITS
|
||||||
|
|
||||||
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
|
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.
|
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
||||||
|
|
||||||
|
|
||||||
## NEWS AND SOCIAL NETWORKS
|
## NEWS AND SOCIAL NETWORKS
|
||||||
|
|
||||||
Follow Dolibarr project on:
|
Follow Dolibarr project on:
|
||||||
@ -204,6 +220,8 @@ Follow Dolibarr project on:
|
|||||||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|
||||||
|
|
||||||
### Sponsors
|
### Sponsors
|
||||||
|
|
||||||
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
||||||
|
|
||||||
|
|||||||
46
SECURITY.md
46
SECURITY.md
@ -6,14 +6,13 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| --------- | ------------------ |
|
| --------- | ------------------ |
|
||||||
| <= 9.0.* | :x: |
|
| <= 12.* | :x: |
|
||||||
| >= 10.0.* | :white_check_mark: |
|
| >= 13.* | :white_check_mark: |
|
||||||
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
To report a vulnerability, please send an email to security@dolibarr.org
|
To report a vulnerability, please use GitHub security advisory at https://github.com/Dolibarr/dolibarr/security/advisories/new (or alternatively send an email to security@dolibarr.org)
|
||||||
In most cases, after fixing the security, we make an answer by email to say the issue has been fixed.
|
|
||||||
|
|
||||||
|
|
||||||
## Hunting vulnerabilities on Dolibarr
|
## Hunting vulnerabilities on Dolibarr
|
||||||
@ -24,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.
|
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
|
### 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
|
### Account access
|
||||||
|
|
||||||
@ -37,54 +36,42 @@ You can install the web application yourself on your own platform/server so you
|
|||||||
|
|
||||||
## Eligibility and Responsible Disclosure
|
## 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.
|
You must be the first reporter of the vulnerability (duplicate reports are closed).
|
||||||
|
|
||||||
The vulnerability must be a qualifying vulnerability (see below)
|
|
||||||
|
|
||||||
Any vulnerability found must be reported no later than 24 hours after discovery
|
|
||||||
|
|
||||||
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 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 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 leak, manipulate, or destroy any user data of third parties to find your vulnerability.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
## Scope for qualified vulnerabilities
|
## 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_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_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.
|
* $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 DebugBar and ModuleBuilder 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 valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
||||||
* 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).
|
|
||||||
* 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 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.
|
* 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.
|
* 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 in the CMS by including javascript is an expected feature.
|
* 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.
|
Scope is the web application (back office) and the APIs.
|
||||||
|
|
||||||
|
|
||||||
## Qualifying vulnerabilities for Bug bounty programs
|
## Qualifying vulnerabilities for Bug bounty programs
|
||||||
|
|
||||||
* Remote code execution (RCE)
|
* Remote code execution (RCE)
|
||||||
* Local files access and manipulation (LFI, RFI, XXE, SSRF, XSPA)
|
* Local files access and manipulation (LFI, RFI, XXE, SSRF, XSPA)
|
||||||
* Code injections (HTML, JS, SQL, PHP, ...)
|
* Code injections (HTML, JS, SQL, PHP, ...)
|
||||||
* Cross-Site Scripting (XSS)
|
* 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
|
* Open redirect
|
||||||
* Broken authentication & session management
|
* Broken authentication & session management
|
||||||
* Insecure direct object references
|
* Insecure direct object references
|
||||||
@ -96,6 +83,7 @@ Scope is the web application (back office) and the APIs.
|
|||||||
|
|
||||||
|
|
||||||
## Non-qualifying vulnerabilities for Bug bounty programs, but qualified for reporting
|
## Non-qualifying vulnerabilities for Bug bounty programs, but qualified for reporting
|
||||||
|
|
||||||
* "Self" XSS
|
* "Self" XSS
|
||||||
* SSL/TLS best practices
|
* SSL/TLS best practices
|
||||||
* Denial of Service attacks
|
* Denial of Service attacks
|
||||||
|
|||||||
102
build.xml
102
build.xml
@ -1,102 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Script build for hudson CI -->
|
|
||||||
<project name="dolibarr" default="hudson" basedir=".">
|
|
||||||
<!-- Exclude/ignore paths -->
|
|
||||||
<property name="ignorepaths" value="${basedir}/htdocs/conf,${basedir}/htdocs/core/filemanagerdol,${basedir}/htdocs/includes" />
|
|
||||||
<property name="ignoreregexp" value="**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*" />
|
|
||||||
|
|
||||||
<target name="clean">
|
|
||||||
<!-- Clean up -->
|
|
||||||
<delete dir="${basedir}/hudson"/>
|
|
||||||
<delete dir="${basedir}/generatedJUnitFiles"/>
|
|
||||||
|
|
||||||
<!-- Create build directories -->
|
|
||||||
<mkdir dir="${basedir}/hudson/doxygen"/>
|
|
||||||
<mkdir dir="${basedir}/hudson/logs"/>
|
|
||||||
<mkdir dir="${basedir}/hudson/coverage"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Run phpmd, phpcpd, phpcs, doxygen and phploc in parallel -->
|
|
||||||
<target name="parallelTasks">
|
|
||||||
<parallel>
|
|
||||||
<!-- <antcall target="phpmd"/> -->
|
|
||||||
<antcall target="phpcpd"/>
|
|
||||||
<!-- <antcall target="phpcs"/> -->
|
|
||||||
<antcall target="doxygen"/>
|
|
||||||
<antcall target="phploc"/>
|
|
||||||
</parallel>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Generate pmd.xml -->
|
|
||||||
<!--
|
|
||||||
<target name="phpmd">
|
|
||||||
<exec executable="phpmd">
|
|
||||||
<arg line="htdocs xml codesize,unusedcode
|
|
||||||
-\-reportfile '${basedir}/hudson/logs/pmd.xml'
|
|
||||||
-\-ignore=${ignorepaths}
|
|
||||||
" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Generate pmd-cpd.xml -->
|
|
||||||
<target name="phpcpd">
|
|
||||||
<exec executable="phpcpd">
|
|
||||||
<arg line=" --log-pmd '${basedir}/hudson/logs/pmd-cpd.xml'
|
|
||||||
--exclude '${basedir}/htdocs/conf'
|
|
||||||
--exclude '${basedir}/htdocs/core/filemanagerdol'
|
|
||||||
--exclude '${basedir}/htdocs/includes'
|
|
||||||
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*'
|
|
||||||
--min-tokens 70
|
|
||||||
--min-lines 20
|
|
||||||
htdocs
|
|
||||||
" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Generate phploc.csv -->
|
|
||||||
<target name="phploc">
|
|
||||||
<exec executable="phploc">
|
|
||||||
<arg line=" --log-csv '${basedir}/hudson/logs/phploc.csv'
|
|
||||||
--exclude '${basedir}/htdocs/conf'
|
|
||||||
--exclude '${basedir}/htdocs/core/filemanagerdol'
|
|
||||||
--exclude '${basedir}/htdocs/includes'
|
|
||||||
--exclude '**/PEAR/*,**/NET/*,**/HTTP/*,**/zendgdata/*,**/reportico/*'
|
|
||||||
htdocs
|
|
||||||
" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Generate checkstyle.xml -->
|
|
||||||
<target name="phpcs">
|
|
||||||
<exec executable="phpcs" dir="${basedir}">
|
|
||||||
<arg line=" --standard=${basedir}/dev/codesniffer/jenkins_ruleset.xml
|
|
||||||
--report=checkstyle
|
|
||||||
--report-file=${basedir}/hudson/logs/checkstyle.xml
|
|
||||||
--ignore=${ignorepaths},${ignoreregexp}
|
|
||||||
htdocs
|
|
||||||
"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Run unit tests and generate junit.xml and clover.xml -->
|
|
||||||
<target name="phpunit">
|
|
||||||
<exec executable="phpunit" dir="${basedir}" failonerror="true">
|
|
||||||
<arg line=" --configuration ${basedir}/test/phpunit/phpunittest.xml
|
|
||||||
--log-junit ${basedir}/hudson/logs/junit.xml
|
|
||||||
--coverage-clover ${basedir}/hudson/coverage/clover.xml
|
|
||||||
--coverage-html ${basedir}/hudson/coverage/
|
|
||||||
test/phpunit/AllTests.php
|
|
||||||
"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- Generate Doxygen documentation -->
|
|
||||||
<target name="doxygen" description="Dolibarr documentation" >
|
|
||||||
<exec executable="doxygen" dir="${basedir}" failonerror="false">
|
|
||||||
<arg value="${basedir}/build/doxygen/jenkins_doxygen.doxyfile"/>
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="hudson" depends="clean,phpunit,phpcs,parallelTasks"/>
|
|
||||||
</project>
|
|
||||||
32
build/README
32
build/README
@ -1,52 +1,64 @@
|
|||||||
README (English)
|
README (English)
|
||||||
|
|
||||||
|
Path: /dolibarr/build/README
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
Building packages
|
Building packages
|
||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
|
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
|
||||||
There are several tools:
|
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
||||||
|
It is here only to build Dolibarr packages, and those generated packages will not contains this "build" directory.
|
||||||
|
|
||||||
|
|
||||||
|
There are several tools:
|
||||||
|
|
||||||
|
|
||||||
- To build full Dolibarr packages, launch the script
|
- To build full Dolibarr packages, launch the script
|
||||||
> Launch command perl makepack-dolibarr.pl
|
> Launch command perl makepack-dolibarr.pl
|
||||||
|
|
||||||
Note: Prerequisites to build tgz, debian, rpm package
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Prerequisites to build tgz, debian and rpm packages:
|
||||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||||
|
|
||||||
Note: Prerequisites to build autoexe DoliWamp package:
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Prerequisites to build autoexe DoliWamp package:
|
||||||
> apt-get install wine q4wine
|
> apt-get install wine q4wine
|
||||||
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
||||||
> Install InnoSetup
|
> Install InnoSetup
|
||||||
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
|
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
|
||||||
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
||||||
For example by running wampserver3.2.0_x64.exe (http://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com).
|
||||||
|
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
||||||
> Add path to ISCC into PATH windows var:
|
> Add path to ISCC into PATH windows var:
|
||||||
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
||||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
||||||
open file build/exe/doliwamp.iss and click on button "Compile".
|
open file build/exe/doliwamp.iss and click on button "Compile".
|
||||||
The .exe file will be build into directory build.
|
The .exe file will be build into directory build.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a theme package, launch the script
|
- To build a theme package, launch the script
|
||||||
> perl makepack-dolibarrtheme.pl
|
> perl makepack-dolibarrtheme.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a package for a module, launch the script
|
- To build a package for a module, launch the script
|
||||||
> perl makepack-dolibarrmodule.pl
|
> perl makepack-dolibarrmodule.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build developper documentation, launch the script
|
- To build developper documentation, launch the script
|
||||||
> perl dolibarr-doxygen-build.pl
|
> perl dolibarr-doxygen-build.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
Note:
|
|
||||||
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
|
||||||
It is here only to build Dolibarr packages, and those generated packages will not contains this "build" directory.
|
|
||||||
|
|
||||||
|
|
||||||
You can find in "build", following sub-directories:
|
You can find in "build", following sub-directories:
|
||||||
|
|||||||
@ -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/jquery/plugins/datatables
|
||||||
- htdocs/includes/jszip
|
- htdocs/includes/jszip
|
||||||
- htdocs/includes/mike42
|
- htdocs/includes/mike42
|
||||||
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
|
- htdocs/includes/phpoffice
|
||||||
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
||||||
- htdocs/includes/swiftmailer
|
- htdocs/includes/swiftmailer
|
||||||
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
||||||
|
|||||||
@ -232,7 +232,7 @@ $dolibarr_main_prod='0';
|
|||||||
# Examples:
|
# Examples:
|
||||||
# $dolibarr_mailing_limit_sendbycli='0';
|
# $dolibarr_mailing_limit_sendbycli='0';
|
||||||
|
|
||||||
# dolibarr_distrib
|
# dolibarr_main_distrib
|
||||||
# A key to identify the distribution used for first installation
|
# A key to identify the distribution used for first installation
|
||||||
$dolibarr_distrib = 'deb';
|
$dolibarr_main_distrib = 'debian';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ Priority: optional
|
|||||||
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
Maintainer: Laurent Destailleur (eldy) <eldy@users.sourceforge.net>
|
||||||
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
|
# Uploaders: Laurent Destailleur (eldy) <eldy@users.sourceforge.net> # Only if differs from Maintainer
|
||||||
Standards-Version: 3.9.6
|
Standards-Version: 3.9.6
|
||||||
Homepage: http://www.dolibarr.org
|
Homepage: https://www.dolibarr.org
|
||||||
Build-Depends: debhelper (>= 9), po-debconf
|
Build-Depends: debhelper (>= 9), po-debconf
|
||||||
# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
# This package need at least debian 7 or ubuntu 13.04 or any distribution based on this version
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: Dolibarr
|
Upstream-Name: Dolibarr
|
||||||
Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
|
Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
Source: https://www.dolibarr.org/files/stable/standard/
|
Source: https://www.dolibarr.org/files/stable/standard/
|
||||||
@ -37,7 +37,8 @@ Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|||||||
2010, Servitux Servicios Informaticos <info@servitux.es>
|
2010, Servitux Servicios Informaticos <info@servitux.es>
|
||||||
2011, Herve Prot <herve.prot@symeos.com>
|
2011, Herve Prot <herve.prot@symeos.com>
|
||||||
2011, Remy Younes <ryounes@gmail.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+
|
License: GPL-3+
|
||||||
This program is free software; you can redistribute it
|
This program is free software; you can redistribute it
|
||||||
and/or modify it under the terms of the GNU General Public
|
and/or modify it under the terms of the GNU General Public
|
||||||
@ -56,7 +57,9 @@ License: GPL-3+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 3 can be found in the file
|
License version 3 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-3'.
|
'/usr/share/common-licenses/GPL-3'.
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/adodbtime/*
|
Files: htdocs/includes/adodbtime/*
|
||||||
Copyright: 2003-2005, John Lim
|
Copyright: 2003-2005, John Lim
|
||||||
@ -80,6 +83,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package since we use
|
Those files are not shipped in the binary package since we use
|
||||||
the library as packaged in "libphp-adodb".
|
the library as packaged in "libphp-adodb".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/ckeditor/*
|
Files: htdocs/includes/ckeditor/*
|
||||||
Copyright: 2003-2012 CKSource - Frederico Knabben
|
Copyright: 2003-2012 CKSource - Frederico Knabben
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
@ -109,6 +115,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package since we use the
|
Those files are not shipped in the binary package since we use the
|
||||||
library as packaged in "ckeditor".
|
library as packaged in "ckeditor".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/fonts/*
|
Files: htdocs/includes/fonts/*
|
||||||
Copyright: 2003, Bitstream Inc
|
Copyright: 2003, Bitstream Inc
|
||||||
unknown, Gavin Graham
|
unknown, Gavin Graham
|
||||||
@ -159,6 +168,9 @@ Comments:
|
|||||||
Those files are not shipped in the binary package as we
|
Those files are not shipped in the binary package as we
|
||||||
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
|
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: doc/images/*
|
Files: doc/images/*
|
||||||
Copyright: Laurent Destailleur
|
Copyright: Laurent Destailleur
|
||||||
License: CC-BY-SA-3.0
|
License: CC-BY-SA-3.0
|
||||||
@ -174,33 +186,15 @@ License: CC-BY-SA-3.0
|
|||||||
distribute the resulting work only under the same, similar or a compatible
|
distribute the resulting work only under the same, similar or a compatible
|
||||||
license.
|
license.
|
||||||
.
|
.
|
||||||
For more information, see http://creativecommons.org/licenses/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
|
Copyright: 2007 MaxMind LLC
|
||||||
License: LGPL-2.1+
|
License: CC-By-SA
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
@ -216,10 +210,14 @@ License: LGPL-2.1+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU Lesser General Public
|
On Debian systems, the full text of the GNU Lesser General Public
|
||||||
License version 2.1 can be found in the file
|
License version 2.1 can be found in the file
|
||||||
`/usr/share/common-licenses/LGPL-2.1'.
|
'/usr/share/common-licenses/LGPL-2.1'.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jquery/*
|
Files: htdocs/includes/jquery/*
|
||||||
Copyright: JQuery team
|
Copyright: JQuery team
|
||||||
|
https://www.jquery.com
|
||||||
License: GPL-2+ or MIT
|
License: GPL-2+ or MIT
|
||||||
=== GPL-2+ LICENSE NOTICE ===
|
=== GPL-2+ LICENSE NOTICE ===
|
||||||
.
|
.
|
||||||
@ -240,7 +238,7 @@ License: GPL-2+ or MIT
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
.
|
.
|
||||||
=== MIT LICENSE ===
|
=== MIT LICENSE ===
|
||||||
.
|
.
|
||||||
@ -267,6 +265,8 @@ Comment:
|
|||||||
"libjs-jquery-ui". Most of the plugins are shipped though.
|
"libjs-jquery-ui". Most of the plugins are shipped though.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jquery/plugins/flot/*
|
Files: htdocs/includes/jquery/plugins/flot/*
|
||||||
Copyright: Flot team
|
Copyright: Flot team
|
||||||
License: Public-Domain
|
License: Public-Domain
|
||||||
@ -275,6 +275,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package because we configure
|
Those files are not shipped in the binary package because we configure
|
||||||
Dolibarr to use the files provided by "libjs-flot".
|
Dolibarr to use the files provided by "libjs-flot".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jsgantt/*
|
Files: htdocs/includes/jsgantt/*
|
||||||
Copyright: JSGantt team
|
Copyright: JSGantt team
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
@ -295,7 +298,10 @@ License: GPL-2+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/nusoap/*
|
Files: htdocs/includes/nusoap/*
|
||||||
Copyright: 2002-2010 NuSphere Corporation
|
Copyright: 2002-2010 NuSphere Corporation
|
||||||
@ -315,11 +321,14 @@ License: LGPL-2.1+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU Lesser General Public
|
On Debian systems, the full text of the GNU Lesser General Public
|
||||||
License version 2.1 can be found in the file
|
License version 2.1 can be found in the file
|
||||||
`/usr/share/common-licenses/LGPL-2.1'.
|
'/usr/share/common-licenses/LGPL-2.1'.
|
||||||
Comment:
|
Comment:
|
||||||
Those files are not shipped in the binary package since we
|
Those files are not shipped in the binary package since we
|
||||||
configure Dolibarr to use the library provided in "libnusoap-php".
|
configure Dolibarr to use the library provided in "libnusoap-php".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/odtphp/*
|
Files: htdocs/includes/odtphp/*
|
||||||
Copyright: 2008, Julien Pauli
|
Copyright: 2008, Julien Pauli
|
||||||
2008, Cyril PIERRE de GEYER
|
2008, Cyril PIERRE de GEYER
|
||||||
@ -342,29 +351,12 @@ License: GPL-2+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/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
|
Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
License: LGPL-3.0+
|
License: LGPL-3.0+
|
||||||
TCPDF is free software: you can redistribute it and/or modify it
|
TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
|||||||
@ -23,7 +23,7 @@ setup_empty_conf() {
|
|||||||
mkdir -p /etc/dolibarr
|
mkdir -p /etc/dolibarr
|
||||||
touch /etc/dolibarr/conf.php
|
touch /etc/dolibarr/conf.php
|
||||||
chown root:www-data /etc/dolibarr/conf.php
|
chown root:www-data /etc/dolibarr/conf.php
|
||||||
chmod 664 /etc/dolibarr/conf.php
|
chmod 660 /etc/dolibarr/conf.php
|
||||||
}
|
}
|
||||||
|
|
||||||
is_new_upstream_version() {
|
is_new_upstream_version() {
|
||||||
@ -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_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_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_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_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_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
|
#grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -24,6 +24,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='debian';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one.
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one.
|
||||||
// If during install, we enable/disable declaration to use non embedded libraries, we must also check they are
|
// If during install, we enable/disable declaration to use non embedded libraries, we must also check they are
|
||||||
@ -34,7 +35,6 @@ $force_install_lockinstall='444';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$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_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||||
|
|||||||
@ -103,8 +103,6 @@ override_dh_install:
|
|||||||
|
|
||||||
# clean from useless files
|
# clean from useless files
|
||||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
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/dejavu-fonts-ttf-2.33
|
||||||
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
||||||
rm -fr htdocs/includes/tcpdf/fonts/utils
|
rm -fr htdocs/includes/tcpdf/fonts/utils
|
||||||
@ -113,7 +111,6 @@ override_dh_install:
|
|||||||
|
|
||||||
# Licence files are already included into copyright file.
|
# Licence files are already included into copyright file.
|
||||||
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
|
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
|
||||||
rm -f htdocs/includes/phpexcel/license.txt
|
|
||||||
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
||||||
|
|
||||||
# Drop unwanted executable permissions
|
# Drop unwanted executable permissions
|
||||||
|
|||||||
@ -20,6 +20,9 @@ RUN apt-get update -y \
|
|||||||
unzip \
|
unzip \
|
||||||
curl \
|
curl \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
|
msmtp \
|
||||||
|
msmtp-mta \
|
||||||
|
mailutils \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove -y \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||||
@ -44,7 +47,17 @@ RUN echo 'xdebug.remote_port=9000' >> ${PHP_INI_DIR}/php.ini
|
|||||||
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
||||||
#RUN echo '172.17.0.1 docker.host' >> /etc/hosts
|
#RUN echo 'localhost docker.host' >> /etc/hosts
|
||||||
|
|
||||||
|
# set up sendmail config, to use maildev
|
||||||
|
RUN echo "account default" > /etc/msmtprc
|
||||||
|
RUN echo "auth off" >> /etc/msmtprc
|
||||||
|
RUN echo "port 25" >> /etc/msmtprc
|
||||||
|
RUN echo "host mail" >> /etc/msmtprc
|
||||||
|
RUN echo "from local@localdomain.com" >> /etc/msmtprc
|
||||||
|
RUN echo "domain localhost.localdomain" >> /etc/msmtprc
|
||||||
|
RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
|
||||||
|
RUN echo "localhost localhost.localdomain" >> /etc/hosts
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ And then, you can run :
|
|||||||
|
|
||||||
docker-compose up
|
docker-compose up
|
||||||
|
|
||||||
This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin.
|
This will run 4 containers Docker : Dolibarr, MariaDB, PhpMyAdmin and MailDev.
|
||||||
|
|
||||||
The URL to go to the Dolibarr is :
|
The URL to go to the Dolibarr is :
|
||||||
|
|
||||||
@ -26,6 +26,9 @@ The URL to go to PhpMyAdmin is (login/password is root/root) :
|
|||||||
|
|
||||||
http://0.0.0.0:8080
|
http://0.0.0.0:8080
|
||||||
|
|
||||||
Setup the database connection during the installation process, please use mariad
|
In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev
|
||||||
b (name of the database container) as database host.
|
|
||||||
|
http://0.0.0.0:8081
|
||||||
|
|
||||||
|
Setup the database connection during the installation process, please use mariadb (name of the database container) as database host.
|
||||||
Setup documents folder, during the installation process, to /var/documents
|
Setup documents folder, during the installation process, to /var/documents
|
||||||
|
|||||||
@ -52,3 +52,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8081:80"
|
- "8081:80"
|
||||||
- "25:25"
|
- "25:25"
|
||||||
|
networks:
|
||||||
|
- internal-pod
|
||||||
|
- external-pod
|
||||||
|
|||||||
@ -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"
|
;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
||||||
|
|
||||||
; Dolibarr
|
; 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: "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: "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"
|
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
|
||||||
|
|||||||
@ -22,6 +22,7 @@ $force_install_databaserootpass='WAMPMYSQLNEWPASSWORD';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='644';
|
$force_install_lockinstall='644';
|
||||||
|
$force_install_distrib='doliwamp';
|
||||||
|
|
||||||
$force_install_module='';
|
$force_install_module='';
|
||||||
?>
|
?>
|
||||||
@ -105,8 +105,8 @@ if (empty($includecustom)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "Release : ".$release."\n";
|
|
||||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||||
|
print "Release : ".$release."\n";
|
||||||
print "Include custom in signature : ".$includecustom."\n";
|
print "Include custom in signature : ".$includecustom."\n";
|
||||||
print "Include constants in signature : ";
|
print "Include constants in signature : ";
|
||||||
foreach ($includeconstants as $countrycode => $tmp) {
|
foreach ($includeconstants as $countrycode => $tmp) {
|
||||||
@ -125,6 +125,11 @@ $checksumconcat=array();
|
|||||||
|
|
||||||
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
||||||
$fp = fopen($outputfile, 'w');
|
$fp = fopen($outputfile, 'w');
|
||||||
|
if (empty($fp)) {
|
||||||
|
print 'Failed to open file '.$outputfile."\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
||||||
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
||||||
|
|
||||||
@ -148,6 +153,7 @@ $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom
|
|||||||
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
||||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||||
|
|
||||||
$dir='';
|
$dir='';
|
||||||
$needtoclose=0;
|
$needtoclose=0;
|
||||||
foreach ($files as $filetmp) {
|
foreach ($files as $filetmp) {
|
||||||
@ -155,9 +161,10 @@ foreach ($files as $filetmp) {
|
|||||||
//$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
//$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||||
if ($newdir!=$dir) {
|
if ($newdir!=$dir) {
|
||||||
if ($needtoclose)
|
if ($needtoclose) {
|
||||||
fputs($fp, ' </dir>'."\n");
|
fputs($fp, ' </dir>'."\n");
|
||||||
fputs($fp, ' <dir name="'.$newdir.'" >'."\n");
|
}
|
||||||
|
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||||
$dir = $newdir;
|
$dir = $newdir;
|
||||||
$needtoclose=1;
|
$needtoclose=1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -476,6 +476,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
||||||
@ -503,7 +504,10 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mysql/README`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/sqlite3`;
|
||||||
|
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/node_modules`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||||
@ -575,55 +579,55 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||||
|
|
||||||
# Removed other test files
|
# Removed other test files
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||||
|
|
||||||
|
# Removed files installed by the awful composer
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/.github`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/samples`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
$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/parsedown/LICENSE.txt`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
$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/sabre/sabre/*/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
||||||
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
@ -181,6 +181,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -198,7 +199,6 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
%_datadir/dolibarr/htdocs/intracommreport
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -212,6 +212,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/product
|
%_datadir/dolibarr/htdocs/product
|
||||||
%_datadir/dolibarr/htdocs/projet
|
%_datadir/dolibarr/htdocs/projet
|
||||||
%_datadir/dolibarr/htdocs/public
|
%_datadir/dolibarr/htdocs/public
|
||||||
|
%_datadir/dolibarr/htdocs/recruitment
|
||||||
%_datadir/dolibarr/htdocs/reception
|
%_datadir/dolibarr/htdocs/reception
|
||||||
%_datadir/dolibarr/htdocs/resource
|
%_datadir/dolibarr/htdocs/resource
|
||||||
%_datadir/dolibarr/htdocs/salaries
|
%_datadir/dolibarr/htdocs/salaries
|
||||||
@ -274,7 +275,6 @@ then
|
|||||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
#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_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_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_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_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
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -261,6 +261,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -278,7 +279,6 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
%_datadir/dolibarr/htdocs/intracommreport
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -292,6 +292,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/product
|
%_datadir/dolibarr/htdocs/product
|
||||||
%_datadir/dolibarr/htdocs/projet
|
%_datadir/dolibarr/htdocs/projet
|
||||||
%_datadir/dolibarr/htdocs/public
|
%_datadir/dolibarr/htdocs/public
|
||||||
|
%_datadir/dolibarr/htdocs/recruitment
|
||||||
%_datadir/dolibarr/htdocs/reception
|
%_datadir/dolibarr/htdocs/reception
|
||||||
%_datadir/dolibarr/htdocs/resource
|
%_datadir/dolibarr/htdocs/resource
|
||||||
%_datadir/dolibarr/htdocs/salaries
|
%_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_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_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_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_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_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
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -177,6 +177,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
@ -195,7 +196,6 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
%_datadir/dolibarr/htdocs/intracommreport
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -209,6 +209,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/product
|
%_datadir/dolibarr/htdocs/product
|
||||||
%_datadir/dolibarr/htdocs/projet
|
%_datadir/dolibarr/htdocs/projet
|
||||||
%_datadir/dolibarr/htdocs/public
|
%_datadir/dolibarr/htdocs/public
|
||||||
|
%_datadir/dolibarr/htdocs/recruitment
|
||||||
%_datadir/dolibarr/htdocs/reception
|
%_datadir/dolibarr/htdocs/reception
|
||||||
%_datadir/dolibarr/htdocs/resource
|
%_datadir/dolibarr/htdocs/resource
|
||||||
%_datadir/dolibarr/htdocs/salaries
|
%_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_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_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_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_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_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
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -189,6 +189,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -206,7 +207,6 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
%_datadir/dolibarr/htdocs/intracommreport
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -220,6 +220,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/product
|
%_datadir/dolibarr/htdocs/product
|
||||||
%_datadir/dolibarr/htdocs/projet
|
%_datadir/dolibarr/htdocs/projet
|
||||||
%_datadir/dolibarr/htdocs/public
|
%_datadir/dolibarr/htdocs/public
|
||||||
|
%_datadir/dolibarr/htdocs/recruitment
|
||||||
%_datadir/dolibarr/htdocs/reception
|
%_datadir/dolibarr/htdocs/reception
|
||||||
%_datadir/dolibarr/htdocs/resource
|
%_datadir/dolibarr/htdocs/resource
|
||||||
%_datadir/dolibarr/htdocs/salaries
|
%_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_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_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_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_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_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
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmfedora';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmgeneric';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
// We don't force any external lib with generic package
|
// We don't force any external lib with generic package
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmmandriva';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmopensuse';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_install_lockinstall='444';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
"nnnick/chartjs" : "^2.9",
|
"nnnick/chartjs" : "^2.9",
|
||||||
"stripe/stripe-php" : "6.43.1",
|
"stripe/stripe-php" : "6.43.1",
|
||||||
"maximebf/debugbar" : "1.15.1",
|
"maximebf/debugbar" : "1.15.1",
|
||||||
"symfony/var-dumper": "3"
|
"symfony/var-dumper" : "3"
|
||||||
},
|
},
|
||||||
"require-dev" : {
|
"require-dev" : {
|
||||||
"php-parallel-lint/php-parallel-lint" : "^0",
|
"php-parallel-lint/php-parallel-lint" : "^0",
|
||||||
|
|||||||
592
composer.lock
generated
592
composer.lock
generated
File diff suppressed because it is too large
Load Diff
15
dev/README
15
dev/README
@ -1,13 +1,14 @@
|
|||||||
README (English)
|
README (English)
|
||||||
--------------------------------
|
--------------------------------
|
||||||
This directory contains sub-directories to provide tools or
|
|
||||||
documentation for developers.
|
|
||||||
Note: All files in this directory are in VCS only and are not
|
|
||||||
provided with a standard release.
|
|
||||||
|
|
||||||
|
This directory contains sub-directories to provide tools or documentation for developers.
|
||||||
|
|
||||||
|
Note: All files in this directory are in the source repository only and are not provided with a standard release. They are useless to make Dolibarr working.
|
||||||
|
|
||||||
|
You may find a more complete documentation on Dolibarr on the wiki:
|
||||||
|
|
||||||
There is also some documentation on Dolibarr Wiki:
|
|
||||||
https://wiki.dolibarr.org/
|
https://wiki.dolibarr.org/
|
||||||
and
|
|
||||||
https://doxygen.dolibarr.org/
|
|
||||||
|
|
||||||
|
and on
|
||||||
|
|
||||||
|
https://doxygen.dolibarr.org/
|
||||||
|
|||||||
@ -48,6 +48,14 @@ By
|
|||||||
* In file nusoap.php, to avoid a warning,
|
* In file nusoap.php, to avoid a warning,
|
||||||
Replace call to serialize_val with no bugged value
|
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
|
||||||
|
|
||||||
|
* Line 4222 of file nusoap.php
|
||||||
|
|
||||||
|
$rev = array();
|
||||||
|
preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev);
|
||||||
|
$this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -127,15 +135,13 @@ with
|
|||||||
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||||
|
|
||||||
|
|
||||||
|
* In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace
|
||||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function fopenLocal, replace
|
|
||||||
|
|
||||||
if (strpos($filename, '://') === false) {
|
if (strpos($filename, '://') === false) {
|
||||||
|
|
||||||
with
|
with
|
||||||
|
|
||||||
if (strpos($filename, '//') === 0)
|
if (strpos($filename, '//') === 0) {
|
||||||
{
|
|
||||||
// Share folder on a (windows) server
|
// Share folder on a (windows) server
|
||||||
// e.g.: "//[MyServerName]/[MySharedFolder]/"
|
// e.g.: "//[MyServerName]/[MySharedFolder]/"
|
||||||
//
|
//
|
||||||
@ -167,17 +173,17 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
|||||||
|
|
||||||
TCPDI:
|
TCPDI:
|
||||||
------
|
------
|
||||||
Add fpdf_tpl.php 1.2
|
Add file fpdf_tpl.php 1.2
|
||||||
|
|
||||||
Add tcpdi.php
|
Add file tcpdi.php
|
||||||
|
|
||||||
Add tcpdi_parser.php and replace:
|
Add file tcpdi_parser.php and replace:
|
||||||
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
|
||||||
with:
|
with:
|
||||||
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
|
||||||
|
|
||||||
|
|
||||||
* Fix by replacing
|
* Fix syntax error by replacing
|
||||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
|
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
|
||||||
with
|
with
|
||||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||||
@ -187,23 +193,23 @@ with
|
|||||||
JSGANTT:
|
JSGANTT:
|
||||||
--------
|
--------
|
||||||
* Replace in function JSGantt.taskLink
|
* Replace in function JSGantt.taskLink
|
||||||
var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
||||||
with
|
with
|
||||||
// LDR To open in same window
|
// LDR To open in same window
|
||||||
//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
//var OpenWindow=window.open(pRef, "newwin", "height="+vHeight+",width="+vWidth);
|
||||||
window.location.href=pRef
|
window.location.href=pRef
|
||||||
|
|
||||||
* Replace
|
* Replace
|
||||||
vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
|
vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
|
||||||
with
|
with
|
||||||
var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
|
var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
|
||||||
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
|
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
|
||||||
vTmpNode.setAttribute('href',vTaskList[i].getLink());
|
vTmpNode.setAttribute('href',vTaskList[i].getLink());
|
||||||
|
|
||||||
* Replace '% Comp.' to have a smaller text column header
|
* Replace '% Comp.' to have a smaller text column header
|
||||||
'comp':'% Comp.'
|
'comp':'% Comp.'
|
||||||
with
|
with
|
||||||
'comp':'%'
|
'comp':'%'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -217,14 +223,6 @@ JQUERYFILETREE:
|
|||||||
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
* 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:
|
RESTLER:
|
||||||
--------
|
--------
|
||||||
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
||||||
@ -236,9 +234,19 @@ Change content of file htdocs/includes/restler/framework/Luracast/Restler/explor
|
|||||||
public static function getShortName($className)
|
public static function getShortName($className)
|
||||||
{
|
{
|
||||||
// @CHANGE LDR
|
// @CHANGE LDR
|
||||||
if (! is_string($className)) return;
|
if (!is_string($className)) return;
|
||||||
//var_dump($className);
|
//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
|
PARSEDOWN
|
||||||
@ -306,7 +314,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
|
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 {
|
.select2-hidden-accessible {
|
||||||
margin: -1px !important; /* line to restore */
|
margin: -10000px !important; /* line to restore */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
|||||||
|
|
||||||
// Test if batch mode
|
// Test if batch mode
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
|||||||
|
|
||||||
// Load user and its permissions
|
// Load user and its permissions
|
||||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
if (! $result > 0) {
|
||||||
|
dol_print_error('', $user->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
|
||||||
@ -82,12 +85,12 @@ $obj->lines[]=$line1;
|
|||||||
|
|
||||||
// Create invoice
|
// Create invoice
|
||||||
$idobject=$obj->create($user);
|
$idobject=$obj->create($user);
|
||||||
if ($idobject > 0)
|
if ($idobject > 0) {
|
||||||
{
|
|
||||||
// Change status to validated
|
// Change status to validated
|
||||||
$result=$obj->validate($user);
|
$result=$obj->validate($user);
|
||||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
if ($result > 0) {
|
||||||
else {
|
print "OK Object created with id ".$idobject."\n";
|
||||||
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
dol_print_error($db, $obj->error);
|
dol_print_error($db, $obj->error);
|
||||||
}
|
}
|
||||||
@ -99,8 +102,7 @@ if ($idobject > 0)
|
|||||||
|
|
||||||
// -------------------- END OF YOUR CODE --------------------
|
// -------------------- END OF YOUR CODE --------------------
|
||||||
|
|
||||||
if (! $error)
|
if (! $error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
print '--- end ok'."\n";
|
print '--- end ok'."\n";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
|||||||
|
|
||||||
// Test if batch mode
|
// Test if batch mode
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
|||||||
|
|
||||||
// Load user and its permissions
|
// Load user and its permissions
|
||||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
if (! $result > 0) {
|
||||||
|
dol_print_error('', $user->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
|
||||||
@ -80,12 +83,12 @@ $com->lines[]=$orderline1;
|
|||||||
|
|
||||||
// Create order
|
// Create order
|
||||||
$idobject=$com->create($user);
|
$idobject=$com->create($user);
|
||||||
if ($idobject > 0)
|
if ($idobject > 0) {
|
||||||
{
|
|
||||||
// Change status to validated
|
// Change status to validated
|
||||||
$result=$com->valid($user);
|
$result=$com->valid($user);
|
||||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
if ($result > 0) {
|
||||||
else {
|
print "OK Object created with id ".$idobject."\n";
|
||||||
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
dol_print_error($db, $com->error);
|
dol_print_error($db, $com->error);
|
||||||
}
|
}
|
||||||
@ -97,8 +100,7 @@ if ($idobject > 0)
|
|||||||
|
|
||||||
// -------------------- END OF YOUR CODE --------------------
|
// -------------------- END OF YOUR CODE --------------------
|
||||||
|
|
||||||
if (! $error)
|
if (! $error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
print '--- end ok'."\n";
|
print '--- end ok'."\n";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
|||||||
|
|
||||||
// Test if batch mode
|
// Test if batch mode
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
|||||||
|
|
||||||
// Load user and its permissions
|
// Load user and its permissions
|
||||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
if (! $result > 0) {
|
||||||
|
dol_print_error('', $user->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
|
||||||
@ -79,8 +82,7 @@ $myproduct->weight_units = 0;
|
|||||||
|
|
||||||
// Create product in database
|
// Create product in database
|
||||||
$idobject = $myproduct->create($user);
|
$idobject = $myproduct->create($user);
|
||||||
if ($idobject > 0)
|
if ($idobject > 0) {
|
||||||
{
|
|
||||||
print "OK Object created with id ".$idobject."\n";
|
print "OK Object created with id ".$idobject."\n";
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
@ -89,8 +91,7 @@ if ($idobject > 0)
|
|||||||
|
|
||||||
// -------------------- END OF YOUR CODE --------------------
|
// -------------------- END OF YOUR CODE --------------------
|
||||||
|
|
||||||
if (! $error)
|
if (! $error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
print '--- end ok'."\n";
|
print '--- end ok'."\n";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
|||||||
|
|
||||||
// Test if batch mode
|
// Test if batch mode
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
@ -49,7 +49,10 @@ $langs->load("main"); // To load language file for default language
|
|||||||
|
|
||||||
// Load user and its permissions
|
// Load user and its permissions
|
||||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
if (! $result > 0) {
|
||||||
|
dol_print_error('', $user->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
|
||||||
@ -69,18 +72,17 @@ $obj->nom = 'ABCDEF';
|
|||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
$idobject=$obj->create($user);
|
$idobject=$obj->create($user);
|
||||||
if ($idobject > 0)
|
if ($idobject > 0) {
|
||||||
{
|
|
||||||
// Change status to validated
|
// Change status to validated
|
||||||
$result=$obj->setStatut(1);
|
$result=$obj->setStatut(1);
|
||||||
if ($result > 0) print "OK Object created with id ".$idobject."\n";
|
if ($result > 0) {
|
||||||
else {
|
print "OK Object created with id ".$idobject."\n";
|
||||||
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
dol_print_error($db, $obj->error);
|
dol_print_error($db, $obj->error);
|
||||||
}
|
}
|
||||||
} elseif ($obj->error == 'ErrorLoginAlreadyExists')
|
} elseif ($obj->error == 'ErrorLoginAlreadyExists') {
|
||||||
{
|
print "User with login ".$obj->login." already exists\n";
|
||||||
print "User with login ".$obj->login." already exists\n";
|
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
dol_print_error($db, $obj->error);
|
dol_print_error($db, $obj->error);
|
||||||
@ -89,8 +91,7 @@ if ($idobject > 0)
|
|||||||
|
|
||||||
// -------------------- END OF YOUR CODE --------------------
|
// -------------------- END OF YOUR CODE --------------------
|
||||||
|
|
||||||
if (! $error)
|
if (! $error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
print '--- end ok'."\n";
|
print '--- end ok'."\n";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -29,8 +29,8 @@ $path=dirname(__FILE__).'/';
|
|||||||
|
|
||||||
// Test if batch mode
|
// Test if batch mode
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global variables
|
// Global variables
|
||||||
@ -49,14 +49,17 @@ $langs->load("main"); // To load language file for default language
|
|||||||
|
|
||||||
// Load user and its permissions
|
// Load user and its permissions
|
||||||
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||||
if (! $result > 0) { dol_print_error('', $user->error); exit; }
|
if (! $result > 0) {
|
||||||
|
dol_print_error('', $user->error);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
$user->getrights();
|
$user->getrights();
|
||||||
|
|
||||||
|
|
||||||
print "***** ".$script_file." (".$version.") *****\n";
|
print "***** ".$script_file." (".$version.") *****\n";
|
||||||
if (! isset($argv[1])) { // Check parameters
|
if (! isset($argv[1])) { // Check parameters
|
||||||
print "Usage: ".$script_file." id_thirdparty ...\n";
|
print "Usage: ".$script_file." id_thirdparty ...\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
print '--- start'."\n";
|
print '--- start'."\n";
|
||||||
print 'Argument id_thirdparty='.$argv[1]."\n";
|
print 'Argument id_thirdparty='.$argv[1]."\n";
|
||||||
|
|||||||
49
dev/examples/git/pre-commit
Normal file
49
dev/examples/git/pre-commit
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
|
||||||
|
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
|
||||||
|
|
||||||
|
# Determine if a file list is passed
|
||||||
|
if [ "$#" -eq 1 ]
|
||||||
|
then
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS='
|
||||||
|
'
|
||||||
|
SFILES="$1"
|
||||||
|
IFS=$oIFS
|
||||||
|
fi
|
||||||
|
SFILES=${SFILES:-$STAGED_FILES_CMD}
|
||||||
|
|
||||||
|
echo "Checking PHP Lint..."
|
||||||
|
for FILE in $SFILES
|
||||||
|
do
|
||||||
|
php -l -d display_errors=0 $PROJECT/$FILE
|
||||||
|
if [ $? != 0 ]
|
||||||
|
then
|
||||||
|
echo "Fix the error before commit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
FILES="$FILES $PROJECT/$FILE"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$FILES" != "" ]
|
||||||
|
then
|
||||||
|
echo "Running PHPCS Code Sniffer..."
|
||||||
|
#~/vendor/bin/phpcs --version
|
||||||
|
#phpcs --standard=PSR2 --encoding=utf-8 -n -p $FILES
|
||||||
|
# Check Dolibarr standard
|
||||||
|
~/vendor/bin/phpcs -s -p -d memory_limit=-1 --parallel=2 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||||
|
# Check your own standard
|
||||||
|
#~/vendor/bin/phpcs -s -p -d memory_limit=-1 --parallel=2 --extensions=php --colors --tab-width=4 --standard=htdocs/custom/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||||
|
|
||||||
|
if [ $? != 0 ]
|
||||||
|
then
|
||||||
|
# fix standard errors
|
||||||
|
~/vendor/bin/phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||||
|
#~/vendor/bin/phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=htdocs/custom/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true $FILES
|
||||||
|
echo "Fix the error before commit."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $?
|
||||||
21
dev/examples/zapier/.editorconfig
Normal file
21
dev/examples/zapier/.editorconfig
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# EditorConfig is awesome: https://editorconfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
|
[*.js]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = false
|
||||||
1
dev/examples/zapier/.gitignore
vendored
1
dev/examples/zapier/.gitignore
vendored
@ -5,3 +5,4 @@ node_modules
|
|||||||
.environment
|
.environment
|
||||||
.env
|
.env
|
||||||
.zapierapprc
|
.zapierapprc
|
||||||
|
package-lock.json
|
||||||
|
|||||||
68
dev/examples/zapier/README.md
Normal file
68
dev/examples/zapier/README.md
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# HOW TO BUILD
|
||||||
|
|
||||||
|
|
||||||
|
## ENABLE MODULE ZAPIER ON DOLIBARR
|
||||||
|
|
||||||
|
This should also enable the module API (required for authentication by Zapier service and to execute action in Dolibarr by Zapier).
|
||||||
|
|
||||||
|
Create the Dolibarr login that will be used by Zapier to call APIs. Give the login the permissions on the action you plan to automate.
|
||||||
|
|
||||||
|
|
||||||
|
## CREATE A ZAPIER DEVELOPPER ACCOUNT
|
||||||
|
|
||||||
|
At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/)
|
||||||
|
|
||||||
|
|
||||||
|
## INSTALL ZAPIER COMMAND LINE TOOLS WITH LINK TO ZAPIER ONLINE ACCOUNT
|
||||||
|
|
||||||
|
### Install Node.js
|
||||||
|
|
||||||
|
An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.
|
||||||
|
|
||||||
|
After installation, confirm that Node.js is ready to use:
|
||||||
|
`node --version`
|
||||||
|
|
||||||
|
### Install the Zapier CLI
|
||||||
|
|
||||||
|
Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:
|
||||||
|
|
||||||
|
`cd dev/examples/zapier`
|
||||||
|
|
||||||
|
`npm install -g zapier-platform-cli` to install the CLI globally
|
||||||
|
|
||||||
|
`zapier --version` to return version of the CLI
|
||||||
|
|
||||||
|
### Run Zapier Login
|
||||||
|
|
||||||
|
Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.
|
||||||
|
|
||||||
|
`zapier login`
|
||||||
|
|
||||||
|
This command will set up a .zapierrc file in your home directory.
|
||||||
|
|
||||||
|
### Install the Project
|
||||||
|
|
||||||
|
In zapier example directory, run:
|
||||||
|
|
||||||
|
`cd dev/examples/zapier`
|
||||||
|
|
||||||
|
`npm install`
|
||||||
|
|
||||||
|
### Deploying your App
|
||||||
|
|
||||||
|
Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.
|
||||||
|
|
||||||
|
`zapier register` (the first time, choose name for example "Dolibarr")
|
||||||
|
|
||||||
|
`zapier push`
|
||||||
|
|
||||||
|
After a push, the Application, with the name you defined during the register step, is available when creating a Zap.
|
||||||
|
|
||||||
|
You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction)
|
||||||
|
|
||||||
|
|
||||||
|
### Create a Zap
|
||||||
|
|
||||||
|
Create a ZAP that use the application you registered.
|
||||||
|
For authentication, you must enter the login / pass of account used by Zapier to call APIs.
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
/*jshint esversion: 6 */
|
/*jshint esversion: 6 */
|
||||||
const testAuth = (z , bundle) => {
|
const test = (z , bundle) => {
|
||||||
const url = bundle.authData.url+'/api/index.php/login';
|
const url = bundle.authData.url+'/api/index.php/status';
|
||||||
// Normally you want to make a request to an endpoint that is either specifically designed to test auth, or one that
|
// Normally you want to make a request to an endpoint that is either specifically designed to test auth, or one that
|
||||||
// every user will have access to, such as an account or profile endpoint like /me.
|
// every user will have access to, such as an account or profile endpoint like /me.
|
||||||
// In this example, we'll hit httpbin, which validates the Authorization Header against the arguments passed in the URL path
|
// In this example, we'll hit httpbin, which validates the Authorization Header against the arguments passed in the URL path
|
||||||
@ -11,67 +11,92 @@ const testAuth = (z , bundle) => {
|
|||||||
// This method can return any truthy value to indicate the credentials are valid.
|
// This method can return any truthy value to indicate the credentials are valid.
|
||||||
// Raise an error to show
|
// Raise an error to show
|
||||||
return promise.then((response) => {
|
return promise.then((response) => {
|
||||||
if (response.status === 401) {
|
if (response.status === 400) {
|
||||||
throw new Error('The Session Key you supplied is invalid');
|
throw new Error('400 -The Session Key you supplied is invalid');
|
||||||
|
}
|
||||||
|
if (response.status === 403) {
|
||||||
|
throw new Error('403 -The Session Key you supplied is invalid');
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSessionKey = (z, bundle) => {
|
// To include the session key header on all outbound requests, simply define a function here.
|
||||||
|
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
||||||
|
const includeSessionKeyHeader = (request, z, bundle) => {
|
||||||
|
if (bundle.authData.sessionKey) {
|
||||||
|
request.headers = request.headers || {};
|
||||||
|
request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
||||||
|
}
|
||||||
|
return request;
|
||||||
|
};
|
||||||
|
|
||||||
|
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
||||||
|
const sessionRefreshIf401 = (response, z, bundle) => {
|
||||||
|
if (bundle.authData.sessionKey) {
|
||||||
|
if (response.status === 401) {
|
||||||
|
throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSessionKey = async (z, bundle) => {
|
||||||
const url = bundle.authData.url + '/api/index.php/login';
|
const url = bundle.authData.url + '/api/index.php/login';
|
||||||
|
|
||||||
const promise = z.request({
|
const response = await z.request({
|
||||||
method: 'POST',
|
|
||||||
url: url,
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
body: {
|
body: {
|
||||||
login: bundle.authData.login,
|
login: bundle.authData.login,
|
||||||
password: bundle.authData.password,
|
password: bundle.authData.password,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return promise.then((response) => {
|
// if (response.status === 401) {
|
||||||
if (response.status === 401) {
|
// throw new Error('The login/password you supplied is invalid');
|
||||||
throw new Error('The login/password you supplied is invalid');
|
// }
|
||||||
}
|
const json = JSON.parse(response.content);
|
||||||
const json = JSON.parse(response.content);
|
return {
|
||||||
return {
|
sessionKey: json.success.token || '',
|
||||||
sessionKey: json.success.token || 'secret'
|
};
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
type: 'session',
|
config: {
|
||||||
// Define any auth fields your app requires here. The user will be prompted to enter this info when
|
type: 'session',
|
||||||
// they connect their account.
|
sessionConfig: {
|
||||||
fields: [
|
perform: getSessionKey
|
||||||
{
|
|
||||||
key: 'url',
|
|
||||||
label: 'Url of service',
|
|
||||||
required: true,
|
|
||||||
type: 'string'
|
|
||||||
},
|
},
|
||||||
{
|
// Define any auth fields your app requires here. The user will be prompted to enter this info when
|
||||||
key: 'login',
|
// they connect their account.
|
||||||
label: 'Login',
|
fields: [
|
||||||
required: true,
|
{
|
||||||
type: 'string'
|
key: 'url',
|
||||||
},
|
label: 'Url of service without trailing-slash',
|
||||||
{
|
required: true,
|
||||||
key: 'password',
|
type: 'string'
|
||||||
label: 'Password',
|
},
|
||||||
required: true,
|
{
|
||||||
type: 'password'
|
key: 'login',
|
||||||
}
|
label: 'Login',
|
||||||
],
|
required: true,
|
||||||
// The test method allows Zapier to verify that the credentials a user provides are valid. We'll execute this
|
type: 'string'
|
||||||
// method whenever a user connects their account for the first time.
|
},
|
||||||
test: testAuth,
|
{
|
||||||
// The method that will exchange the fields provided by the user for session credentials.
|
key: 'password',
|
||||||
sessionConfig: {
|
label: 'Password',
|
||||||
perform: getSessionKey
|
required: true,
|
||||||
|
type: 'password'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// The test method allows Zapier to verify that the credentials a user provides are valid. We'll execute this
|
||||||
|
// method whenever a user connects their account for the first time.
|
||||||
|
test,
|
||||||
|
// The method that will exchange the fields provided by the user for session credentials.
|
||||||
|
// assuming "login" is a key returned from the test
|
||||||
|
connectionLabel: '{{login}}'
|
||||||
},
|
},
|
||||||
// assuming "login" is a key returned from the test
|
befores: [includeSessionKeyHeader],
|
||||||
connectionLabel: '{{login}}'
|
afters: [sessionRefreshIf401],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -72,7 +72,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'name_alias', label: 'Name alias'},
|
{key: 'name_alias', label: 'Name alias'},
|
||||||
{key: 'address', label: 'Address'},
|
{key: 'address', label: 'Address'},
|
||||||
@ -81,8 +81,8 @@ module.exports = {
|
|||||||
{key: 'phone', label: 'Phone'},
|
{key: 'phone', label: 'Phone'},
|
||||||
{key: 'fax', label: 'Fax'},
|
{key: 'fax', label: 'Fax'},
|
||||||
{key: 'email', label: 'Email'},
|
{key: 'email', label: 'Email'},
|
||||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
{key: 'client', type: "integer", label: 'Customer/Prospect 0/1/2/3'},
|
||||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
{key: 'fournisseur', type: "integer", label: 'Supplier 0/1'},
|
||||||
{key: 'code_client', label: 'Customer code'},
|
{key: 'code_client', label: 'Customer code'},
|
||||||
{key: 'code_fournisseur', label: 'Supplier code'}
|
{key: 'code_fournisseur', label: 'Supplier code'}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,33 +1,39 @@
|
|||||||
/*jshint esversion: 6 */
|
/*jshint esversion: 6 */
|
||||||
const triggerThirdparty = require('./triggers/thirdparty');
|
|
||||||
const triggerOrder = require('./triggers/order');
|
|
||||||
const triggerAction = require('./triggers/action');
|
const triggerAction = require('./triggers/action');
|
||||||
|
const triggerOrder = require('./triggers/order');
|
||||||
|
const triggerThirdparty = require('./triggers/thirdparty');
|
||||||
|
const triggerTicket = require('./triggers/ticket');
|
||||||
|
const triggerUser = require('./triggers/user');
|
||||||
|
|
||||||
const searchThirdparty = require('./searches/thirdparty');
|
const searchThirdparty = require('./searches/thirdparty');
|
||||||
|
|
||||||
const createThirdparty = require('./creates/thirdparty');
|
const createThirdparty = require('./creates/thirdparty');
|
||||||
|
|
||||||
const authentication = require('./authentication');
|
const {
|
||||||
|
config: authentication,
|
||||||
|
befores = [],
|
||||||
|
afters = [],
|
||||||
|
} = require('./authentication');
|
||||||
|
|
||||||
// To include the session key header on all outbound requests, simply define a function here.
|
// To include the session key header on all outbound requests, simply define a function here.
|
||||||
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
||||||
const includeSessionKeyHeader = (request, z, bundle) => {
|
// const includeSessionKeyHeader = (request, z, bundle) => {
|
||||||
if (bundle.authData.sessionKey) {
|
// if (bundle.authData.sessionKey) {
|
||||||
request.headers = request.headers || {};
|
// request.headers = request.headers || {};
|
||||||
request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
// request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
||||||
}
|
// }
|
||||||
return request;
|
// return request;
|
||||||
};
|
// };
|
||||||
|
|
||||||
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
||||||
const sessionRefreshIf401 = (response, z, bundle) => {
|
// const sessionRefreshIf401 = (response, z, bundle) => {
|
||||||
if (bundle.authData.sessionKey) {
|
// if (bundle.authData.sessionKey) {
|
||||||
if (response.status === 401) {
|
// if (response.status === 401) {
|
||||||
throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
// throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return response;
|
// return response;
|
||||||
};
|
// };
|
||||||
|
|
||||||
// We can roll up all our behaviors in an App.
|
// We can roll up all our behaviors in an App.
|
||||||
const App = {
|
const App = {
|
||||||
@ -40,11 +46,11 @@ const App = {
|
|||||||
|
|
||||||
// beforeRequest & afterResponse are optional hooks into the provided HTTP client
|
// beforeRequest & afterResponse are optional hooks into the provided HTTP client
|
||||||
beforeRequest: [
|
beforeRequest: [
|
||||||
includeSessionKeyHeader
|
...befores
|
||||||
],
|
],
|
||||||
|
|
||||||
afterResponse: [
|
afterResponse: [
|
||||||
sessionRefreshIf401
|
...afters
|
||||||
],
|
],
|
||||||
|
|
||||||
// If you want to define optional resources to simplify creation of triggers, searches, creates - do that here!
|
// If you want to define optional resources to simplify creation of triggers, searches, creates - do that here!
|
||||||
@ -53,9 +59,11 @@ const App = {
|
|||||||
|
|
||||||
// If you want your trigger to show up, you better include it here!
|
// If you want your trigger to show up, you better include it here!
|
||||||
triggers: {
|
triggers: {
|
||||||
[triggerThirdparty.key]: triggerThirdparty,
|
[triggerAction.key]: triggerAction,
|
||||||
[triggerOrder.key]: triggerOrder,
|
[triggerOrder.key]: triggerOrder,
|
||||||
[triggerAction.key]: triggerAction
|
[triggerThirdparty.key]: triggerThirdparty,
|
||||||
|
[triggerTicket.key]: triggerTicket,
|
||||||
|
[triggerUser.key]: triggerUser,
|
||||||
},
|
},
|
||||||
|
|
||||||
// If you want your searches to show up, you better include it here!
|
// If you want your searches to show up, you better include it here!
|
||||||
|
|||||||
405
dev/examples/zapier/package-lock.json
generated
405
dev/examples/zapier/package-lock.json
generated
@ -1,405 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Dolibarr",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": {
|
|
||||||
"version": "8.10.20",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz",
|
|
||||||
"integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"balanced-match": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"bluebird": {
|
|
||||||
"version": "3.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
|
|
||||||
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
|
|
||||||
},
|
|
||||||
"brace-expansion": {
|
|
||||||
"version": "1.1.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"balanced-match": "^1.0.0",
|
|
||||||
"concat-map": "0.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"browser-stdout": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"combined-stream": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
|
|
||||||
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
|
|
||||||
"requires": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"commander": {
|
|
||||||
"version": "2.15.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
|
|
||||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"concat-map": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"content-disposition": {
|
|
||||||
"version": "0.5.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
|
|
||||||
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
|
||||||
},
|
|
||||||
"diff": {
|
|
||||||
"version": "3.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
|
||||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"dotenv": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow=="
|
|
||||||
},
|
|
||||||
"encoding": {
|
|
||||||
"version": "0.1.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
|
|
||||||
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
|
|
||||||
"requires": {
|
|
||||||
"iconv-lite": "~0.4.13"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"escape-string-regexp": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"form-data": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
|
|
||||||
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "1.0.6",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fs.realpath": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"glob": {
|
|
||||||
"version": "7.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
|
||||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fs.realpath": "^1.0.0",
|
|
||||||
"inflight": "^1.0.4",
|
|
||||||
"inherits": "2",
|
|
||||||
"minimatch": "^3.0.4",
|
|
||||||
"once": "^1.3.0",
|
|
||||||
"path-is-absolute": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"growl": {
|
|
||||||
"version": "1.10.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
|
|
||||||
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"has-flag": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
|
||||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"he": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.4.24",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inflight": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
|
||||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"once": "^1.3.0",
|
|
||||||
"wrappy": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inherits": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
|
||||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"is-stream": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
|
||||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
|
||||||
},
|
|
||||||
"json-tryparse": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/json-tryparse/-/json-tryparse-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-Khy6CLTjEjNo+p+2o01GQwBFeyc="
|
|
||||||
},
|
|
||||||
"jsonschema": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-PO3o4+QR03eHLu+8n98mODy8Ptk="
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
|
||||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
|
||||||
"version": "1.38.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
|
|
||||||
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg=="
|
|
||||||
},
|
|
||||||
"mime-types": {
|
|
||||||
"version": "2.1.22",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
|
|
||||||
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
|
|
||||||
"requires": {
|
|
||||||
"mime-db": "~1.38.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"minimatch": {
|
|
||||||
"version": "3.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"brace-expansion": "^1.1.7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"minimist": {
|
|
||||||
"version": "0.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"mkdirp": {
|
|
||||||
"version": "0.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
|
||||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"minimist": "0.0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mocha": {
|
|
||||||
"version": "5.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
|
|
||||||
"integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"browser-stdout": "1.3.1",
|
|
||||||
"commander": "2.15.1",
|
|
||||||
"debug": "3.1.0",
|
|
||||||
"diff": "3.5.0",
|
|
||||||
"escape-string-regexp": "1.0.5",
|
|
||||||
"glob": "7.1.2",
|
|
||||||
"growl": "1.10.5",
|
|
||||||
"he": "1.1.1",
|
|
||||||
"minimatch": "3.0.4",
|
|
||||||
"mkdirp": "0.5.1",
|
|
||||||
"supports-color": "5.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
|
||||||
"version": "1.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz",
|
|
||||||
"integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ==",
|
|
||||||
"requires": {
|
|
||||||
"encoding": "^0.1.11",
|
|
||||||
"is-stream": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth-sign": {
|
|
||||||
"version": "0.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
|
||||||
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
|
|
||||||
},
|
|
||||||
"once": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
|
||||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"wrappy": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"path-is-absolute": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"safer-buffer": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
||||||
},
|
|
||||||
"semver": {
|
|
||||||
"version": "5.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
|
||||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
|
|
||||||
},
|
|
||||||
"should": {
|
|
||||||
"version": "13.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz",
|
|
||||||
"integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-equal": "^2.0.0",
|
|
||||||
"should-format": "^3.0.3",
|
|
||||||
"should-type": "^1.4.0",
|
|
||||||
"should-type-adaptors": "^1.0.1",
|
|
||||||
"should-util": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-equal": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-format": {
|
|
||||||
"version": "3.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz",
|
|
||||||
"integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.3.0",
|
|
||||||
"should-type-adaptors": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-type": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz",
|
|
||||||
"integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"should-type-adaptors": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.3.0",
|
|
||||||
"should-util": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-util": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"supports-color": {
|
|
||||||
"version": "5.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
|
|
||||||
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"has-flag": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wrappy": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"zapier-platform-core": {
|
|
||||||
"version": "8.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/zapier-platform-core/-/zapier-platform-core-8.0.1.tgz",
|
|
||||||
"integrity": "sha512-vuAe7JkFQ88AeQ//NwwNEh8ZjiZr30GRWtwYo7Wo/nx1cqZwq+CRc9zJU2WRrhJfJOtOOTUF6w+pArBTtMOC5A==",
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "8.10.20",
|
|
||||||
"bluebird": "3.5.0",
|
|
||||||
"content-disposition": "0.5.2",
|
|
||||||
"dotenv": "5.0.1",
|
|
||||||
"form-data": "2.3.2",
|
|
||||||
"lodash": "4.17.11",
|
|
||||||
"node-fetch": "1.7.1",
|
|
||||||
"oauth-sign": "0.9.0",
|
|
||||||
"semver": "5.6.0",
|
|
||||||
"zapier-platform-schema": "8.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zapier-platform-schema": {
|
|
||||||
"version": "8.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/zapier-platform-schema/-/zapier-platform-schema-8.0.1.tgz",
|
|
||||||
"integrity": "sha512-97KJ0xVLtpU4BiXVaMTPQpiA0T6CQIEzWfzAWwJAWbu5336+6DMFUzDWN4bANBeD3CIsRHHPcZkP8n/17U05ag==",
|
|
||||||
"requires": {
|
|
||||||
"jsonschema": "1.1.1",
|
|
||||||
"lodash": "4.17.10"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
|
||||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Dolibarr",
|
"name": "dolibarr",
|
||||||
"version": "1.0.0",
|
"version": "1.13.0",
|
||||||
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
||||||
"repository": "Dolibarr/dolibarr",
|
"repository": "Dolibarr/dolibarr",
|
||||||
"homepage": "https://www.dolibarr.fr/",
|
"homepage": "https://www.dolibarr.org/",
|
||||||
"author": "Frédéric France <frederic.france@netlogic.fr>",
|
"author": "Frédéric France <frederic.france@netlogic.fr>",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"npm": ">=5.6.0"
|
"npm": ">=5.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"zapier-platform-core": "8.0.1"
|
"zapier-platform-core": "10.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
|||||||
@ -54,13 +54,20 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{
|
||||||
{key: 'createdAt', label: 'Created At'},
|
key: 'id',
|
||||||
|
type: "integer",
|
||||||
|
label: 'ID'
|
||||||
|
},
|
||||||
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'firstname', label: 'Firstname'},
|
{key: 'firstname', label: 'Firstname'},
|
||||||
{key: 'directions', label: 'Directions'},
|
{key: 'directions', label: 'Directions'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'style', label: 'Style'}
|
{
|
||||||
|
key: 'style',
|
||||||
|
label: 'Style'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,14 +10,14 @@ const subscribeHook = (z, bundle) => {
|
|||||||
action: bundle.inputData.action
|
action: bundle.inputData.action
|
||||||
};
|
};
|
||||||
|
|
||||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||||
|
|
||||||
// You can build requests and our client will helpfully inject all the variables
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
// you need to complete. You can also register middleware to control this.
|
// you need to complete. You can also register middleware to control this.
|
||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
|||||||
// You can build requests and our client will helpfully inject all the variables
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
// you need to complete. You can also register middleware to control this.
|
// you need to complete. You can also register middleware to control this.
|
||||||
const options = {
|
const options = {
|
||||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ const getFallbackRealAction = (z, bundle) => {
|
|||||||
// For the test poll, you should get some real data, to aid the setup process.
|
// For the test poll, you should get some real data, to aid the setup process.
|
||||||
const module = bundle.inputData.module;
|
const module = bundle.inputData.module;
|
||||||
const options = {
|
const options = {
|
||||||
url: bundle.authData.url + '/api/index.php/agendaevents/0',
|
url: bundle.authData.url + '/api/index.php/agendaevents/0',
|
||||||
};
|
};
|
||||||
|
|
||||||
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||||
@ -100,7 +100,7 @@ module.exports = {
|
|||||||
noun: 'Action',
|
noun: 'Action',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Agenda',
|
label: 'New Agenda',
|
||||||
description: 'Trigger when a new agenda with action is done in Dolibarr.'
|
description: 'Triggers when a new agenda with action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -111,6 +111,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of agenda this should trigger on.',
|
helpText: 'Which action of agenda this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -145,12 +146,33 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{
|
||||||
{key: 'createdAt', label: 'Created At'},
|
key: 'id',
|
||||||
{key: 'name', label: 'Name'},
|
type: "integer",
|
||||||
{key: 'usertodo__name', label: 'UserToDo Name'},
|
label: 'ID'
|
||||||
{key: 'authorId', label: 'Author ID'},
|
},
|
||||||
{key: 'action', label: 'Action'}
|
{
|
||||||
|
key: 'createdAt',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Created At'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
label: 'Name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'usertodo__name',
|
||||||
|
label: 'UserToDo Name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'authorId',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Author ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
label: 'Action'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const subscribeHook = (z, bundle) => {
|
|||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -90,7 +90,7 @@ module.exports = {
|
|||||||
noun: 'Order',
|
noun: 'Order',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Order',
|
label: 'New Order',
|
||||||
description: 'Trigger when a new order with action is done in Dolibarr.'
|
description: 'Triggers when a new order with action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -101,6 +101,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of order this should trigger on.',
|
helpText: 'Which action of order this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -136,11 +137,11 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'createdAt', label: 'Created At'},
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'directions', label: 'Directions'},
|
{key: 'directions', label: 'Directions'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'module', label: 'Module'},
|
{key: 'module', label: 'Module'},
|
||||||
{key: 'action', label: 'Action'}
|
{key: 'action', label: 'Action'}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const subscribeHook = (z, bundle) => {
|
|||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -112,7 +112,7 @@ module.exports = {
|
|||||||
noun: 'Thirdparty',
|
noun: 'Thirdparty',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Thirdparty',
|
label: 'New Thirdparty',
|
||||||
description: 'Trigger when a new thirdpaty action is done in Dolibarr.'
|
description: 'Triggers when a new thirdpaty action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -123,6 +123,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of thirdparty this should trigger on.',
|
helpText: 'Which action of thirdparty this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -159,12 +160,12 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'createdAt', label: 'Created At'},
|
{key: 'createdAt', label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'name_alias', label: 'Name alias'},
|
{key: 'name_alias', label: 'Name alias'},
|
||||||
{key: 'firstname', label: 'Firstame'},
|
{key: 'firstname', label: 'Firstname'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'action', label: 'Action'},
|
{key: 'action', label: 'Action'},
|
||||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
||||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
{key: 'fournisseur', label: 'Supplier 0/1'},
|
||||||
|
|||||||
237
dev/examples/zapier/triggers/ticket.js
Normal file
237
dev/examples/zapier/triggers/ticket.js
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
const subscribeHook = (z, bundle) => {
|
||||||
|
// `z.console.log()` is similar to `console.log()`.
|
||||||
|
z.console.log('suscribing hook!');
|
||||||
|
|
||||||
|
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||||
|
const data = {
|
||||||
|
url: bundle.targetUrl,
|
||||||
|
event: bundle.event,
|
||||||
|
module: 'ticket',
|
||||||
|
action: bundle.inputData.action
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
|
body: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsubscribeHook = (z, bundle) => {
|
||||||
|
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||||
|
// request made initially.
|
||||||
|
z.console.log('unsuscribing hook!');
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||||
|
method: 'DELETE',
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTicket = (z, bundle) => {
|
||||||
|
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||||
|
// test poll) and also a .querystring property with the URL's query string.
|
||||||
|
const ticket = {
|
||||||
|
id: bundle.cleanedRequest.id,
|
||||||
|
track_id: bundle.cleanedRequest.track_id,
|
||||||
|
subject: bundle.cleanedRequest.subject,
|
||||||
|
message: bundle.cleanedRequest.message,
|
||||||
|
lastname: bundle.cleanedRequest.lastname,
|
||||||
|
firstname: bundle.cleanedRequest.firstname,
|
||||||
|
address: bundle.cleanedRequest.address,
|
||||||
|
zip: bundle.cleanedRequest.zip,
|
||||||
|
town: bundle.cleanedRequest.town,
|
||||||
|
email_from: bundle.cleanedRequest.email_from,
|
||||||
|
login: bundle.cleanedRequest.login,
|
||||||
|
authorId: bundle.cleanedRequest.authorId,
|
||||||
|
createdAt: bundle.cleanedRequest.createdAt,
|
||||||
|
action: bundle.cleanedRequest.action
|
||||||
|
};
|
||||||
|
|
||||||
|
return [ticket];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFallbackRealTicket = (z, bundle) => {
|
||||||
|
// For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
const module = bundle.inputData.module;
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/tickets/0',
|
||||||
|
};
|
||||||
|
|
||||||
|
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// const getModulesChoices = (z/*, bundle*/) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const options = {
|
||||||
|
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
// const getModulesChoices = () => {
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// orders: "Order",
|
||||||
|
// invoices: "Invoice",
|
||||||
|
// thirdparties: "Thirdparty",
|
||||||
|
// users: "User",
|
||||||
|
// tickets: "Ticket",
|
||||||
|
// contacts: "Contacts"
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const getActionsChoices = (z, bundle) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const module = bundle.inputData.module;
|
||||||
|
// const options = {
|
||||||
|
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
|
||||||
|
// We recommend writing your triggers separate like this and rolling them
|
||||||
|
// into the App definition at the end.
|
||||||
|
module.exports = {
|
||||||
|
key: 'ticket',
|
||||||
|
|
||||||
|
// You'll want to provide some helpful display labels and descriptions
|
||||||
|
// for tickets. Zapier will put them into the UX.
|
||||||
|
noun: 'Ticket',
|
||||||
|
display: {
|
||||||
|
label: 'New Ticket',
|
||||||
|
description: 'Triggers when a new ticket action is done in Dolibarr.'
|
||||||
|
},
|
||||||
|
|
||||||
|
// `operation` is where the business logic goes.
|
||||||
|
operation: {
|
||||||
|
|
||||||
|
// `inputFields` can define the fields a ticket could provide,
|
||||||
|
// we'll pass them in as `bundle.inputData` later.
|
||||||
|
inputFields: [
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
helpText: 'Which action of ticket this should trigger on.',
|
||||||
|
choices: {
|
||||||
|
create: "Create",
|
||||||
|
modify: "Modify",
|
||||||
|
validate: "Validate",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
type: 'hook',
|
||||||
|
|
||||||
|
performSubscribe: subscribeHook,
|
||||||
|
performUnsubscribe: unsubscribeHook,
|
||||||
|
|
||||||
|
perform: getTicket,
|
||||||
|
performList: getFallbackRealTicket,
|
||||||
|
|
||||||
|
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||||
|
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||||
|
// returned records, and have obviously dummy values that we can show to any user.
|
||||||
|
sample: {
|
||||||
|
id: 1,
|
||||||
|
track_id: 'Xaz123er',
|
||||||
|
subject: 'Subject',
|
||||||
|
message: 'Message',
|
||||||
|
createdAt: 1472069465,
|
||||||
|
lastname: 'DOE',
|
||||||
|
firstname: 'John',
|
||||||
|
email: 'john@doe.com',
|
||||||
|
address: 'Park Avenue',
|
||||||
|
zip: '12345',
|
||||||
|
town: 'NEW-YORK',
|
||||||
|
email_from: 'doe.john@example;com',
|
||||||
|
authorId: 1,
|
||||||
|
action: 'create'
|
||||||
|
},
|
||||||
|
|
||||||
|
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||||
|
// field definitions. The result will be used to augment the sample.
|
||||||
|
// outputFields: () => { return []; }
|
||||||
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
|
outputFields: [
|
||||||
|
{
|
||||||
|
key: 'id',
|
||||||
|
type: "integer",
|
||||||
|
label: 'ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'track_id',
|
||||||
|
type: "string",
|
||||||
|
label: 'TrackID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'subject',
|
||||||
|
type: "string",
|
||||||
|
label: 'Subject'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'message',
|
||||||
|
type: "string",
|
||||||
|
label: 'Message'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'createdAt',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Created At'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'lastname',
|
||||||
|
label: 'Lastname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'firstname',
|
||||||
|
label: 'Firstname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'email',
|
||||||
|
label: 'Email'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'address',
|
||||||
|
label: 'Address'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'zip',
|
||||||
|
label: 'Zip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'town',
|
||||||
|
label: 'Town'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'email_from',
|
||||||
|
type: 'string',
|
||||||
|
label: 'Email from'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'authorId',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Author ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
type: 'string',
|
||||||
|
label: 'Action'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
177
dev/examples/zapier/triggers/user.js
Normal file
177
dev/examples/zapier/triggers/user.js
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
const subscribeHook = (z, bundle) => {
|
||||||
|
// `z.console.log()` is similar to `console.log()`.
|
||||||
|
z.console.log('suscribing hook!');
|
||||||
|
|
||||||
|
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||||
|
const data = {
|
||||||
|
url: bundle.targetUrl,
|
||||||
|
event: bundle.event,
|
||||||
|
module: 'user',
|
||||||
|
action: bundle.inputData.action
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
|
body: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsubscribeHook = (z, bundle) => {
|
||||||
|
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||||
|
// request made initially.
|
||||||
|
z.console.log('unsuscribing hook!');
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||||
|
method: 'DELETE',
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const getUser = (z, bundle) => {
|
||||||
|
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||||
|
// test poll) and also a .querystring property with the URL's query string.
|
||||||
|
const user = {
|
||||||
|
id: bundle.cleanedRequest.id,
|
||||||
|
lastname: bundle.cleanedRequest.lastname,
|
||||||
|
firstname: bundle.cleanedRequest.firstname,
|
||||||
|
address: bundle.cleanedRequest.address,
|
||||||
|
zip: bundle.cleanedRequest.zip,
|
||||||
|
town: bundle.cleanedRequest.town,
|
||||||
|
email: bundle.cleanedRequest.email,
|
||||||
|
login: bundle.cleanedRequest.login,
|
||||||
|
authorId: bundle.cleanedRequest.authorId,
|
||||||
|
createdAt: bundle.cleanedRequest.createdAt,
|
||||||
|
action: bundle.cleanedRequest.action
|
||||||
|
};
|
||||||
|
|
||||||
|
return [user];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFallbackRealUser = (z, bundle) => {
|
||||||
|
// For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
const module = bundle.inputData.module;
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/users/0',
|
||||||
|
};
|
||||||
|
|
||||||
|
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// const getModulesChoices = (z/*, bundle*/) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const options = {
|
||||||
|
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
// const getModulesChoices = () => {
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// orders: "Order",
|
||||||
|
// invoices: "Invoice",
|
||||||
|
// thirdparties: "Thirdparty",
|
||||||
|
// users: "User",
|
||||||
|
// contacts: "Contacts"
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const getActionsChoices = (z, bundle) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const module = bundle.inputData.module;
|
||||||
|
// const options = {
|
||||||
|
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
|
||||||
|
// We recommend writing your triggers separate like this and rolling them
|
||||||
|
// into the App definition at the end.
|
||||||
|
module.exports = {
|
||||||
|
key: 'user',
|
||||||
|
|
||||||
|
// You'll want to provide some helpful display labels and descriptions
|
||||||
|
// for users. Zapier will put them into the UX.
|
||||||
|
noun: 'User',
|
||||||
|
display: {
|
||||||
|
label: 'New User',
|
||||||
|
description: 'Triggers when a new user action is done in Dolibarr.'
|
||||||
|
},
|
||||||
|
|
||||||
|
// `operation` is where the business logic goes.
|
||||||
|
operation: {
|
||||||
|
|
||||||
|
// `inputFields` can define the fields a user could provide,
|
||||||
|
// we'll pass them in as `bundle.inputData` later.
|
||||||
|
inputFields: [
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
helpText: 'Which action of user this should trigger on.',
|
||||||
|
choices: {
|
||||||
|
create: "Create",
|
||||||
|
modify: "Modify",
|
||||||
|
validate: "Validate",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
type: 'hook',
|
||||||
|
|
||||||
|
performSubscribe: subscribeHook,
|
||||||
|
performUnsubscribe: unsubscribeHook,
|
||||||
|
|
||||||
|
perform: getUser,
|
||||||
|
performList: getFallbackRealUser,
|
||||||
|
|
||||||
|
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||||
|
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||||
|
// returned records, and have obviously dummy values that we can show to any user.
|
||||||
|
sample: {
|
||||||
|
id: 1,
|
||||||
|
createdAt: 1472069465,
|
||||||
|
lastname: 'DOE',
|
||||||
|
firstname: 'John',
|
||||||
|
email: 'john@doe.com',
|
||||||
|
address: 'Park Avenue',
|
||||||
|
zip: '12345',
|
||||||
|
town: 'NEW-YORK',
|
||||||
|
login: 'doe.john',
|
||||||
|
authorId: 1,
|
||||||
|
action: 'create'
|
||||||
|
},
|
||||||
|
|
||||||
|
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||||
|
// field definitions. The result will be used to augment the sample.
|
||||||
|
// outputFields: () => { return []; }
|
||||||
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
|
outputFields: [
|
||||||
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
|
{key: 'lastname', label: 'Lastname'},
|
||||||
|
{key: 'firstname', label: 'Firstname'},
|
||||||
|
{key: 'email', label: 'Email'},
|
||||||
|
{key: 'address', label: 'Address'},
|
||||||
|
{key: 'zip', label: 'Zip'},
|
||||||
|
{key: 'town', label: 'Town'},
|
||||||
|
{key: 'login', label: 'Login'},
|
||||||
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
|
{key: 'action', label: 'Action'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -120,8 +120,8 @@ $sqls=array(
|
|||||||
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
|
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
|
||||||
),
|
),
|
||||||
'delivery'=>array(
|
'delivery'=>array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."livraisondet WHERE fk_livraison IN (select rowid FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__')",
|
"DELETE FROM ".MAIN_DB_PREFIX."deliverydet WHERE fk_delivery IN (select rowid FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__')",
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'",
|
"DELETE FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__'",
|
||||||
),
|
),
|
||||||
'contract'=>array(
|
'contract'=>array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))",
|
"DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))",
|
||||||
|
|||||||
@ -12,6 +12,11 @@ The script initdemo.sh will erase current database with data into mysqldump_doli
|
|||||||
Do a chmod 700 initdemo.sh
|
Do a chmod 700 initdemo.sh
|
||||||
then run ./initdemo.sh to launch Graphic User Interface.
|
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
|
*** Save demo
|
||||||
|
|
||||||
|
|||||||
@ -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' `
|
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" ]
|
if [ "x$documentdir" != "x" ]
|
||||||
then
|
then
|
||||||
$DIALOG --title "Reset document directory tpp" --clear \
|
$DIALOG --title "Reset document directory" --clear \
|
||||||
--inputbox "Delete and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
--inputbox "DELETE and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ then
|
|||||||
DIALOG="$DIALOG --ascii-lines"
|
DIALOG="$DIALOG --ascii-lines"
|
||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
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
|
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
|
||||||
valret=$?
|
valret=$?
|
||||||
case $valret in
|
case $valret in
|
||||||
@ -70,7 +70,7 @@ then
|
|||||||
DIALOG=${DIALOG=dialog}
|
DIALOG=${DIALOG=dialog}
|
||||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
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
|
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
@ -128,7 +128,7 @@ then
|
|||||||
|
|
||||||
# ---------------------------- confirmation
|
# ---------------------------- confirmation
|
||||||
DIALOG=${DIALOG=dialog}
|
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
|
--yesno "Do you confirm ? \n Mysql database : '$base' \n Mysql port : '$port' \n Demo login: '$demologin' \n Demo password : '$demopass'" 15 55
|
||||||
|
|
||||||
case $? in
|
case $? in
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
BIN
dev/resources/intracommreport/manuelDebXml1.2.pdf
Normal file
BIN
dev/resources/intracommreport/manuelDebXml1.2.pdf
Normal file
Binary file not shown.
139
dev/resources/intracommreport/schema_deb.xsd
Normal file
139
dev/resources/intracommreport/schema_deb.xsd
Normal 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>
|
||||||
@ -1,3 +1,7 @@
|
|||||||
|
Barcode EAN 13
|
||||||
|
|
||||||
|
FR
|
||||||
|
==
|
||||||
Signification des chiffres.
|
Signification des chiffres.
|
||||||
|
|
||||||
- 2 chiffres pour le code pays ou code systeme
|
- 2 chiffres pour le code pays ou code systeme
|
||||||
@ -9,6 +13,24 @@ Cette regle subit de nombreuses entorses pour ameliorer l'usage des chiffres dis
|
|||||||
Voici la liste des codes pays ou systeme :
|
Voici la liste des codes pays ou systeme :
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EN
|
||||||
|
==
|
||||||
|
Meaning of the numbers.
|
||||||
|
|
||||||
|
- 2 digits for the country code or system code
|
||||||
|
- 5 digits for the company identifier
|
||||||
|
- 5 digits for item identifier
|
||||||
|
- 1 digit for checksum
|
||||||
|
|
||||||
|
This rule has been twisted many times to improve the use of the available numbers.
|
||||||
|
Here is the list of country codes or system:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List
|
||||||
|
====
|
||||||
|
|
||||||
00 <20> 13 UCC (Etats-Unis et Canada)
|
00 <20> 13 UCC (Etats-Unis et Canada)
|
||||||
20 <20> 29 Codification interne en magasin
|
20 <20> 29 Codification interne en magasin
|
||||||
30 <20> 37 GENCOD-EAN France
|
30 <20> 37 GENCOD-EAN France
|
||||||
|
|||||||
2
dev/resources/iso-normes/company_ids.txt
Normal file
2
dev/resources/iso-normes/company_ids.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Spain https://incwell.eu/en/company-formation-spain/
|
||||||
|
France https://www.economie.gouv.fr/entreprises/numeros-identification-entreprise
|
||||||
@ -1,5 +1,6 @@
|
|||||||
* Page with license compatibility
|
* Page with license compatibility
|
||||||
https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
|
[EN] https://www.gnu.org/licenses/quick-guide-gplv3.en.html
|
||||||
|
[FR] https://www.gnu.org/licenses/quick-guide-gplv3.fr.html
|
||||||
|
|
||||||
* FAQ on GPL license
|
* FAQ on GPL license
|
||||||
https://www.fsf.org/licensing/licenses/gpl-faq.html
|
https://www.fsf.org/licensing/licenses/gpl-faq.html
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<exclude-pattern type="relative">build/html</exclude-pattern>
|
<exclude-pattern type="relative">build/html</exclude-pattern>
|
||||||
<exclude-pattern type="relative">build/aps</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">dev/initdata/dbf/includes</exclude-pattern>
|
||||||
<exclude-pattern type="relative">documents</exclude-pattern>
|
<exclude-pattern type="relative">documents</exclude-pattern>
|
||||||
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>
|
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>
|
||||||
@ -17,6 +17,7 @@
|
|||||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||||
|
<exclude-pattern type="relative">.git</exclude-pattern>
|
||||||
|
|
||||||
<!-- List of all tests -->
|
<!-- List of all tests -->
|
||||||
|
|
||||||
|
|||||||
@ -5,13 +5,13 @@ server {
|
|||||||
|
|
||||||
root /path/to/your/htdocs;
|
root /path/to/your/htdocs;
|
||||||
|
|
||||||
# Optionnal
|
# Optional
|
||||||
error_log /path/to/your/log/directory/nginx.error.log;
|
error_log /path/to/your/log/directory/nginx.error.log;
|
||||||
access_log /path/to/your/log/directory/nginx.access.log;
|
access_log /path/to/your/log/directory/nginx.access.log;
|
||||||
|
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
# Optionnal
|
# Optional
|
||||||
server_name your-fqdn.tld;
|
server_name your-fqdn.tld;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -23,6 +23,6 @@ server {
|
|||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_read_timeout 600;
|
fastcgi_read_timeout 600;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock; // /var/run/php/php7.0-fpm.sock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,9 @@ function faaa()
|
|||||||
return 'faaa';
|
return 'faaa';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Aaa
|
||||||
|
*/
|
||||||
class Aaa
|
class Aaa
|
||||||
{
|
{
|
||||||
const AAA='aaa';
|
const AAA='aaa';
|
||||||
@ -12,6 +12,9 @@ function fbbb()
|
|||||||
return 'fbbb';
|
return 'fbbb';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Bbb
|
||||||
|
*/
|
||||||
class Bbb
|
class Bbb
|
||||||
{
|
{
|
||||||
const BBB='bbb';
|
const BBB='bbb';
|
||||||
@ -2,13 +2,18 @@ README (English)
|
|||||||
--------------------------------
|
--------------------------------
|
||||||
This directory contains tools to generate translation files for a new
|
This directory contains tools to generate translation files for a new
|
||||||
languages or to update translation files for existing languages.
|
languages or to update translation files for existing languages.
|
||||||
|
|
||||||
See Dolibarr Wiki page:
|
See Dolibarr Wiki page:
|
||||||
https://wiki.dolibarr.org/index.php/Translator_documentation
|
https://wiki.dolibarr.org/index.php/Translator_documentation
|
||||||
For more information on how to use them.
|
For more information on how to use them.
|
||||||
|
|
||||||
for Linux OS:
|
Translation of Dolibarr Project at Transifex:
|
||||||
To install transifex client:
|
https://www.transifex.com/dolibarr-association/dolibarr/dashboard/
|
||||||
|
|
||||||
|
|
||||||
|
Installation of Transifex Client:
|
||||||
|
---------------------------------
|
||||||
|
for Linux OS
|
||||||
|
to install or to update transifex client:
|
||||||
sudo pip install --upgrade transifex-client
|
sudo pip install --upgrade transifex-client
|
||||||
|
|
||||||
To update transifex client:
|
|
||||||
sudo pip install --upgrade transifex-client
|
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
* \ingroup dev
|
* \ingroup dev
|
||||||
* \brief This script uses google language ajax api as the translator engine
|
* \brief This script uses google language ajax api as the translator engine
|
||||||
* The main translator function can be found at:
|
* The main translator function can be found at:
|
||||||
* http://code.google.com/intl/fr/apis/language/translate/overview.html
|
* defunct -http://code.google.com/intl/fr/apis/language/translate/overview.html-
|
||||||
* http://translate.google.com/translate_tools
|
* defunct -http://translate.google.com/translate_tools-
|
||||||
* https://code.google.com/apis/console
|
* https://code.google.com/apis/console
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ $dir=DOL_DOCUMENT_ROOT."/langs";
|
|||||||
if (! isset($argv[3])) {
|
if (! isset($argv[3])) {
|
||||||
print "Usage: ".$script_file." lang_code_src lang_code_dest|all APIKEY [langfile.lang]\n";
|
print "Usage: ".$script_file." lang_code_src lang_code_dest|all APIKEY [langfile.lang]\n";
|
||||||
print "Example: ".$script_file." en_US pt_PT 123456\n";
|
print "Example: ".$script_file." en_US pt_PT 123456\n";
|
||||||
print "Rem: lang_code to use can be found on http://www.google.com/language_tools\n";
|
print "Rem: lang_code to use can be found on https://translate.google.com\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
comparison of terms
|
|
||||||
|
|
||||||
|
|
||||||
Dolibarr SAP ERP Odoo
|
|
||||||
-------------------------------------------------------------------------
|
|
||||||
Thirdparty Contact partner Partner/Contact (company)
|
|
||||||
Contact/address Contact person Partner/Contact (individual)
|
|
||||||
|
|
||||||
Financial Finance (FI) Accounting
|
|
||||||
Accounting
|
|
||||||
|
|
||||||
|
|
||||||
Income / Expense ?? Profit / Loss
|
|
||||||
Balance ?? Net profit
|
|
||||||
Subledger account Subledger account ??
|
|
||||||
|
|
||||||
CRM Sales & Distribution Sales
|
|
||||||
Proposal ?? Quotation
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Proposal is ok but proposition looks better (proposal is for a detailed proposition).
|
|
||||||
We can say also "business proposition or business proposal".
|
|
||||||
In India they are using "Quotation".
|
|
||||||
|
|
||||||
BIN
doc/images/dolibarr_screenshot12_1920x1080.jpg
Normal file
BIN
doc/images/dolibarr_screenshot12_1920x1080.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
@ -6,18 +6,15 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
This directory contains several subdirectories with entries for
|
This directory contains several subdirectories with entries for informations on Dolibarr.<br>
|
||||||
informations on Dolibarr.<br>
|
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this on Internet on web following sites:<br>
|
||||||
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this
|
|
||||||
on Internet on web following sites:<br>
|
|
||||||
<br>
|
|
||||||
* <a href="https://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
|
||||||
<br>
|
<br>
|
||||||
* <a href="https://www.dolibarr.org">Dolibarr portal (official website)</a><br>
|
* <a href="https://www.dolibarr.org">Dolibarr portal (official website)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
* <a href="https://wiki.dolibarr.org">Dolibarr wiki (documentation)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||||
<br>
|
<br>
|
||||||
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
||||||
|
|
||||||
|
|||||||
@ -1,28 +1,29 @@
|
|||||||
README (deutsch / german / allemand)
|
README (deutsch / german / allemand)
|
||||||
--------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
------------------------------------
|
||||||
Download / Herunterladen
|
Download / Herunterladen
|
||||||
--------------------------------
|
------------------------------------
|
||||||
|
|
||||||
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
||||||
|
|
||||||
https://www.dolibarr.org/downloads
|
https://www.dolibarr.org/downloads
|
||||||
oder direkt von Sourceforge
|
|
||||||
|
oder direkt bei Sourceforge
|
||||||
|
|
||||||
https://sourceforge.net/projects/dolibarr/files/
|
https://sourceforge.net/projects/dolibarr/files/
|
||||||
|
|
||||||
herunterladen.
|
herunterladen.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Die meisten externen Module/Themens sind über den DoliStore verfügbar:
|
|
||||||
https://www.dolistore.com/de/
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Installation / Hilfe
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
--------------------------------
|
* Für eine kurze Einleitung schau in die README Datei im Hauptverzeichnis.
|
||||||
Installation
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
|
||||||
|
|
||||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||||
@ -31,3 +32,14 @@ Installation
|
|||||||
https://www.dolibarr.de/
|
https://www.dolibarr.de/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Zusatzmodule
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
* Die meisten externen Module/Themen sind über den offiziellen DoliStore verfügbar:
|
||||||
|
|
||||||
|
https://www.dolistore.com/de/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,14 @@ README (french)
|
|||||||
Téléchargement
|
Téléchargement
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
* Dolibarr ERP/CRM peut être téléchargé sur sourceforge:
|
||||||
http://sourceforge.net/projects/dolibarr/files
|
https://sourceforge.net/projects/dolibarr/files
|
||||||
or from Dolibarr official web site:
|
|
||||||
|
ou sur le site officiel de Dolibarr:
|
||||||
https://www.dolibarr.org
|
https://www.dolibarr.org
|
||||||
|
|
||||||
* Most external modules are only available on DoliStore:
|
* La plupart des modules externes ne sont disponibles que sur le DoliStore officiel:
|
||||||
https://www.dolistore.org
|
https://www.dolistore.com
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@ -24,4 +25,4 @@ README-FR à la racine.
|
|||||||
|
|
||||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||||
ligne sur le wiki de Dolibarr à l'adresse:
|
ligne sur le wiki de Dolibarr à l'adresse:
|
||||||
https://wiki.dolibarr.org
|
https://wiki.dolibarr.org/index.php/Accueil
|
||||||
|
|||||||
@ -49,32 +49,44 @@ $search_pcgtype = GETPOST('search_pcgtype', 'alpha');
|
|||||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0) accessforbidden();
|
if ($user->socid > 0) {
|
||||||
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->accounting->chartofaccount) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortfield) $sortfield = "aa.account_number";
|
if (!$sortfield) {
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
$sortfield = "aa.account_number";
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
'aa.labelshort'=>array('label'=>$langs->trans("LabelToShow"), 'checked'=>1),
|
'aa.labelshort'=>array('label'=>$langs->trans("LabelToShow"), 'checked'=>1),
|
||||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
||||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||||
'aa.reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1),
|
'aa.reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1),
|
||||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['aa.reconcilable']);
|
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
|
unset($arrayfields['aa.reconcilable']);
|
||||||
|
}
|
||||||
|
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
|
|
||||||
@ -84,46 +96,50 @@ $accounting = new AccountingAccount($db);
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; }
|
$action = 'list'; $massaction = '';
|
||||||
|
}
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha')) {
|
||||||
|
$massaction = '';
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
if (!empty($cancel)) {
|
||||||
if (!empty($cancel)) $action = '';
|
$action = '';
|
||||||
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||||
{
|
$search_account = "";
|
||||||
$search_account = "";
|
$search_label = "";
|
||||||
$search_label = "";
|
|
||||||
$search_labelshort = "";
|
$search_labelshort = "";
|
||||||
$search_accountparent = "";
|
$search_accountparent = "";
|
||||||
$search_pcgtype = "";
|
$search_pcgtype = "";
|
||||||
$search_array_options = array();
|
$search_array_options = array();
|
||||||
}
|
}
|
||||||
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|
||||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified
|
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified
|
||||||
{
|
if ($chartofaccounts > 0) {
|
||||||
if ($chartofaccounts > 0)
|
|
||||||
{
|
|
||||||
// Get language code for this $chartofaccounts
|
// Get language code for this $chartofaccounts
|
||||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
||||||
$sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
|
$sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$country_code = $obj->code;
|
$country_code = $obj->code;
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
// Try to load sql file
|
// Try to load sql file
|
||||||
if ($country_code)
|
if ($country_code) {
|
||||||
{
|
|
||||||
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
||||||
|
|
||||||
$offsetforchartofaccount = 0;
|
$offsetforchartofaccount = 0;
|
||||||
@ -131,50 +147,48 @@ if (empty($reshook))
|
|||||||
// and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
|
// and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
|
||||||
// This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
|
// This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
|
||||||
$tmp = file_get_contents($sqlfile);
|
$tmp = file_get_contents($sqlfile);
|
||||||
if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg))
|
if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg)) {
|
||||||
{
|
|
||||||
$offsetforchartofaccount += $reg[1];
|
$offsetforchartofaccount += $reg[1];
|
||||||
}
|
}
|
||||||
$offsetforchartofaccount += ($conf->entity * 100000000);
|
$offsetforchartofaccount += ($conf->entity * 100000000);
|
||||||
|
|
||||||
$result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount);
|
$result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount);
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs');
|
setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
|
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
if (!dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'disable') {
|
if ($action == 'disable') {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$mode = GETPOST('mode', 'int');
|
$mode = GETPOST('mode', 'int');
|
||||||
$result = $accounting->accountDeactivate($id, $mode);
|
$result = $accounting->accountDeactivate($id, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = 'update';
|
$action = 'update';
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||||
}
|
}
|
||||||
} elseif ($action == 'enable') {
|
} elseif ($action == 'enable') {
|
||||||
if ($accounting->fetch($id)) {
|
if ($accounting->fetch($id)) {
|
||||||
$mode = GETPOST('mode', 'int');
|
$mode = GETPOST('mode', 'int');
|
||||||
$result = $accounting->account_activate($id, $mode);
|
$result = $accounting->account_activate($id, $mode);
|
||||||
}
|
}
|
||||||
$action = 'update';
|
$action = 'update';
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -198,8 +212,11 @@ $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.a
|
|||||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = ".$conf->entity;
|
||||||
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
if ($db->type == 'pgsql') {
|
||||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
||||||
|
} else {
|
||||||
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = aa.account_parent AND a2.entity = ".$conf->entity;
|
||||||
|
}
|
||||||
$sql .= " WHERE asy.rowid = ".$pcgver;
|
$sql .= " WHERE asy.rowid = ".$pcgver;
|
||||||
//print $sql;
|
//print $sql;
|
||||||
if (strlen(trim($search_account))) {
|
if (strlen(trim($search_account))) {
|
||||||
@ -224,31 +241,38 @@ if (strlen(trim($search_account))) {
|
|||||||
$search_account_tmp_clean = $search_account_tmp;
|
$search_account_tmp_clean = $search_account_tmp;
|
||||||
$search_account_clean = $search_account;
|
$search_account_clean = $search_account;
|
||||||
$startchar = '%';
|
$startchar = '%';
|
||||||
if (strpos($search_account_tmp, '^') === 0)
|
if (strpos($search_account_tmp, '^') === 0) {
|
||||||
{
|
|
||||||
$startchar = '';
|
$startchar = '';
|
||||||
$search_account_tmp_clean = preg_replace('/^\^/', '', $search_account_tmp);
|
$search_account_tmp_clean = preg_replace('/^\^/', '', $search_account_tmp);
|
||||||
$search_account_clean = preg_replace('/^\^/', '', $search_account);
|
$search_account_clean = preg_replace('/^\^/', '', $search_account);
|
||||||
}
|
}
|
||||||
$sql .= " AND (aa.account_number LIKE '".$db->escape($startchar.$search_account_tmp_clean)."'";
|
$sql .= " AND (aa.account_number LIKE '".$db->escape($startchar.$search_account_tmp_clean)."'";
|
||||||
$sql .= " OR aa.account_number LIKE '".$db->escape($startchar.$search_account_clean)."%')";
|
$sql .= " OR aa.account_number LIKE '".$db->escape($startchar.$search_account_clean)."%')";
|
||||||
} else $sql .= natural_search("aa.account_number", $search_account_tmp);
|
} else {
|
||||||
|
$sql .= natural_search("aa.account_number", $search_account_tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
if (strlen(trim($search_label))) {
|
||||||
if (strlen(trim($search_labelshort))) $sql .= natural_search("aa.labelshort", $search_labelshort);
|
$sql .= natural_search("aa.label", $search_label);
|
||||||
if (strlen(trim($search_accountparent)) && $search_accountparent != '-1') $sql .= natural_search("aa.account_parent", $search_accountparent, 2);
|
}
|
||||||
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
if (strlen(trim($search_labelshort))) {
|
||||||
|
$sql .= natural_search("aa.labelshort", $search_labelshort);
|
||||||
|
}
|
||||||
|
if (strlen(trim($search_accountparent)) && $search_accountparent != '-1') {
|
||||||
|
$sql .= natural_search("aa.account_parent", $search_accountparent, 2);
|
||||||
|
}
|
||||||
|
if (strlen(trim($search_pcgtype))) {
|
||||||
|
$sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||||
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
{
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($resql);
|
$nbtotalofrecords = $db->num_rows($resql);
|
||||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
{
|
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -259,23 +283,37 @@ $sql .= $db->plimit($limit + 1, $offset);
|
|||||||
dol_syslog('accountancy/admin/account.php:: $sql='.$sql);
|
dol_syslog('accountancy/admin/account.php:: $sql='.$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($search_account) $param .= '&search_account='.urlencode($search_account);
|
}
|
||||||
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
if ($search_labelshort) $param .= '&search_labelshort='.urlencode($search_labelshort);
|
$param .= '&limit='.urlencode($limit);
|
||||||
if ($search_accountparent > 0 || $search_accountparent == '0') $param .= '&search_accountparent='.urlencode($search_accountparent);
|
}
|
||||||
if ($search_pcgtype) $param .= '&search_pcgtype='.urlencode($search_pcgtype);
|
if ($search_account) {
|
||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
$param .= '&search_account='.urlencode($search_account);
|
||||||
|
}
|
||||||
|
if ($search_label) {
|
||||||
|
$param .= '&search_label='.urlencode($search_label);
|
||||||
|
}
|
||||||
|
if ($search_labelshort) {
|
||||||
|
$param .= '&search_labelshort='.urlencode($search_labelshort);
|
||||||
|
}
|
||||||
|
if ($search_accountparent > 0 || $search_accountparent == '0') {
|
||||||
|
$param .= '&search_accountparent='.urlencode($search_accountparent);
|
||||||
|
}
|
||||||
|
if ($search_pcgtype) {
|
||||||
|
$param .= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||||
|
}
|
||||||
|
if ($optioncss != '') {
|
||||||
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax))
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
{
|
print '<!-- Add javascript to reload page when we click "Change plan" -->
|
||||||
print '<!-- Add javascript to reload page when we click "Change plan" -->
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#change_chart").on("click", function (e) {
|
$("#change_chart").on("click", function (e) {
|
||||||
@ -285,10 +323,12 @@ if ($resql)
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
@ -296,76 +336,108 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
|
$newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
|
||||||
|
|
||||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
// Box to select active chart of account
|
// Box to select active chart of account
|
||||||
print $langs->trans("Selectchartofaccounts")." : ";
|
print $langs->trans("Selectchartofaccounts")." : ";
|
||||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||||
$sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
|
$sql = "SELECT a.rowid, a.pcg_version, a.label, a.active, c.code as country_code";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_system as a";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_system as a";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country = c.rowid AND c.active = 1";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country = c.rowid AND c.active = 1";
|
||||||
$sql .= " WHERE a.active = 1";
|
$sql .= " WHERE a.active = 1";
|
||||||
dol_syslog('accountancy/admin/account.php $sql='.$sql);
|
dol_syslog('accountancy/admin/account.php $sql='.$sql);
|
||||||
print $sql;
|
print $sql;
|
||||||
$resqlchart = $db->query($sql);
|
$resqlchart = $db->query($sql);
|
||||||
if ($resqlchart) {
|
if ($resqlchart) {
|
||||||
$numbis = $db->num_rows($resqlchart);
|
$numbis = $db->num_rows($resqlchart);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $numbis) {
|
while ($i < $numbis) {
|
||||||
$obj = $db->fetch_object($resqlchart);
|
$obj = $db->fetch_object($resqlchart);
|
||||||
|
|
||||||
print '<option value="'.$obj->rowid.'"';
|
print '<option value="'.$obj->rowid.'"';
|
||||||
print ($pcgver == $obj->rowid) ? ' selected' : '';
|
print ($pcgver == $obj->rowid) ? ' selected' : '';
|
||||||
print '>'.$obj->pcg_version.' - '.$obj->label.' - ('.$obj->country_code.')</option>';
|
print '>'.$obj->pcg_version.' - '.$obj->label.' - ('.$obj->country_code.')</option>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
print "</select>";
|
dol_print_error($db);
|
||||||
print ajax_combobox("chartofaccounts");
|
}
|
||||||
print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
print "</select>";
|
||||||
|
print ajax_combobox("chartofaccounts");
|
||||||
|
print '<input type="'.(empty($conf->use_javascript_ajax) ? 'submit' : 'button').'" class="button" name="change_chart" id="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
$massactionbutton = '';
|
$massactionbutton = '';
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
// Line for search fields
|
// Line for search fields
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.'"></td>';
|
if (!empty($arrayfields['aa.account_number']['checked'])) {
|
||||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.'"></td>';
|
||||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
}
|
||||||
|
if (!empty($arrayfields['aa.label']['checked'])) {
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.'"></td>';
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['aa.labelshort']['checked'])) {
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
||||||
|
}
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
print '<td class="liste_titre"><input type="text" class="flat width100" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
}
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['aa.active']['checked'])) {
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['aa.account_number']['checked'])) {
|
||||||
if (!empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
|
}
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
|
if (!empty($arrayfields['aa.label']['checked'])) {
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']);
|
print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"], "aa.label", "", $param, '', $sortfield, $sortorder);
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder); }
|
}
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['aa.labelshort']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['aa.labelshort']['label'], $_SERVER["PHP_SELF"], "aa.labelshort", "", $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"], "aa.account_parent", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['aa.pcg_type']['label'], $_SERVER["PHP_SELF"], 'aa.pcg_type', '', $param, '', $sortfield, $sortorder, '', $arrayfields['aa.pcg_type']['help']);
|
||||||
|
}
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['aa.reconcilable']['label'], $_SERVER["PHP_SELF"], 'aa.reconcilable', '', $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['aa.active']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -374,8 +446,7 @@ if ($resql)
|
|||||||
|
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit)) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$accountstatic->id = $obj->rowid;
|
$accountstatic->id = $obj->rowid;
|
||||||
@ -385,64 +456,70 @@ if ($resql)
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
if (!empty($arrayfields['aa.account_number']['checked']))
|
if (!empty($arrayfields['aa.account_number']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $accountstatic->getNomUrl(1, 0, 0, '', 0, 1, 0, 'accountcard');
|
print $accountstatic->getNomUrl(1, 0, 0, '', 0, 1, 0, 'accountcard');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account label
|
// Account label
|
||||||
if (!empty($arrayfields['aa.label']['checked']))
|
if (!empty($arrayfields['aa.label']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->label;
|
print $obj->label;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account label to show (label short)
|
// Account label to show (label short)
|
||||||
if (!empty($arrayfields['aa.labelshort']['checked']))
|
if (!empty($arrayfields['aa.labelshort']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->labelshort;
|
print $obj->labelshort;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Account parent
|
// Account parent
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked']))
|
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||||
{
|
|
||||||
// Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table.
|
// Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table.
|
||||||
// So for orphans, obj->account_parent is set but not obj->rowid2
|
// So for orphans, obj->account_parent is set but not obj->rowid2
|
||||||
if (!empty($obj->account_parent) && !empty($obj->rowid2))
|
if (!empty($obj->account_parent) && !empty($obj->rowid2)) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print '<!-- obj->account_parent = '.$obj->account_parent.' obj->rowid2 = '.$obj->rowid2.' -->';
|
print '<!-- obj->account_parent = '.$obj->account_parent.' obj->rowid2 = '.$obj->rowid2.' -->';
|
||||||
$accountparent->id = $obj->rowid2;
|
$accountparent->id = $obj->rowid2;
|
||||||
$accountparent->label = $obj->label2;
|
$accountparent->label = $obj->label2;
|
||||||
$accountparent->account_number = $obj->account_number2; // Sotre an account number for output
|
$accountparent->account_number = $obj->account_number2; // Sotre an account number for output
|
||||||
print $accountparent->getNomUrl(1);
|
print $accountparent->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (!empty($obj->account_parent)) {
|
if (!empty($obj->account_parent)) {
|
||||||
print '<!-- Bad value for obj->account_parent = '.$obj->account_parent.': is a rowid that does not exists -->';
|
print '<!-- Bad value for obj->account_parent = '.$obj->account_parent.': is a rowid that does not exists -->';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
if (!empty($arrayfields['aa.pcg_type']['checked']))
|
if (!empty($arrayfields['aa.pcg_type']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->pcg_type;
|
print $obj->pcg_type;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
@ -466,8 +543,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Activated or not
|
// Activated or not
|
||||||
if (!empty($arrayfields['aa.active']['checked']))
|
if (!empty($arrayfields['aa.active']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if (empty($obj->active)) {
|
if (empty($obj->active)) {
|
||||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=0">';
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=0">';
|
||||||
@ -479,7 +555,9 @@ if ($resql)
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
@ -494,7 +572,9 @@ if ($resql)
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -39,7 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
if (!empty($conf->accounting->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "compta", "accountancy", "hrm"));
|
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "compta", "accountancy", "hrm"));
|
||||||
@ -62,7 +64,9 @@ $active = 1;
|
|||||||
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
$sortfield = GETPOST("sortfield", 'aZ09comma');
|
||||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -71,8 +75,12 @@ $search_country_id = GETPOST('search_country_id', 'int');
|
|||||||
|
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0) accessforbidden();
|
if ($user->socid > 0) {
|
||||||
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->accounting->chartofaccount) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
@ -139,14 +147,12 @@ $sourceList = array();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha'))
|
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
|
||||||
{
|
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
// Actions add or modify an entry into a dictionary
|
||||||
if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||||
{
|
|
||||||
$listfield = explode(',', str_replace(' ', '', $tabfield[$id]));
|
$listfield = explode(',', str_replace(' ', '', $tabfield[$id]));
|
||||||
$listfieldinsert = explode(',', $tabfieldinsert[$id]);
|
$listfieldinsert = explode(',', $tabfieldinsert[$id]);
|
||||||
$listfieldmodify = explode(',', $tabfieldinsert[$id]);
|
$listfieldmodify = explode(',', $tabfieldinsert[$id]);
|
||||||
@ -154,17 +160,21 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
|
|
||||||
// Check that all fields are filled
|
// Check that all fields are filled
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
foreach ($listfield as $f => $value)
|
foreach ($listfield as $f => $value) {
|
||||||
{
|
if ($value == 'country_id' && in_array($tablib[$id], array('Pcg_version'))) {
|
||||||
if ($value == 'country_id' && in_array($tablib[$id], array('Pcg_version'))) continue; // For some pages, country is not mandatory
|
continue; // For some pages, country is not mandatory
|
||||||
if ((!GETPOSTISSET($value)) || GETPOST($value) == '')
|
}
|
||||||
{
|
if ((!GETPOSTISSET($value)) || GETPOST($value) == '') {
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
$fieldnamekey = $listfield[$f];
|
$fieldnamekey = $listfield[$f];
|
||||||
// We take translate key of field
|
// We take translate key of field
|
||||||
|
|
||||||
if ($fieldnamekey == 'pcg_version') $fieldnamekey = 'Pcg_version';
|
if ($fieldnamekey == 'pcg_version') {
|
||||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey = 'Label';
|
$fieldnamekey = 'Pcg_version';
|
||||||
|
}
|
||||||
|
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) {
|
||||||
|
$fieldnamekey = 'Label';
|
||||||
|
}
|
||||||
|
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -174,36 +184,30 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
||||||
}
|
}
|
||||||
if (GETPOSTISSET("pcg_version"))
|
if (GETPOSTISSET("pcg_version")) {
|
||||||
{
|
if (GETPOST("pcg_version") == '0') {
|
||||||
if (GETPOST("pcg_version") == '0')
|
|
||||||
{
|
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
||||||
}
|
}
|
||||||
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2))
|
if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2)) {
|
||||||
{
|
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action add, on ajoute la ligne
|
// Si verif ok et action add, on ajoute la ligne
|
||||||
if ($ok && GETPOST('actionadd', 'alpha'))
|
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id])
|
|
||||||
{
|
|
||||||
// Recupere id libre pour insertion
|
// Recupere id libre pour insertion
|
||||||
$newid = 0;
|
$newid = 0;
|
||||||
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$newid = ($obj->newid + 1);
|
$newid = ($obj->newid + 1);
|
||||||
} else {
|
} else {
|
||||||
@ -214,34 +218,39 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
// Add new entry
|
// Add new entry
|
||||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||||
// List of fields
|
// List of fields
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||||
$sql .= $tabrowid[$id].",";
|
$sql .= $tabrowid[$id].",";
|
||||||
|
}
|
||||||
$sql .= $tabfieldinsert[$id];
|
$sql .= $tabfieldinsert[$id];
|
||||||
$sql .= ",active)";
|
$sql .= ",active)";
|
||||||
$sql .= " VALUES(";
|
$sql .= " VALUES(";
|
||||||
|
|
||||||
// List of values
|
// List of values
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||||
$sql .= $newid.",";
|
$sql .= $newid.",";
|
||||||
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($listfieldinsert as $f => $value)
|
foreach ($listfieldinsert as $f => $value) {
|
||||||
{
|
|
||||||
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||||
} elseif ($value == 'entity') {
|
} elseif ($value == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql .= ",";
|
if ($i) {
|
||||||
if ($_POST[$listfieldvalue[$i]] == '') $sql .= "null";
|
$sql .= ",";
|
||||||
else $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
}
|
||||||
|
if ($_POST[$listfieldvalue[$i]] == '') {
|
||||||
|
$sql .= "null";
|
||||||
|
} else {
|
||||||
|
$sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sql .= ",1)";
|
$sql .= ",1)";
|
||||||
|
|
||||||
dol_syslog("actionadd", LOG_DEBUG);
|
dol_syslog("actionadd", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) // Add is ok
|
if ($result) { // Add is ok
|
||||||
{
|
|
||||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
||||||
} else {
|
} else {
|
||||||
@ -254,30 +263,36 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
if ($ok && GETPOST('actionmodify', 'alpha'))
|
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
// Modify entry
|
// Modify entry
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||||
// Modifie valeur des champs
|
// Modifie valeur des champs
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||||
{
|
|
||||||
$sql .= $tabrowid[$id]."=";
|
$sql .= $tabrowid[$id]."=";
|
||||||
$sql .= "'".$db->escape($rowid)."', ";
|
$sql .= "'".$db->escape($rowid)."', ";
|
||||||
}
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($listfieldmodify as $field)
|
foreach ($listfieldmodify as $field) {
|
||||||
{
|
|
||||||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||||
} elseif ($field == 'entity') {
|
} elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql .= ",";
|
if ($i) {
|
||||||
|
$sql .= ",";
|
||||||
|
}
|
||||||
$sql .= $field."=";
|
$sql .= $field."=";
|
||||||
if ($_POST[$listfieldvalue[$i]] == '') $sql .= "null";
|
if ($_POST[$listfieldvalue[$i]] == '') {
|
||||||
else $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
$sql .= "null";
|
||||||
|
} else {
|
||||||
|
$sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -285,31 +300,30 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
dol_syslog("actionmodify", LOG_DEBUG);
|
dol_syslog("actionmodify", LOG_DEBUG);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql) {
|
||||||
{
|
|
||||||
setEventMessages($db->error(), null, 'errors');
|
setEventMessages($db->error(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('actioncancel', 'alpha'))
|
if (GETPOST('actioncancel', 'alpha')) {
|
||||||
{
|
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
|
|
||||||
dol_syslog("delete", LOG_DEBUG);
|
dol_syslog("delete", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') {
|
||||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
|
||||||
{
|
|
||||||
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -318,9 +332,12 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
|||||||
}
|
}
|
||||||
|
|
||||||
// activate
|
// activate
|
||||||
if ($action == $acts[0])
|
if ($action == $acts[0]) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -329,16 +346,18 @@ if ($action == $acts[0])
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable
|
// disable
|
||||||
if ($action == $acts[1])
|
if ($action == $acts[1]) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -347,16 +366,18 @@ if ($action == $acts[1])
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// favorite
|
// favorite
|
||||||
if ($action == 'activate_favorite')
|
if ($action == 'activate_favorite') {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -365,16 +386,18 @@ if ($action == 'activate_favorite')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable favorite
|
// disable favorite
|
||||||
if ($action == 'disable_favorite')
|
if ($action == 'disable_favorite') {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -383,8 +406,7 @@ if ($action == 'disable_favorite')
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -406,8 +428,7 @@ print load_fiche_titre($titre, $linkback, 'title_accountancy');
|
|||||||
|
|
||||||
|
|
||||||
// Confirmation de la suppression de la ligne
|
// Confirmation de la suppression de la ligne
|
||||||
if ($action == 'delete')
|
if ($action == 'delete') {
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.urlencode($page).'&' : '').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.urlencode($page).'&' : '').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
//var_dump($elementList);
|
//var_dump($elementList);
|
||||||
@ -415,20 +436,23 @@ if ($action == 'delete')
|
|||||||
/*
|
/*
|
||||||
* Show a dictionary
|
* Show a dictionary
|
||||||
*/
|
*/
|
||||||
if ($id)
|
if ($id) {
|
||||||
{
|
|
||||||
// Complete requete recherche valeurs avec critere de tri
|
// Complete requete recherche valeurs avec critere de tri
|
||||||
$sql = $tabsql[$id];
|
$sql = $tabsql[$id];
|
||||||
|
|
||||||
if ($search_country_id > 0)
|
if ($search_country_id > 0) {
|
||||||
{
|
if (preg_match('/ WHERE /', $sql)) {
|
||||||
if (preg_match('/ WHERE /', $sql)) $sql .= " AND ";
|
$sql .= " AND ";
|
||||||
else $sql .= " WHERE ";
|
} else {
|
||||||
|
$sql .= " WHERE ";
|
||||||
|
}
|
||||||
$sql .= " c.rowid = ".$search_country_id;
|
$sql .= " c.rowid = ".$search_country_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If sort order is "country", we use country_code instead
|
// If sort order is "country", we use country_code instead
|
||||||
if ($sortfield == 'country') $sortfield = 'country_code';
|
if ($sortfield == 'country') {
|
||||||
|
$sortfield = 'country_code';
|
||||||
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
$sql .= $db->plimit($listlimit + 1, $offset);
|
$sql .= $db->plimit($listlimit + 1, $offset);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
@ -442,46 +466,47 @@ if ($id)
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
// Form to add a new line
|
// Form to add a new line
|
||||||
if ($tabname[$id])
|
if ($tabname[$id]) {
|
||||||
{
|
|
||||||
$alabelisused = 0;
|
|
||||||
$var = false;
|
|
||||||
|
|
||||||
$fieldlist = explode(',', $tabfield[$id]);
|
$fieldlist = explode(',', $tabfield[$id]);
|
||||||
|
|
||||||
// Line for title
|
// Line for title
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
$class = "left";
|
$class = "left";
|
||||||
if ($fieldlist[$field] == 'code') { $valuetoshow = $langs->trans("Code"); }
|
if ($fieldlist[$field] == 'code') {
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label')
|
$valuetoshow = $langs->trans("Code");
|
||||||
{
|
}
|
||||||
|
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
|
||||||
$valuetoshow = $langs->trans("Label");
|
$valuetoshow = $langs->trans("Label");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'country') {
|
if ($fieldlist[$field] == 'country') {
|
||||||
if (in_array('region_id', $fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
if (in_array('region_id', $fieldlist)) {
|
||||||
|
print '<td> </td>'; continue;
|
||||||
|
} // For region page, we do not show the country input
|
||||||
$valuetoshow = $langs->trans("Country");
|
$valuetoshow = $langs->trans("Country");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'country_id') { $valuetoshow = ''; }
|
if ($fieldlist[$field] == 'country_id') {
|
||||||
if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') { $valuetoshow = $langs->trans("Pcg_version"); }
|
$valuetoshow = '';
|
||||||
|
}
|
||||||
|
if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') {
|
||||||
|
$valuetoshow = $langs->trans("Pcg_version");
|
||||||
|
}
|
||||||
|
|
||||||
if ($valuetoshow != '') {
|
if ($valuetoshow != '') {
|
||||||
print '<td class="'.$class.'">';
|
print '<td class="'.$class.'">';
|
||||||
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
|
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
|
||||||
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||||
} elseif (!empty($tabhelp[$id][$value])) {
|
} elseif (!empty($tabhelp[$id][$value])) {
|
||||||
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||||
} else {
|
} else {
|
||||||
print $valuetoshow;
|
print $valuetoshow;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -496,12 +521,11 @@ if ($id)
|
|||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd', 'alpha'))
|
if (GETPOST('actionadd', 'alpha')) {
|
||||||
{
|
foreach ($fieldlist as $key => $val) {
|
||||||
foreach ($fieldlist as $key=>$val)
|
if (GETPOST($val)) {
|
||||||
{
|
|
||||||
if (GETPOST($val))
|
|
||||||
$obj->$val = GETPOST($val);
|
$obj->$val = GETPOST($val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,8 +534,7 @@ if ($id)
|
|||||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
|
||||||
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add');
|
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'add');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,20 +553,24 @@ if ($id)
|
|||||||
// List of available values in database
|
// List of available values in database
|
||||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.$id;
|
||||||
if ($search_country_id > 0) $param .= '&search_country_id='.$search_country_id;
|
if ($search_country_id > 0) {
|
||||||
|
$param .= '&search_country_id='.$search_country_id;
|
||||||
|
}
|
||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) $paramwithsearch .= '&sortorder='.$sortorder;
|
if ($sortorder) {
|
||||||
if ($sortfield) $paramwithsearch .= '&sortfield='.$sortfield;
|
$paramwithsearch .= '&sortorder='.$sortorder;
|
||||||
|
}
|
||||||
|
if ($sortfield) {
|
||||||
|
$paramwithsearch .= '&sortfield='.$sortfield;
|
||||||
|
}
|
||||||
|
|
||||||
// There is several pages
|
// There is several pages
|
||||||
if ($num > $listlimit)
|
if ($num > $listlimit) {
|
||||||
{
|
|
||||||
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
|
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
|
||||||
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
|
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -551,16 +578,15 @@ if ($id)
|
|||||||
|
|
||||||
// Title line with search boxes
|
// Title line with search boxes
|
||||||
print '<tr class="liste_titre liste_titre_add">';
|
print '<tr class="liste_titre liste_titre_add">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
|
||||||
$showfield = 1; // By defaut
|
$showfield = 1; // By defaut
|
||||||
|
|
||||||
if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { $showfield = 0; }
|
if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') {
|
||||||
|
$showfield = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ($showfield)
|
if ($showfield) {
|
||||||
{
|
if ($value == 'country') {
|
||||||
if ($value == 'country')
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -586,16 +612,13 @@ if ($id)
|
|||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num) {
|
||||||
{
|
|
||||||
// Lines with values
|
// Lines with values
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
//print_r($obj);
|
//print_r($obj);
|
||||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code)))
|
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||||
{
|
|
||||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
@ -606,39 +629,35 @@ if ($id)
|
|||||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook)) fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
|
if (empty($reshook)) {
|
||||||
|
fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
print ' <input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||||
} else {
|
} else {
|
||||||
$tmpaction = 'view';
|
$tmpaction = 'view';
|
||||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
foreach ($fieldlist as $field => $value) {
|
||||||
foreach ($fieldlist as $field => $value)
|
|
||||||
{
|
|
||||||
$showfield = 1;
|
$showfield = 1;
|
||||||
$class = "left";
|
$class = "left";
|
||||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||||
if ($value == 'type_template')
|
if ($value == 'type_template') {
|
||||||
{
|
|
||||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||||
}
|
}
|
||||||
if ($value == 'element')
|
if ($value == 'element') {
|
||||||
{
|
|
||||||
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($elementList[$valuetoshow]) ? $elementList[$valuetoshow] : $valuetoshow;
|
||||||
} elseif ($value == 'source')
|
} elseif ($value == 'source') {
|
||||||
{
|
|
||||||
$valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
|
$valuetoshow = isset($sourceList[$valuetoshow]) ? $sourceList[$valuetoshow] : $valuetoshow;
|
||||||
} elseif ($valuetoshow == 'all') {
|
} elseif ($valuetoshow == 'all') {
|
||||||
$valuetoshow = $langs->trans('All');
|
$valuetoshow = $langs->trans('All');
|
||||||
} elseif ($fieldlist[$field] == 'country') {
|
} elseif ($fieldlist[$field] == 'country') {
|
||||||
if (empty($obj->country_code))
|
if (empty($obj->country_code)) {
|
||||||
{
|
|
||||||
$valuetoshow = '-';
|
$valuetoshow = '-';
|
||||||
} else {
|
} else {
|
||||||
$key = $langs->trans("Country".strtoupper($obj->country_code));
|
$key = $langs->trans("Country".strtoupper($obj->country_code));
|
||||||
@ -649,9 +668,13 @@ if ($id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$class = 'tddict';
|
$class = 'tddict';
|
||||||
if ($fieldlist[$field] == 'tracking') $class .= ' tdoverflowauto';
|
if ($fieldlist[$field] == 'tracking') {
|
||||||
|
$class .= ' tdoverflowauto';
|
||||||
|
}
|
||||||
// Show value for field
|
// Show value for field
|
||||||
if ($showfield) print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.$valuetoshow.'</td>';
|
if ($showfield) {
|
||||||
|
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.$valuetoshow.'</td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -659,22 +682,33 @@ if ($id)
|
|||||||
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
||||||
|
|
||||||
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
||||||
if ($param) $url .= '&'.$param;
|
if ($param) {
|
||||||
|
$url .= '&'.$param;
|
||||||
|
}
|
||||||
$url .= '&';
|
$url .= '&';
|
||||||
|
|
||||||
// Active
|
// Active
|
||||||
print '<td class="center nowrap">';
|
print '<td class="center nowrap">';
|
||||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
if ($canbedisabled) {
|
||||||
else print $langs->trans("AlwaysActive");
|
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||||
|
} else {
|
||||||
|
print $langs->trans("AlwaysActive");
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
if ($canbemodified) {
|
||||||
else print '<td> </td>';
|
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Delete link
|
// Delete link
|
||||||
if ($iserasable) print '<td class="center"><a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
|
if ($iserasable) {
|
||||||
else print '<td> </td>';
|
print '<td class="center"><a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
@ -718,12 +752,9 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
if ($fieldlist[$field] == 'country') {
|
||||||
if ($fieldlist[$field] == 'country')
|
if (in_array('region_id', $fieldlist)) {
|
||||||
{
|
|
||||||
if (in_array('region_id', $fieldlist))
|
|
||||||
{
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
//print join(',',$fieldlist);
|
//print join(',',$fieldlist);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -733,18 +764,19 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
|
|||||||
$fieldname = 'country';
|
$fieldname = 'country';
|
||||||
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($fieldlist[$field] == 'country_id')
|
} elseif ($fieldlist[$field] == 'country_id') {
|
||||||
{
|
if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate)
|
||||||
if (!in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate)
|
|
||||||
{
|
|
||||||
$country_id = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0);
|
$country_id = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0);
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
} elseif ($fieldlist[$field] == 'type_cdr') {
|
} elseif ($fieldlist[$field] == 'type_cdr') {
|
||||||
if ($fieldlist[$field] == 'type_cdr') print '<td class="center">';
|
if ($fieldlist[$field] == 'type_cdr') {
|
||||||
else print '<td>';
|
print '<td class="center">';
|
||||||
|
} else {
|
||||||
|
print '<td>';
|
||||||
|
}
|
||||||
if ($fieldlist[$field] == 'type_cdr') {
|
if ($fieldlist[$field] == 'type_cdr') {
|
||||||
print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
|
print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
|
||||||
} else {
|
} else {
|
||||||
@ -756,10 +788,18 @@ function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context =
|
|||||||
} else {
|
} else {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$size = ''; $class = '';
|
$size = ''; $class = '';
|
||||||
if ($fieldlist[$field] == 'code') $size = 'size="8" ';
|
if ($fieldlist[$field] == 'code') {
|
||||||
if ($fieldlist[$field] == 'position') $size = 'size="4" ';
|
$size = 'size="8" ';
|
||||||
if ($fieldlist[$field] == 'libelle') $size = 'centpercent';
|
}
|
||||||
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') $size = 'size="2" ';
|
if ($fieldlist[$field] == 'position') {
|
||||||
|
$size = 'size="4" ';
|
||||||
|
}
|
||||||
|
if ($fieldlist[$field] == 'libelle') {
|
||||||
|
$size = 'centpercent';
|
||||||
|
}
|
||||||
|
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') {
|
||||||
|
$size = 'size="2" ';
|
||||||
|
}
|
||||||
print '<input type="text" '.$size.' class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
print '<input type="text" '.$size.' class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("bills", "accountancy"));
|
$langs->loadLangs(array("bills", "accountancy", "compta"));
|
||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -41,11 +41,17 @@ $id = GETPOST('id', 'int');
|
|||||||
$ref = GETPOST('ref', 'alpha');
|
$ref = GETPOST('ref', 'alpha');
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
$accountingaccount = GETPOST('accountingaccount', 'alpha');
|
|
||||||
|
$account_number = GETPOST('account_number', 'string');
|
||||||
|
$label = GETPOST('label', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0) accessforbidden();
|
if ($user->socid > 0) {
|
||||||
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->accounting->chartofaccount) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$object = new AccountingAccount($db);
|
$object = new AccountingAccount($db);
|
||||||
@ -55,118 +61,126 @@ $object = new AccountingAccount($db);
|
|||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha'))
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
{
|
|
||||||
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
||||||
header("Location: ".$urltogo);
|
header("Location: ".$urltogo);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
if ($action == 'add' && $user->rights->accounting->chartofaccount) {
|
||||||
{
|
|
||||||
if (!$cancel) {
|
if (!$cancel) {
|
||||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS;
|
if (!$account_number) {
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
|
||||||
dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
|
$action = 'create';
|
||||||
$result = $db->query($sql);
|
} elseif (!$label) {
|
||||||
$obj = $db->fetch_object($result);
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||||
|
$action = 'create';
|
||||||
// Clean code
|
|
||||||
|
|
||||||
// To manage zero or not at the end of the accounting account
|
|
||||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
|
||||||
{
|
|
||||||
$account_number = GETPOST('account_number', 'string');
|
|
||||||
} else {
|
} else {
|
||||||
$account_number = clean_account(GETPOST('account_number', 'string'));
|
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
||||||
}
|
|
||||||
|
|
||||||
if (GETPOST('account_parent', 'int') <= 0)
|
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||||
{
|
$result = $db->query($sql);
|
||||||
$account_parent = 0;
|
$obj = $db->fetch_object($result);
|
||||||
} else {
|
|
||||||
$account_parent = GETPOST('account_parent', 'int');
|
|
||||||
}
|
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
// Clean code
|
||||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
|
||||||
$object->account_number = $account_number;
|
|
||||||
$object->account_parent = $account_parent;
|
|
||||||
$object->account_category = GETPOST('account_category', 'alpha');
|
|
||||||
$object->label = GETPOST('label', 'alpha');
|
|
||||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
|
||||||
$object->active = 1;
|
|
||||||
|
|
||||||
$res = $object->create($user);
|
// To manage zero or not at the end of the accounting account
|
||||||
if ($res == - 3) {
|
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||||
$error = 1;
|
$account_number = $account_number;
|
||||||
$action = "create";
|
} else {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
$account_number = clean_account($account_number);
|
||||||
} elseif ($res == - 4) {
|
}
|
||||||
$error = 2;
|
|
||||||
$action = "create";
|
if (GETPOST('account_parent', 'int') <= 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
$account_parent = 0;
|
||||||
} elseif ($res < 0)
|
} else {
|
||||||
{
|
$account_parent = GETPOST('account_parent', 'int');
|
||||||
$error++;
|
}
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
$action = "create";
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
}
|
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||||
if (!$error)
|
$object->account_number = $account_number;
|
||||||
{
|
$object->account_parent = $account_parent;
|
||||||
setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
|
$object->account_category = GETPOST('account_category', 'alpha');
|
||||||
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
$object->label = $label;
|
||||||
header("Location: ".$urltogo);
|
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||||
exit;
|
$object->active = 1;
|
||||||
|
|
||||||
|
$res = $object->create($user);
|
||||||
|
if ($res == -3) {
|
||||||
|
$error = 1;
|
||||||
|
$action = "create";
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} elseif ($res == -4) {
|
||||||
|
$error = 2;
|
||||||
|
$action = "create";
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} elseif ($res < 0) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action = "create";
|
||||||
|
}
|
||||||
|
if (!$error) {
|
||||||
|
setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
|
||||||
|
$urltogo = $backtopage ? $backtopage : dol_buildpath('/accountancy/admin/account.php', 1);
|
||||||
|
header("Location: " . $urltogo);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||||
if (!$cancel) {
|
if (!$cancel) {
|
||||||
$result = $object->fetch($id);
|
if (!$account_number) {
|
||||||
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountNumber")), null, 'errors');
|
||||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.$conf->global->CHARTOFACCOUNTS;
|
$action = 'update';
|
||||||
|
} elseif (!$label) {
|
||||||
dol_syslog('accountancy/admin/card.php:: $sql='.$sql);
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||||
$result2 = $db->query($sql);
|
$action = 'update';
|
||||||
$obj = $db->fetch_object($result2);
|
|
||||||
|
|
||||||
// Clean code
|
|
||||||
|
|
||||||
// To manage zero or not at the end of the accounting account
|
|
||||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1)
|
|
||||||
{
|
|
||||||
$account_number = GETPOST('account_number', 'string');
|
|
||||||
} else {
|
} else {
|
||||||
$account_number = clean_account(GETPOST('account_number', 'string'));
|
$result = $object->fetch($id);
|
||||||
}
|
|
||||||
|
|
||||||
if (GETPOST('account_parent', 'int') <= 0)
|
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||||
{
|
|
||||||
$account_parent = 0;
|
|
||||||
} else {
|
|
||||||
$account_parent = GETPOST('account_parent', 'int');
|
|
||||||
}
|
|
||||||
|
|
||||||
$object->fk_pcg_version = $obj->pcg_version;
|
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||||
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
$result2 = $db->query($sql);
|
||||||
$object->account_number = $account_number;
|
$obj = $db->fetch_object($result2);
|
||||||
$object->account_parent = $account_parent;
|
|
||||||
$object->account_category = GETPOST('account_category', 'alpha');
|
|
||||||
$object->label = GETPOST('label', 'alpha');
|
|
||||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
|
||||||
|
|
||||||
$result = $object->update($user);
|
// Clean code
|
||||||
|
|
||||||
if ($result > 0) {
|
// To manage zero or not at the end of the accounting account
|
||||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||||
header("Location: ".$urltogo);
|
$account_number = $account_number;
|
||||||
exit();
|
} else {
|
||||||
} else {
|
$account_number = clean_account($account_number);
|
||||||
$mesg = $object->error;
|
}
|
||||||
|
|
||||||
|
if (GETPOST('account_parent', 'int') <= 0) {
|
||||||
|
$account_parent = 0;
|
||||||
|
} else {
|
||||||
|
$account_parent = GETPOST('account_parent', 'int');
|
||||||
|
}
|
||||||
|
|
||||||
|
$object->fk_pcg_version = $obj->pcg_version;
|
||||||
|
$object->pcg_type = GETPOST('pcg_type', 'alpha');
|
||||||
|
$object->account_number = $account_number;
|
||||||
|
$object->account_parent = $account_parent;
|
||||||
|
$object->account_category = GETPOST('account_category', 'alpha');
|
||||||
|
$object->label = $label;
|
||||||
|
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||||
|
|
||||||
|
$result = $object->update($user);
|
||||||
|
|
||||||
|
if ($result > 0) {
|
||||||
|
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||||
|
header("Location: " . $urltogo);
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
$mesg = $object->error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
||||||
header("Location: ".$urltogo);
|
header("Location: ".$urltogo);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
||||||
@ -222,7 +236,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("AccountNumber").'</span></td>';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("AccountNumber").'</span></td>';
|
||||||
print '<td><input name="account_number" size="30" value="'.$accountingaccount.'"></td></tr>';
|
print '<td><input name="account_number" size="30" value="'.$account_number.'"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td>';
|
||||||
@ -238,26 +252,26 @@ if ($action == 'create') {
|
|||||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Chart of accounts type
|
||||||
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1, 0, 1);
|
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1, 0, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Chart of accounts type
|
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -270,8 +284,7 @@ if ($action == 'create') {
|
|||||||
$head = accounting_prepare_head($object);
|
$head = accounting_prepare_head($object);
|
||||||
|
|
||||||
// Edit mode
|
// Edit mode
|
||||||
if ($action == 'update')
|
if ($action == 'update') {
|
||||||
{
|
|
||||||
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
||||||
|
|
||||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
@ -300,26 +313,26 @@ if ($action == 'create') {
|
|||||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1);
|
print $formaccounting->select_account($object->account_parent, 'account_parent', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Chart of accounts type
|
||||||
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
// Category
|
// Category
|
||||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Chart of accounts type
|
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
|
||||||
print '<td>';
|
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -364,7 +377,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions buttons
|
* Actions buttons
|
||||||
|
|||||||
@ -46,8 +46,7 @@ if ($cat_id == 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($user->rights->accounting->chartofaccount))
|
if (empty($user->rights->accounting->chartofaccount)) {
|
||||||
{
|
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,8 +61,9 @@ $accountingcategory = new AccountancyCategory($db);
|
|||||||
if (!empty($selectcpt)) {
|
if (!empty($selectcpt)) {
|
||||||
$cpts = array();
|
$cpts = array();
|
||||||
foreach ($selectcpt as $selectedoption) {
|
foreach ($selectcpt as $selectedoption) {
|
||||||
if (!array_key_exists($selectedoption, $cpts))
|
if (!array_key_exists($selectedoption, $cpts)) {
|
||||||
$cpts[$selectedoption] = "'".$selectedoption."'";
|
$cpts[$selectedoption] = "'".$selectedoption."'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$return = $accountingcategory->updateAccAcc($cat_id, $cpts);
|
$return = $accountingcategory->updateAccAcc($cat_id, $cpts);
|
||||||
@ -114,8 +114,7 @@ print '<input class="button" type="submit" value="'.$langs->trans("Select").'">'
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Select the accounts
|
// Select the accounts
|
||||||
if (!empty($cat_id))
|
if (!empty($cat_id)) {
|
||||||
{
|
|
||||||
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
|
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
|
||||||
if ($return < 0) {
|
if ($return < 0) {
|
||||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||||
@ -124,8 +123,7 @@ if (!empty($cat_id))
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
$arraykeyvalue = array();
|
$arraykeyvalue = array();
|
||||||
foreach ($accountingcategory->lines_cptbk as $key => $val)
|
foreach ($accountingcategory->lines_cptbk as $key => $val) {
|
||||||
{
|
|
||||||
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')';
|
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte).' ('.$val->label_compte.($val->doc_ref ? ' '.$val->doc_ref : '').')';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,14 +144,14 @@ if (!empty($cat_id))
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'display' || $action == 'delete') {
|
if ($action == 'display' || $action == 'delete') {
|
||||||
print "<table class='noborder' width='100%'>\n";
|
print "<table class='noborder' width='100%'>\n";
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td class="liste_titre">'.$langs->trans("AccountAccounting")."</td>";
|
print '<td class="liste_titre">'.$langs->trans("AccountAccounting")."</td>";
|
||||||
print '<td class="liste_titre" colspan="2">'.$langs->trans("Label")."</td>";
|
print '<td class="liste_titre" colspan="2">'.$langs->trans("Label")."</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -39,8 +39,8 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
|
|
||||||
$list_account_main = array(
|
$list_account_main = array(
|
||||||
'ACCOUNTING_RESULT_PROFIT',
|
'ACCOUNTING_RESULT_PROFIT',
|
||||||
'ACCOUNTING_RESULT_LOSS'
|
'ACCOUNTING_RESULT_LOSS'
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -48,21 +48,20 @@ $list_account_main = array(
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$defaultjournal = GETPOST('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', 'alpha');
|
$defaultjournal = GETPOST('ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', 'alpha');
|
||||||
|
|
||||||
if (!empty($defaultjournal)) {
|
if (!empty($defaultjournal)) {
|
||||||
if (!dolibarr_set_const($db, 'ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', $defaultjournal, 'chaine', 0, '', $conf->entity)) {
|
if (!dolibarr_set_const($db, 'ACCOUNTING_CLOSURE_DEFAULT_JOURNAL', $defaultjournal, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($list_account_main as $constname) {
|
foreach ($list_account_main as $constname) {
|
||||||
$constvalue = GETPOST($constname, 'alpha');
|
$constvalue = GETPOST($constname, 'alpha');
|
||||||
|
|
||||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -99,20 +98,20 @@ print '<input type="hidden" name="action" value="update">';
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
foreach ($list_account_main as $key) {
|
foreach ($list_account_main as $key) {
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
// Param
|
// Param
|
||||||
$label = $langs->trans($key);
|
$label = $langs->trans($key);
|
||||||
$keydesc = $key.'_Desc';
|
$keydesc = $key.'_Desc';
|
||||||
|
|
||||||
$htmltext = $langs->trans($keydesc);
|
$htmltext = $langs->trans($keydesc);
|
||||||
print '<td class="fieldrequired" width="50%">';
|
print '<td class="fieldrequired" width="50%">';
|
||||||
print $form->textwithpicto($label, $htmltext);
|
print $form->textwithpicto($label, $htmltext);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Value
|
// Value
|
||||||
print '<td>'; // Do not force class=right, or it align also the content of the select box
|
print '<td>'; // Do not force class=right, or it align also the content of the select box
|
||||||
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Journal
|
// Journal
|
||||||
|
|||||||
@ -38,8 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
|||||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan"));
|
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($user->rights->accounting->chartofaccount))
|
if (empty($user->rights->accounting->chartofaccount)) {
|
||||||
{
|
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
|||||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
|
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
|
||||||
|
|
||||||
// Security access
|
// Security access
|
||||||
if (empty($user->rights->accounting->chartofaccount))
|
if (empty($user->rights->accounting->chartofaccount)) {
|
||||||
{
|
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +44,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
|
|
||||||
// Parameters ACCOUNTING_EXPORT_*
|
// Parameters ACCOUNTING_EXPORT_*
|
||||||
$main_option = array(
|
$main_option = array(
|
||||||
'ACCOUNTING_EXPORT_PREFIX_SPEC',
|
'ACCOUNTING_EXPORT_PREFIX_SPEC',
|
||||||
);
|
);
|
||||||
|
|
||||||
$configuration = AccountancyExport::getTypeConfig();
|
$configuration = AccountancyExport::getTypeConfig();
|
||||||
@ -58,22 +57,22 @@ $listcr = $configuration['cr'];
|
|||||||
|
|
||||||
|
|
||||||
$model_option = array(
|
$model_option = array(
|
||||||
'1' => array(
|
'1' => array(
|
||||||
'label' => 'ACCOUNTING_EXPORT_FORMAT',
|
'label' => 'ACCOUNTING_EXPORT_FORMAT',
|
||||||
'param' => $listformat,
|
'param' => $listformat,
|
||||||
),
|
),
|
||||||
'2' => array(
|
'2' => array(
|
||||||
'label' => 'ACCOUNTING_EXPORT_SEPARATORCSV',
|
'label' => 'ACCOUNTING_EXPORT_SEPARATORCSV',
|
||||||
'param' => '',
|
'param' => '',
|
||||||
),
|
),
|
||||||
'3' => array(
|
'3' => array(
|
||||||
'label' => 'ACCOUNTING_EXPORT_ENDLINE',
|
'label' => 'ACCOUNTING_EXPORT_ENDLINE',
|
||||||
'param' => $listcr,
|
'param' => $listcr,
|
||||||
),
|
),
|
||||||
'4' => array(
|
'4' => array(
|
||||||
'label' => 'ACCOUNTING_EXPORT_DATE',
|
'label' => 'ACCOUNTING_EXPORT_DATE',
|
||||||
'param' => '',
|
'param' => '',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -105,22 +104,22 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($listparam[$modelcsv] as $key => $value) {
|
foreach ($listparam[$modelcsv] as $key => $value) {
|
||||||
$constante = $key;
|
$constante = $key;
|
||||||
|
|
||||||
if (strpos($constante, 'ACCOUNTING') !== false) {
|
if (strpos($constante, 'ACCOUNTING') !== false) {
|
||||||
$constvalue = GETPOST($key, 'alpha');
|
$constvalue = GETPOST($key, 'alpha');
|
||||||
if (!dolibarr_set_const($db, $constante, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
if (!dolibarr_set_const($db, $constante, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
// reload
|
// reload
|
||||||
$configuration = AccountancyExport::getTypeConfig();
|
$configuration = AccountancyExport::getTypeConfig();
|
||||||
$listparam = $configuration['param'];
|
$listparam = $configuration['param'];
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -148,36 +147,36 @@ print 'jQuery(document).ready(function () {'."\n";
|
|||||||
print ' function initfields()'."\n";
|
print ' function initfields()'."\n";
|
||||||
print ' {'."\n";
|
print ' {'."\n";
|
||||||
foreach ($listparam as $key => $param) {
|
foreach ($listparam as $key => $param) {
|
||||||
print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n";
|
print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n";
|
||||||
print ' {'."\n";
|
print ' {'."\n";
|
||||||
print ' //console.log("'.$param['label'].'");'."\n";
|
print ' //console.log("'.$param['label'].'");'."\n";
|
||||||
if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) {
|
if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n";
|
||||||
} else {
|
} else {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n";
|
||||||
}
|
}
|
||||||
if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) {
|
if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n";
|
||||||
} else {
|
} else {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n";
|
||||||
}
|
}
|
||||||
if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) {
|
if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n";
|
||||||
} else {
|
} else {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n";
|
||||||
}
|
}
|
||||||
if (empty($param['ACCOUNTING_EXPORT_DATE'])) {
|
if (empty($param['ACCOUNTING_EXPORT_DATE'])) {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n";
|
||||||
} else {
|
} else {
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.$conf->global->ACCOUNTING_EXPORT_DATE.'");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("'.$conf->global->ACCOUNTING_EXPORT_DATE.'");'."\n";
|
||||||
print ' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'."\n";
|
print ' jQuery("#ACCOUNTING_EXPORT_DATE").removeAttr("disabled");'."\n";
|
||||||
}
|
}
|
||||||
print ' }'."\n";
|
print ' }'."\n";
|
||||||
}
|
}
|
||||||
print ' }'."\n";
|
print ' }'."\n";
|
||||||
print ' initfields();'."\n";
|
print ' initfields();'."\n";
|
||||||
@ -262,17 +261,17 @@ if ($num2) {
|
|||||||
foreach ($model_option as $key) {
|
foreach ($model_option as $key) {
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
|
|
||||||
// Param
|
// Param
|
||||||
$label = $key['label'];
|
$label = $key['label'];
|
||||||
print '<td width="50%">'.$langs->trans($label).'</td>';
|
print '<td width="50%">'.$langs->trans($label).'</td>';
|
||||||
|
|
||||||
// Value
|
// Value
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (is_array($key['param'])) {
|
if (is_array($key['param'])) {
|
||||||
print $form->selectarray($label, $key['param'], $conf->global->$label, 0);
|
print $form->selectarray($label, $key['param'], $conf->global->$label, 0);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" size="20" id="'.$label.'" name="'.$key['label'].'" value="'.$conf->global->$label.'">';
|
print '<input type="text" size="20" id="'.$label.'" name="'.$key['label'].'" value="'.$conf->global->$label.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,21 +32,29 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortfield) $sortfield = "f.rowid"; // Set here default search field
|
if (!$sortfield) {
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
$sortfield = "f.rowid"; // Set here default search field
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("admin", "compta"));
|
$langs->loadLangs(array("admin", "compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (!$user->rights->accounting->fiscalyear->write) // If we can read accounting records, we should be able to see fiscal year.
|
}
|
||||||
|
if (!$user->rights->accounting->fiscalyear->write) { // If we can read accounting records, we should be able to see fiscal year.
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -58,8 +66,9 @@ static $tmpstatut2label = array(
|
|||||||
$statut2label = array(
|
$statut2label = array(
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
foreach ($tmpstatut2label as $key => $val)
|
foreach ($tmpstatut2label as $key => $val) {
|
||||||
$statut2label[$key] = $langs->trans($val);
|
$statut2label[$key] = $langs->trans($val);
|
||||||
|
}
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
@ -92,12 +101,10 @@ $sql .= $db->order($sortfield, $sortorder);
|
|||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
{
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
{
|
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -106,14 +113,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
|||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
|
||||||
$addbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear->write);
|
$addbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->rights->accounting->fiscalyear->write);
|
||||||
|
|
||||||
|
|
||||||
$title = $langs->trans('AccountingPeriods');
|
$title = $langs->trans('AccountingPeriods');
|
||||||
|
|||||||
@ -31,10 +31,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
|||||||
$langs->loadLangs(array("admin", "compta"));
|
$langs->loadLangs(array("admin", "compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (empty($user->rights->accounting->fiscalyear->write))
|
}
|
||||||
|
if (empty($user->rights->accounting->fiscalyear->write)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -50,8 +52,9 @@ static $tmpstatut2label = array(
|
|||||||
$statut2label = array(
|
$statut2label = array(
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
foreach ($tmpstatut2label as $key => $val)
|
foreach ($tmpstatut2label as $key => $val) {
|
||||||
$statut2label[$key] = $langs->trans($val);
|
$statut2label[$key] = $langs->trans($val);
|
||||||
|
}
|
||||||
|
|
||||||
$object = new Fiscalyear($db);
|
$object = new Fiscalyear($db);
|
||||||
|
|
||||||
@ -113,10 +116,8 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||||||
header("Location: ./fiscalyear.php");
|
header("Location: ./fiscalyear.php");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
}
|
} elseif ($action == 'update') {
|
||||||
|
// Update record
|
||||||
// Update record
|
|
||||||
elseif ($action == 'update') {
|
|
||||||
if (!GETPOST('cancel', 'alpha')) {
|
if (!GETPOST('cancel', 'alpha')) {
|
||||||
$result = $object->fetch($id);
|
$result = $object->fetch($id);
|
||||||
|
|
||||||
@ -151,8 +152,7 @@ $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Card");
|
|||||||
$helpurl = "";
|
$helpurl = "";
|
||||||
llxHeader("", $title, $helpurl);
|
llxHeader("", $title, $helpurl);
|
||||||
|
|
||||||
if ($action == 'create')
|
if ($action == 'create') {
|
||||||
{
|
|
||||||
print load_fiche_titre($langs->trans("NewFiscalYear"));
|
print load_fiche_titre($langs->trans("NewFiscalYear"));
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
@ -187,12 +187,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -241,14 +241,14 @@ if ($action == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print '<br><div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Confirm delete
|
* Confirm delete
|
||||||
@ -296,13 +296,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if (!empty($user->rights->accounting->fiscalyear->write))
|
if (!empty($user->rights->accounting->fiscalyear->write)) {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
* Barre d'actions
|
* Barre d'actions
|
||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
|
||||||
|
|||||||
@ -30,10 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
|||||||
$langs->loadLangs(array("admin", "compta"));
|
$langs->loadLangs(array("admin", "compta"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0)
|
if ($user->socid > 0) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
if (!$user->rights->accounting->fiscalyear->write)
|
}
|
||||||
|
if (!$user->rights->accounting->fiscalyear->write) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
|
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
|
||||||
|
|
||||||
// Security access
|
// Security access
|
||||||
if (empty($user->rights->accounting->chartofaccount))
|
if (empty($user->rights->accounting->chartofaccount)) {
|
||||||
{
|
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,8 +47,9 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$list = array(
|
$list = array(
|
||||||
'ACCOUNTING_LENGTH_GACCOUNT',
|
'ACCOUNTING_LENGTH_GACCOUNT',
|
||||||
'ACCOUNTING_LENGTH_AACCOUNT',
|
'ACCOUNTING_LENGTH_AACCOUNT',
|
||||||
// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
// 'ACCOUNTING_LIMIT_LIST_VENTILATION' // there is already a global parameter to define the nb of records in lists, we must use it in priority. Having one parameter for nb of record for each page is deprecated.
|
||||||
// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
// 'ACCOUNTING_LENGTH_DESCRIPTION', // adjust size displayed for lines description for dol_trunc
|
||||||
|
// 'ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT', // adjust size displayed for select account description for dol_trunc
|
||||||
);
|
);
|
||||||
|
|
||||||
$list_binding = array(
|
$list_binding = array(
|
||||||
@ -64,10 +64,8 @@ $list_binding = array(
|
|||||||
if ($action == 'update') {
|
if ($action == 'update') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
foreach ($list as $constname) {
|
||||||
foreach ($list as $constname)
|
|
||||||
{
|
|
||||||
$constvalue = GETPOST($constname, 'alpha');
|
$constvalue = GETPOST($constname, 'alpha');
|
||||||
|
|
||||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||||
@ -78,8 +76,7 @@ if ($action == 'update') {
|
|||||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($list_binding as $constname)
|
foreach ($list_binding as $constname) {
|
||||||
{
|
|
||||||
$constvalue = GETPOST($constname, 'alpha');
|
$constvalue = GETPOST($constname, 'alpha');
|
||||||
|
|
||||||
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
|
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
|
||||||
@ -103,8 +100,9 @@ if ($action == 'update') {
|
|||||||
if ($action == 'setlistsorttodo') {
|
if ($action == 'setlistsorttodo') {
|
||||||
$setlistsorttodo = GETPOST('value', 'int');
|
$setlistsorttodo = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_TODO", $setlistsorttodo, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
@ -116,8 +114,10 @@ if ($action == 'setlistsorttodo') {
|
|||||||
if ($action == 'setlistsortdone') {
|
if ($action == 'setlistsortdone') {
|
||||||
$setlistsortdone = GETPOST('value', 'int');
|
$setlistsortdone = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -128,8 +128,10 @@ if ($action == 'setlistsortdone') {
|
|||||||
if ($action == 'setmanagezero') {
|
if ($action == 'setmanagezero') {
|
||||||
$setmanagezero = GETPOST('value', 'int');
|
$setmanagezero = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -140,8 +142,10 @@ if ($action == 'setmanagezero') {
|
|||||||
if ($action == 'setdisabledirectinput') {
|
if ($action == 'setdisabledirectinput') {
|
||||||
$setdisabledirectinput = GETPOST('value', 'int');
|
$setdisabledirectinput = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -152,8 +156,10 @@ if ($action == 'setdisabledirectinput') {
|
|||||||
if ($action == 'setenabledraftexport') {
|
if ($action == 'setenabledraftexport') {
|
||||||
$setenabledraftexport = GETPOST('value', 'int');
|
$setenabledraftexport = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -164,8 +170,10 @@ if ($action == 'setenabledraftexport') {
|
|||||||
if ($action == 'setenablesubsidiarylist') {
|
if ($action == 'setenablesubsidiarylist') {
|
||||||
$setenablesubsidiarylist = GETPOST('value', 'int');
|
$setenablesubsidiarylist = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -176,8 +184,10 @@ if ($action == 'setenablesubsidiarylist') {
|
|||||||
if ($action == 'setdisablebindingonsales') {
|
if ($action == 'setdisablebindingonsales') {
|
||||||
$setdisablebindingonsales = GETPOST('value', 'int');
|
$setdisablebindingonsales = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -188,8 +198,10 @@ if ($action == 'setdisablebindingonsales') {
|
|||||||
if ($action == 'setdisablebindingonpurchases') {
|
if ($action == 'setdisablebindingonpurchases') {
|
||||||
$setdisablebindingonpurchases = GETPOST('value', 'int');
|
$setdisablebindingonpurchases = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -200,8 +212,10 @@ if ($action == 'setdisablebindingonpurchases') {
|
|||||||
if ($action == 'setdisablebindingonexpensereports') {
|
if ($action == 'setdisablebindingonexpensereports') {
|
||||||
$setdisablebindingonexpensereports = GETPOST('value', 'int');
|
$setdisablebindingonexpensereports = GETPOST('value', 'int');
|
||||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity);
|
||||||
if (!$res > 0)
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -209,9 +223,11 @@ if ($action == 'setdisablebindingonexpensereports') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$title = $langs->trans('ConfigAccountingExpert');
|
$title = $langs->trans('ConfigAccountingExpert');
|
||||||
@ -263,6 +279,7 @@ print '</tr>';
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").'</td>';
|
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").'</td>';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enablesubsidiarylist&value=0">';
|
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enablesubsidiarylist&value=0">';
|
||||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
@ -288,11 +305,12 @@ if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Param a user $user->rights->accounting->chartofaccount can access
|
// Param a user $user->rights->accounting->chartofaccount can access
|
||||||
foreach ($list as $key)
|
foreach ($list as $key) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Param
|
// Param
|
||||||
$label = $langs->trans($key);
|
$label = $langs->trans($key);
|
||||||
@ -341,8 +359,7 @@ if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Param a user $user->rights->accounting->chartofaccount can access
|
// Param a user $user->rights->accounting->chartofaccount can access
|
||||||
foreach ($list_binding as $key)
|
foreach ($list_binding as $key) {
|
||||||
{
|
|
||||||
print '<tr class="oddeven value">';
|
print '<tr class="oddeven value">';
|
||||||
|
|
||||||
// Param
|
// Param
|
||||||
|
|||||||
@ -22,7 +22,9 @@
|
|||||||
* \brief Setup page to configure journals
|
* \brief Setup page to configure journals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
if (!defined('CSRFCHECK_WITH_TOKEN')) {
|
||||||
|
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||||
|
}
|
||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
@ -43,8 +45,7 @@ $rowid = GETPOST('rowid', 'alpha');
|
|||||||
$code = GETPOST('code', 'alpha');
|
$code = GETPOST('code', 'alpha');
|
||||||
|
|
||||||
// Security access
|
// Security access
|
||||||
if (empty($user->rights->accounting->chartofaccount))
|
if (empty($user->rights->accounting->chartofaccount)) {
|
||||||
{
|
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,12 +61,18 @@ $active = 1;
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $listlimit * $page;
|
$offset = $listlimit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (empty($sortfield)) $sortfield = 'code';
|
if (empty($sortfield)) {
|
||||||
if (empty($sortorder)) $sortorder = 'ASC';
|
$sortfield = 'code';
|
||||||
|
}
|
||||||
|
if (empty($sortorder)) {
|
||||||
|
$sortorder = 'ASC';
|
||||||
|
}
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -145,14 +152,12 @@ $sourceList = array(
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha'))
|
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
|
||||||
{
|
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actions add or modify an entry into a dictionary
|
// Actions add or modify an entry into a dictionary
|
||||||
if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||||
{
|
|
||||||
$listfield = explode(',', str_replace(' ', '', $tabfield[$id]));
|
$listfield = explode(',', str_replace(' ', '', $tabfield[$id]));
|
||||||
$listfieldinsert = explode(',', $tabfieldinsert[$id]);
|
$listfieldinsert = explode(',', $tabfieldinsert[$id]);
|
||||||
$listfieldmodify = explode(',', $tabfieldinsert[$id]);
|
$listfieldmodify = explode(',', $tabfieldinsert[$id]);
|
||||||
@ -160,48 +165,53 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
|
|
||||||
// Check that all fields are filled
|
// Check that all fields are filled
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
foreach ($listfield as $f => $value)
|
foreach ($listfield as $f => $value) {
|
||||||
{
|
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) {
|
||||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey = 'Label';
|
$fieldnamekey = 'Label';
|
||||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
}
|
||||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
|
if ($fieldnamekey == 'code') {
|
||||||
|
$fieldnamekey = 'Code';
|
||||||
|
}
|
||||||
|
if ($fieldnamekey == 'nature') {
|
||||||
|
$fieldnamekey = 'NatureOfJournal';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Other checks
|
// Other checks
|
||||||
if (GETPOSTISSET("code"))
|
if (GETPOSTISSET("code")) {
|
||||||
{
|
if (GETPOST("code") == '0') {
|
||||||
if (GETPOST("code") == '0')
|
|
||||||
{
|
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
||||||
}
|
}
|
||||||
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (!GETPOST('label', 'alpha'))
|
if (!GETPOST('label', 'alpha')) {
|
||||||
{
|
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors');
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean some parameters
|
// Clean some parameters
|
||||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"] = ''; // If empty, we force to null
|
if ($_POST["accountancy_code"] <= 0) {
|
||||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"] = ''; // If empty, we force to null
|
$_POST["accountancy_code"] = ''; // If empty, we force to null
|
||||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
}
|
||||||
|
if ($_POST["accountancy_code_sell"] <= 0) {
|
||||||
|
$_POST["accountancy_code_sell"] = ''; // If empty, we force to null
|
||||||
|
}
|
||||||
|
if ($_POST["accountancy_code_buy"] <= 0) {
|
||||||
|
$_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
||||||
|
}
|
||||||
|
|
||||||
// Si verif ok et action add, on ajoute la ligne
|
// Si verif ok et action add, on ajoute la ligne
|
||||||
if ($ok && GETPOST('actionadd', 'alpha'))
|
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id])
|
|
||||||
{
|
|
||||||
// Recupere id libre pour insertion
|
// Recupere id libre pour insertion
|
||||||
$newid = 0;
|
$newid = 0;
|
||||||
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$newid = ($obj->newid + 1);
|
$newid = ($obj->newid + 1);
|
||||||
} else {
|
} else {
|
||||||
@ -212,32 +222,37 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
// Add new entry
|
// Add new entry
|
||||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||||
// List of fields
|
// List of fields
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||||
$sql .= $tabrowid[$id].",";
|
$sql .= $tabrowid[$id].",";
|
||||||
|
}
|
||||||
$sql .= $tabfieldinsert[$id];
|
$sql .= $tabfieldinsert[$id];
|
||||||
$sql .= ",active,entity)";
|
$sql .= ",active,entity)";
|
||||||
$sql .= " VALUES(";
|
$sql .= " VALUES(";
|
||||||
|
|
||||||
// List of values
|
// List of values
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
|
||||||
$sql .= $newid.",";
|
$sql .= $newid.",";
|
||||||
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($listfieldinsert as $f => $value)
|
foreach ($listfieldinsert as $f => $value) {
|
||||||
{
|
|
||||||
if ($value == 'entity') {
|
if ($value == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql .= ",";
|
if ($i) {
|
||||||
if ($_POST[$listfieldvalue[$i]] == '') $sql .= "null"; // For vat, we want/accept code = ''
|
$sql .= ",";
|
||||||
else $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
}
|
||||||
|
if ($_POST[$listfieldvalue[$i]] == '') {
|
||||||
|
$sql .= "null"; // For vat, we want/accept code = ''
|
||||||
|
} else {
|
||||||
|
$sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sql .= ",1,".$conf->entity.")";
|
$sql .= ",1,".$conf->entity.")";
|
||||||
|
|
||||||
dol_syslog("actionadd", LOG_DEBUG);
|
dol_syslog("actionadd", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result) // Add is ok
|
if ($result) { // Add is ok
|
||||||
{
|
|
||||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||||
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
$_POST = array('id'=>$id); // Clean $_POST array, we keep only
|
||||||
} else {
|
} else {
|
||||||
@ -250,30 +265,36 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// Si verif ok et action modify, on modifie la ligne
|
||||||
if ($ok && GETPOST('actionmodify', 'alpha'))
|
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
// Modify entry
|
// Modify entry
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||||
// Modifie valeur des champs
|
// Modifie valeur des champs
|
||||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify))
|
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||||
{
|
|
||||||
$sql .= $tabrowid[$id]."=";
|
$sql .= $tabrowid[$id]."=";
|
||||||
$sql .= "'".$db->escape($rowid)."', ";
|
$sql .= "'".$db->escape($rowid)."', ";
|
||||||
}
|
}
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($listfieldmodify as $field)
|
foreach ($listfieldmodify as $field) {
|
||||||
{
|
|
||||||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||||
} elseif ($field == 'entity') {
|
} elseif ($field == 'entity') {
|
||||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||||
}
|
}
|
||||||
if ($i) $sql .= ",";
|
if ($i) {
|
||||||
|
$sql .= ",";
|
||||||
|
}
|
||||||
$sql .= $field."=";
|
$sql .= $field."=";
|
||||||
if ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10)) $sql .= "null"; // For vat, we want/accept code = ''
|
if ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10)) {
|
||||||
else $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
$sql .= "null"; // For vat, we want/accept code = ''
|
||||||
|
} else {
|
||||||
|
$sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -282,8 +303,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
dol_syslog("actionmodify", LOG_DEBUG);
|
dol_syslog("actionmodify", LOG_DEBUG);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql) {
|
||||||
{
|
|
||||||
setEventMessages($db->error(), null, 'errors');
|
setEventMessages($db->error(), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -295,19 +315,20 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
if ($action == 'confirm_delete' && $confirm == 'yes') { // delete
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
dol_syslog("delete", LOG_DEBUG);
|
dol_syslog("delete", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS') {
|
||||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
|
||||||
{
|
|
||||||
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
@ -316,9 +337,12 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
|||||||
}
|
}
|
||||||
|
|
||||||
// activate
|
// activate
|
||||||
if ($action == $acts[0])
|
if ($action == $acts[0]) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -328,16 +352,18 @@ if ($action == $acts[0])
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable
|
// disable
|
||||||
if ($action == $acts[1])
|
if ($action == $acts[1]) {
|
||||||
{
|
if ($tabrowid[$id]) {
|
||||||
if ($tabrowid[$id]) { $rowidcol = $tabrowid[$id]; } else { $rowidcol = "rowid"; }
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowid) {
|
if ($rowid) {
|
||||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = ".((int) $rowid);
|
||||||
@ -347,8 +373,7 @@ if ($action == $acts[1])
|
|||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if (!$result)
|
if (!$result) {
|
||||||
{
|
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -365,8 +390,7 @@ llxHeader();
|
|||||||
|
|
||||||
$titre = $langs->trans("DictionarySetup");
|
$titre = $langs->trans("DictionarySetup");
|
||||||
$linkback = '';
|
$linkback = '';
|
||||||
if ($id)
|
if ($id) {
|
||||||
{
|
|
||||||
$titre .= ' - '.$langs->trans($tablib[$id]);
|
$titre .= ' - '.$langs->trans($tablib[$id]);
|
||||||
$titlepicto = 'title_accountancy';
|
$titlepicto = 'title_accountancy';
|
||||||
}
|
}
|
||||||
@ -375,8 +399,7 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
|
|||||||
|
|
||||||
|
|
||||||
// Confirmation de la suppression de la ligne
|
// Confirmation de la suppression de la ligne
|
||||||
if ($action == 'delete')
|
if ($action == 'delete') {
|
||||||
{
|
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
//var_dump($elementList);
|
//var_dump($elementList);
|
||||||
@ -384,14 +407,15 @@ if ($action == 'delete')
|
|||||||
/*
|
/*
|
||||||
* Show a dictionary
|
* Show a dictionary
|
||||||
*/
|
*/
|
||||||
if ($id)
|
if ($id) {
|
||||||
{
|
|
||||||
// Complete requete recherche valeurs avec critere de tri
|
// Complete requete recherche valeurs avec critere de tri
|
||||||
$sql = $tabsql[$id];
|
$sql = $tabsql[$id];
|
||||||
$sql .= " WHERE a.entity = ".$conf->entity;
|
$sql .= " WHERE a.entity = ".$conf->entity;
|
||||||
|
|
||||||
// If sort order is "country", we use country_code instead
|
// If sort order is "country", we use country_code instead
|
||||||
if ($sortfield == 'country') $sortfield = 'country_code';
|
if ($sortfield == 'country') {
|
||||||
|
$sortfield = 'country_code';
|
||||||
|
}
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
$sql .= $db->plimit($listlimit + 1, $offset);
|
$sql .= $db->plimit($listlimit + 1, $offset);
|
||||||
|
|
||||||
@ -405,39 +429,38 @@ if ($id)
|
|||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
// Form to add a new line
|
// Form to add a new line
|
||||||
if ($tabname[$id])
|
if ($tabname[$id]) {
|
||||||
{
|
|
||||||
$alabelisused = 0;
|
|
||||||
|
|
||||||
$fieldlist = explode(',', $tabfield[$id]);
|
$fieldlist = explode(',', $tabfield[$id]);
|
||||||
|
|
||||||
// Line for title
|
// Line for title
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
$valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
$class = "left";
|
$class = "left";
|
||||||
if ($fieldlist[$field] == 'code') {
|
if ($fieldlist[$field] == 'code') {
|
||||||
$valuetoshow = $langs->trans("Code");
|
$valuetoshow = $langs->trans("Code");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
|
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
|
||||||
$valuetoshow = $langs->trans("Label");
|
$valuetoshow = $langs->trans("Label");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'nature') {
|
if ($fieldlist[$field] == 'nature') {
|
||||||
$valuetoshow = $langs->trans("NatureOfJournal");
|
$valuetoshow = $langs->trans("NatureOfJournal");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($valuetoshow != '') {
|
if ($valuetoshow != '') {
|
||||||
print '<td class="'.$class.'">';
|
print '<td class="'.$class.'">';
|
||||||
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
|
||||||
elseif (!empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||||
else print $valuetoshow;
|
} elseif (!empty($tabhelp[$id][$value])) {
|
||||||
|
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||||
|
} else {
|
||||||
|
print $valuetoshow;
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -453,12 +476,11 @@ if ($id)
|
|||||||
|
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
// If data was already input, we define them in obj to populate input fields.
|
// If data was already input, we define them in obj to populate input fields.
|
||||||
if (GETPOST('actionadd', 'alpha'))
|
if (GETPOST('actionadd', 'alpha')) {
|
||||||
{
|
foreach ($fieldlist as $key => $val) {
|
||||||
foreach ($fieldlist as $key=>$val)
|
if (GETPOST($val) != '') {
|
||||||
{
|
|
||||||
if (GETPOST($val) != '')
|
|
||||||
$obj->$val = GETPOST($val);
|
$obj->$val = GETPOST($val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,13 +489,12 @@ if ($id)
|
|||||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
fieldListJournal($fieldlist, $obj, $tabname[$id], 'add');
|
||||||
fieldListJournal($fieldlist, $obj, $tabname[$id], 'add');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td colspan="4" class="right">';
|
print '<td colspan="4" class="right">';
|
||||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
@ -485,21 +506,27 @@ if ($id)
|
|||||||
// List of available record in database
|
// List of available record in database
|
||||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = '&id='.$id;
|
$param = '&id='.$id;
|
||||||
if ($search_country_id > 0) $param .= '&search_country_id='.$search_country_id;
|
if ($search_country_id > 0) {
|
||||||
|
$param .= '&search_country_id='.$search_country_id;
|
||||||
|
}
|
||||||
$paramwithsearch = $param;
|
$paramwithsearch = $param;
|
||||||
if ($sortorder) $paramwithsearch .= '&sortorder='.$sortorder;
|
if ($sortorder) {
|
||||||
if ($sortfield) $paramwithsearch .= '&sortfield='.$sortfield;
|
$paramwithsearch .= '&sortorder='.$sortorder;
|
||||||
if (GETPOST('from', 'alpha')) $paramwithsearch .= '&from='.GETPOST('from', 'alpha');
|
}
|
||||||
|
if ($sortfield) {
|
||||||
|
$paramwithsearch .= '&sortfield='.$sortfield;
|
||||||
|
}
|
||||||
|
if (GETPOST('from', 'alpha')) {
|
||||||
|
$paramwithsearch .= '&from='.GETPOST('from', 'alpha');
|
||||||
|
}
|
||||||
|
|
||||||
// There is several pages
|
// There is several pages
|
||||||
if ($num > $listlimit)
|
if ($num > $listlimit) {
|
||||||
{
|
|
||||||
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
|
print '<tr class="none"><td class="right" colspan="'.(3 + count($fieldlist)).'">';
|
||||||
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
|
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -522,8 +549,7 @@ if ($id)
|
|||||||
|
|
||||||
// Title of lines
|
// Title of lines
|
||||||
print '<tr class="liste_titre liste_titre_add">';
|
print '<tr class="liste_titre liste_titre_add">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$showfield = 1; // By defaut
|
$showfield = 1; // By defaut
|
||||||
@ -531,23 +557,23 @@ if ($id)
|
|||||||
$sortable = 1;
|
$sortable = 1;
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
/*
|
/*
|
||||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
$tmparray=getLabelOfField($fieldlist[$field]);
|
||||||
$showfield=$tmp['showfield'];
|
$showfield=$tmp['showfield'];
|
||||||
$valuetoshow=$tmp['valuetoshow'];
|
$valuetoshow=$tmp['valuetoshow'];
|
||||||
$align=$tmp['align'];
|
$align=$tmp['align'];
|
||||||
$sortable=$tmp['sortable'];
|
$sortable=$tmp['sortable'];
|
||||||
*/
|
*/
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
if ($fieldlist[$field] == 'code') {
|
if ($fieldlist[$field] == 'code') {
|
||||||
$valuetoshow = $langs->trans("Code");
|
$valuetoshow = $langs->trans("Code");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
|
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') {
|
||||||
$valuetoshow = $langs->trans("Label");
|
$valuetoshow = $langs->trans("Label");
|
||||||
}
|
}
|
||||||
if ($fieldlist[$field] == 'nature') {
|
if ($fieldlist[$field] == 'nature') {
|
||||||
$valuetoshow = $langs->trans("NatureOfJournal");
|
$valuetoshow = $langs->trans("NatureOfJournal");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche nom du champ
|
// Affiche nom du champ
|
||||||
if ($showfield) {
|
if ($showfield) {
|
||||||
@ -560,43 +586,40 @@ if ($id)
|
|||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
if ($num)
|
if ($num) {
|
||||||
{
|
|
||||||
// Lines with values
|
// Lines with values
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
//print_r($obj);
|
//print_r($obj);
|
||||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||||
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code)))
|
if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
|
||||||
{
|
|
||||||
$tmpaction = 'edit';
|
$tmpaction = 'edit';
|
||||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
// Show fields
|
// Show fields
|
||||||
if (empty($reshook)) fieldListJournal($fieldlist, $obj, $tabname[$id], 'edit');
|
if (empty($reshook)) {
|
||||||
|
fieldListJournal($fieldlist, $obj, $tabname[$id], 'edit');
|
||||||
|
}
|
||||||
|
|
||||||
print '<td class="center" colspan="4">';
|
print '<td class="center" colspan="4">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
$tmpaction = 'view';
|
$tmpaction = 'view';
|
||||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
$langs->load("accountancy");
|
||||||
$langs->load("accountancy");
|
foreach ($fieldlist as $field => $value) {
|
||||||
foreach ($fieldlist as $field => $value)
|
|
||||||
{
|
|
||||||
$showfield = 1;
|
$showfield = 1;
|
||||||
$class = "left";
|
$class = "left";
|
||||||
$valuetoshow = $obj->{$fieldlist[$field]};
|
$valuetoshow = $obj->{$fieldlist[$field]};
|
||||||
@ -607,11 +630,13 @@ if ($id)
|
|||||||
$valuetoshow = ($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature)) ? $key : $obj->{$fieldlist[$field]});
|
$valuetoshow = ($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature)) ? $key : $obj->{$fieldlist[$field]});
|
||||||
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
|
} elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'accounting_journal') {
|
||||||
$valuetoshow = $langs->trans($obj->label);
|
$valuetoshow = $langs->trans($obj->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
$class = 'tddict';
|
$class = 'tddict';
|
||||||
// Show value for field
|
// Show value for field
|
||||||
if ($showfield) print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.$valuetoshow.'</td>';
|
if ($showfield) {
|
||||||
|
print '<!-- '.$fieldlist[$field].' --><td class="'.$class.'">'.$valuetoshow.'</td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,41 +644,52 @@ if ($id)
|
|||||||
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
$iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default
|
||||||
if (isset($obj->code) && $id != 10) {
|
if (isset($obj->code) && $id != 10) {
|
||||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
|
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
|
||||||
$iserasable = 0;
|
$iserasable = 0;
|
||||||
$canbedisabled = 0;
|
$canbedisabled = 0;
|
||||||
} elseif ($obj->code == 'RECEP') {
|
} elseif ($obj->code == 'RECEP') {
|
||||||
$iserasable = 0;
|
$iserasable = 0;
|
||||||
$canbedisabled = 0;
|
$canbedisabled = 0;
|
||||||
} elseif ($obj->code == 'EF0') {
|
} elseif ($obj->code == 'EF0') {
|
||||||
$iserasable = 0;
|
$iserasable = 0;
|
||||||
$canbedisabled = 0;
|
$canbedisabled = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$canbemodified = $iserasable;
|
$canbemodified = $iserasable;
|
||||||
|
|
||||||
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
$url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : '');
|
||||||
if ($param) $url .= '&'.$param;
|
if ($param) {
|
||||||
|
$url .= '&'.$param;
|
||||||
|
}
|
||||||
$url .= '&';
|
$url .= '&';
|
||||||
|
|
||||||
// Active
|
// Active
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
if ($canbedisabled) {
|
||||||
else print $langs->trans("AlwaysActive");
|
print '<a href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||||
|
} else {
|
||||||
|
print $langs->trans("AlwaysActive");
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
if ($canbemodified) print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
if ($canbemodified) {
|
||||||
else print '<td> </td>';
|
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
||||||
|
} else {
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Delete link
|
// Delete link
|
||||||
if ($iserasable)
|
if ($iserasable) {
|
||||||
{
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->admin) print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
|
if ($user->admin) {
|
||||||
|
print '<a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a>';
|
||||||
|
}
|
||||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else print '<td> </td>';
|
} else {
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
|
||||||
@ -701,10 +737,8 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
$formadmin = new FormAdmin($db);
|
$formadmin = new FormAdmin($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value) {
|
||||||
{
|
if ($fieldlist[$field] == 'nature') {
|
||||||
if ($fieldlist[$field] == 'nature')
|
|
||||||
{
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->selectarray('nature', $sourceList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
|
print $form->selectarray('nature', $sourceList, (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:''));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -713,9 +747,15 @@ function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
} else {
|
} else {
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$size = ''; $class = '';
|
$size = ''; $class = '';
|
||||||
if ($fieldlist[$field] == 'code') $class = 'maxwidth100';
|
if ($fieldlist[$field] == 'code') {
|
||||||
if ($fieldlist[$field] == 'label') $class = 'quatrevingtpercent';
|
$class = 'maxwidth100';
|
||||||
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') $size = 'size="2" ';
|
}
|
||||||
|
if ($fieldlist[$field] == 'label') {
|
||||||
|
$class = 'quatrevingtpercent';
|
||||||
|
}
|
||||||
|
if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type') {
|
||||||
|
$size = 'size="2" ';
|
||||||
|
}
|
||||||
print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
print '<input type="text" '.$size.'class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,8 +41,9 @@ $langs->loadLangs(array("companies", "compta", "accountancy", "products"));
|
|||||||
if (empty($conf->accounting->enabled)) {
|
if (empty($conf->accounting->enabled)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->accounting->bind->write)
|
if (!$user->rights->accounting->bind->write) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// search & action GETPOST
|
// search & action GETPOST
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -60,7 +61,9 @@ $search_desc = GETPOST('search_desc', 'alpha');
|
|||||||
$search_vat = GETPOST('search_vat', 'alpha');
|
$search_vat = GETPOST('search_vat', 'alpha');
|
||||||
$search_current_account = GETPOST('search_current_account', 'alpha');
|
$search_current_account = GETPOST('search_current_account', 'alpha');
|
||||||
$search_current_account_valid = GETPOST('search_current_account_valid', 'alpha');
|
$search_current_account_valid = GETPOST('search_current_account_valid', 'alpha');
|
||||||
if ($search_current_account_valid == '') $search_current_account_valid = 'withoutvalidaccount';
|
if ($search_current_account_valid == '') {
|
||||||
|
$search_current_account_valid = 'withoutvalidaccount';
|
||||||
|
}
|
||||||
$search_onsell = GETPOST('search_onsell', 'alpha');
|
$search_onsell = GETPOST('search_onsell', 'alpha');
|
||||||
$search_onpurchase = GETPOST('search_onpurchase', 'alpha');
|
$search_onpurchase = GETPOST('search_onpurchase', 'alpha');
|
||||||
|
|
||||||
@ -68,20 +71,30 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
|||||||
$btn_changeaccount = GETPOST('changeaccount', 'alpha');
|
$btn_changeaccount = GETPOST('changeaccount', 'alpha');
|
||||||
$btn_changetype = GETPOST('changetype', 'alpha');
|
$btn_changetype = GETPOST('changetype', 'alpha');
|
||||||
|
|
||||||
if (empty($accounting_product_mode)) $accounting_product_mode = 'ACCOUNTANCY_SELL';
|
if (empty($accounting_product_mode)) {
|
||||||
|
$accounting_product_mode = 'ACCOUNTANCY_SELL';
|
||||||
|
}
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortfield) $sortfield = "p.ref";
|
if (!$sortfield) {
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
$sortfield = "p.ref";
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($action)) $action = 'list';
|
if (empty($action)) {
|
||||||
|
$action = 'list';
|
||||||
|
}
|
||||||
|
|
||||||
$arrayfields = array();
|
$arrayfields = array();
|
||||||
|
|
||||||
@ -90,24 +103,29 @@ $arrayfields = array();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
$action = 'list'; $massaction = '';
|
||||||
|
}
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||||
|
$massaction = '';
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
// Purge search criteria
|
// Purge search criteria
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||||
{
|
$search_ref = '';
|
||||||
$search_ref = '';
|
$search_label = '';
|
||||||
$search_label = '';
|
$search_desc = '';
|
||||||
$search_desc = '';
|
|
||||||
$search_vat = '';
|
$search_vat = '';
|
||||||
$search_onsell = '';
|
$search_onsell = '';
|
||||||
$search_onpurchase = '';
|
$search_onpurchase = '';
|
||||||
$search_current_account = '';
|
$search_current_account = '';
|
||||||
$search_current_account_valid = '-1';
|
$search_current_account_valid = '-1';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sales or Purchase mode ?
|
// Sales or Purchase mode ?
|
||||||
@ -117,8 +135,8 @@ if ($action == 'update') {
|
|||||||
|
|
||||||
$accounting_product_modes = array(
|
$accounting_product_modes = array(
|
||||||
'ACCOUNTANCY_SELL',
|
'ACCOUNTANCY_SELL',
|
||||||
'ACCOUNTANCY_SELL_INTRA',
|
'ACCOUNTANCY_SELL_INTRA',
|
||||||
'ACCOUNTANCY_SELL_EXPORT',
|
'ACCOUNTANCY_SELL_EXPORT',
|
||||||
'ACCOUNTANCY_BUY',
|
'ACCOUNTANCY_BUY',
|
||||||
'ACCOUNTANCY_BUY_INTRA',
|
'ACCOUNTANCY_BUY_INTRA',
|
||||||
'ACCOUNTANCY_BUY_EXPORT'
|
'ACCOUNTANCY_BUY_EXPORT'
|
||||||
@ -142,13 +160,11 @@ if ($action == 'update') {
|
|||||||
$arrayofdifferentselectedvalues = array();
|
$arrayofdifferentselectedvalues = array();
|
||||||
|
|
||||||
$cpt = 0; $ok = 0; $ko = 0;
|
$cpt = 0; $ok = 0; $ko = 0;
|
||||||
foreach ($chk_prod as $productid)
|
foreach ($chk_prod as $productid) {
|
||||||
{
|
|
||||||
$accounting_account_id = GETPOST('codeventil_'.$productid);
|
$accounting_account_id = GETPOST('codeventil_'.$productid);
|
||||||
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
if ($accounting_account_id > 0)
|
if ($accounting_account_id > 0) {
|
||||||
{
|
|
||||||
$arrayofdifferentselectedvalues[$accounting_account_id] = $accounting_account_id;
|
$arrayofdifferentselectedvalues[$accounting_account_id] = $accounting_account_id;
|
||||||
$result = $accounting->fetch($accounting_account_id, null, 1);
|
$result = $accounting->fetch($accounting_account_id, null, 1);
|
||||||
}
|
}
|
||||||
@ -172,22 +188,21 @@ if ($action == 'update') {
|
|||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
$sql .= " SET accountancy_code_sell = ".$accounting->account_number;
|
$sql .= " SET accountancy_code_sell = ".$accounting->account_number;
|
||||||
}
|
}
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
$sql .= " SET accountancy_code_sell_intra = ".$accounting->account_number;
|
$sql .= " SET accountancy_code_sell_intra = ".$accounting->account_number;
|
||||||
}
|
}
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
$sql .= " SET accountancy_code_sell_export = ".$accounting->account_number;
|
$sql .= " SET accountancy_code_sell_export = ".$accounting->account_number;
|
||||||
}
|
}
|
||||||
$sql .= " WHERE rowid = ".((int) $productid);
|
$sql .= " WHERE rowid = ".((int) $productid);
|
||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
|
||||||
if ($db->query($sql))
|
if ($db->query($sql)) {
|
||||||
{
|
$ok++;
|
||||||
$ok++;
|
$db->commit();
|
||||||
$db->commit();
|
|
||||||
} else {
|
} else {
|
||||||
$ko++;
|
$ko++;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +210,12 @@ if ($action == 'update') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ko) setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors');
|
if ($ko) {
|
||||||
if ($ok) setEventMessages($langs->trans("XLineSuccessfullyBinded", $ok), null, 'mesgs');
|
setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors');
|
||||||
|
}
|
||||||
|
if ($ok) {
|
||||||
|
setEventMessages($langs->trans("XLineSuccessfullyBinded", $ok), null, 'mesgs');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,7 +262,9 @@ llxHeader('', $langs->trans("ProductsBinding"));
|
|||||||
|
|
||||||
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
$pcgverid = $conf->global->CHARTOFACCOUNTS;
|
||||||
$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
$pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||||
if (empty($pcgvercode)) $pcgvercode = $pcgverid;
|
if (empty($pcgvercode)) {
|
||||||
|
$pcgvercode = $pcgverid;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.tva_tx,";
|
$sql = "SELECT p.rowid, p.ref, p.label, p.description, p.tosell, p.tobuy, p.tva_tx,";
|
||||||
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
||||||
@ -253,27 +274,23 @@ $sql .= " aa.rowid as aaid";
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON";
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
$sql .= " p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA')
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
{
|
|
||||||
$sql .= " p.accountancy_code_buy_intra = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_buy_intra = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT')
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
{
|
|
||||||
$sql .= " p.accountancy_code_buy_export = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_buy_export = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL')
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
{
|
|
||||||
$sql .= " p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA')
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
{
|
|
||||||
$sql .= " p.accountancy_code_sell_intra = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_sell_intra = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
} else {
|
} else {
|
||||||
$sql .= " p.accountancy_code_sell_export = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
$sql .= " p.accountancy_code_sell_export = aa.account_number AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
|
||||||
}
|
}
|
||||||
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
$sql .= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_buy", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_buy", $search_current_account);
|
||||||
}
|
}
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_buy_intra", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_buy_intra", $search_current_account);
|
||||||
@ -283,25 +300,23 @@ if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
|||||||
$sql .= natural_search("p.accountancy_code_buy_export", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_buy_export", $search_current_account);
|
||||||
}
|
}
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_sell", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_sell", $search_current_account);
|
||||||
}
|
}
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_sell_intra", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_sell_intra", $search_current_account);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (strlen(trim($search_current_account))) {
|
if (strlen(trim($search_current_account))) {
|
||||||
$sql .= natural_search("p.accountancy_code_sell_export", $search_current_account);
|
$sql .= natural_search("p.accountancy_code_sell_export", $search_current_account);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($search_current_account_valid == 'withoutvalidaccount')
|
if ($search_current_account_valid == 'withoutvalidaccount') {
|
||||||
{
|
|
||||||
$sql .= " AND aa.account_number IS NULL";
|
$sql .= " AND aa.account_number IS NULL";
|
||||||
}
|
}
|
||||||
if ($search_current_account_valid == 'withvalidaccount')
|
if ($search_current_account_valid == 'withvalidaccount') {
|
||||||
{
|
$sql .= " AND aa.account_number IS NOT NULL";
|
||||||
$sql .= " AND aa.account_number IS NOT NULL";
|
|
||||||
}
|
}
|
||||||
// Add search filter like
|
// Add search filter like
|
||||||
if (strlen(trim($search_ref))) {
|
if (strlen(trim($search_ref))) {
|
||||||
@ -316,82 +331,101 @@ if (strlen(trim($search_desc))) {
|
|||||||
if (strlen(trim($search_vat))) {
|
if (strlen(trim($search_vat))) {
|
||||||
$sql .= natural_search("p.tva_tx", price2num($search_vat), 1);
|
$sql .= natural_search("p.tva_tx", price2num($search_vat), 1);
|
||||||
}
|
}
|
||||||
if ($search_onsell != '' && $search_onsell != '-1') $sql .= natural_search('p.tosell', $search_onsell, 1);
|
if ($search_onsell != '' && $search_onsell != '-1') {
|
||||||
if ($search_onpurchase != '' && $search_onpurchase != '-1') $sql .= natural_search('p.tobuy', $search_onpurchase, 1);
|
$sql .= natural_search('p.tosell', $search_onsell, 1);
|
||||||
|
}
|
||||||
|
if ($search_onpurchase != '' && $search_onpurchase != '-1') {
|
||||||
|
$sql .= natural_search('p.tobuy', $search_onpurchase, 1);
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
{
|
$result = $db->query($sql);
|
||||||
$result = $db->query($sql);
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
$nbtotalofrecords = $db->num_rows($result);
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
$page = 0;
|
||||||
{
|
$offset = 0;
|
||||||
$page = 0;
|
}
|
||||||
$offset = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= $db->plimit($limit + 1, $offset);
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
dol_syslog("/accountancy/admin/productaccount.php:: sql=".$sql, LOG_DEBUG);
|
dol_syslog("/accountancy/admin/productaccount.php:: sql=".$sql, LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($search_ref > 0) $param .= "&search_desc=".urlencode($search_ref);
|
}
|
||||||
if ($search_label > 0) $param .= "&search_desc=".urlencode($search_label);
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
if ($search_desc > 0) $param .= "&search_desc=".urlencode($search_desc);
|
$param .= '&limit='.urlencode($limit);
|
||||||
if ($search_vat > 0) $param .= '&search_vat='.urlencode($search_vat);
|
}
|
||||||
if ($search_current_account > 0) $param .= "&search_current_account=".urlencode($search_current_account);
|
if ($search_ref > 0) {
|
||||||
if ($search_current_account_valid && $search_current_account_valid != '-1') $param .= "&search_current_account_valid=".urlencode($search_current_account_valid);
|
$param .= "&search_desc=".urlencode($search_ref);
|
||||||
if ($accounting_product_mode) $param .= '&accounting_product_mode='.urlencode($accounting_product_mode);
|
}
|
||||||
|
if ($search_label > 0) {
|
||||||
|
$param .= "&search_desc=".urlencode($search_label);
|
||||||
|
}
|
||||||
|
if ($search_desc > 0) {
|
||||||
|
$param .= "&search_desc=".urlencode($search_desc);
|
||||||
|
}
|
||||||
|
if ($search_vat > 0) {
|
||||||
|
$param .= '&search_vat='.urlencode($search_vat);
|
||||||
|
}
|
||||||
|
if ($search_current_account > 0) {
|
||||||
|
$param .= "&search_current_account=".urlencode($search_current_account);
|
||||||
|
}
|
||||||
|
if ($search_current_account_valid && $search_current_account_valid != '-1') {
|
||||||
|
$param .= "&search_current_account_valid=".urlencode($search_current_account_valid);
|
||||||
|
}
|
||||||
|
if ($accounting_product_mode) {
|
||||||
|
$param .= '&accounting_product_mode='.urlencode($accounting_product_mode);
|
||||||
|
}
|
||||||
|
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') {
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
}
|
||||||
print '<input type="hidden" name="action" value="update">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="action" value="update">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
|
print load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("InitAccountancyDesc").'</span><br>';
|
print '<span class="opacitymedium">'.$langs->trans("InitAccountancyDesc").'</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
// Select mode
|
// Select mode
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans('Options').'</td><td>'.$langs->trans('Description').'</td>';
|
print '<td>'.$langs->trans('Options').'</td><td>'.$langs->trans('Description').'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"'.($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSell').'</td>';
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL"'.($accounting_product_mode == 'ACCOUNTANCY_SELL' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSell').'</td>';
|
||||||
print '<td>'.$langs->trans('OptionModeProductSellDesc');
|
print '<td>'.$langs->trans('OptionModeProductSellDesc');
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
if ($mysoc->isInEEC())
|
if ($mysoc->isInEEC()) {
|
||||||
{
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellIntra').'</td>';
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellIntra').'</td>';
|
print '<td>'.$langs->trans('OptionModeProductSellIntraDesc');
|
||||||
print '<td>'.$langs->trans('OptionModeProductSellIntraDesc');
|
print "</td></tr>\n";
|
||||||
print "</td></tr>\n";
|
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellExport').'</td>';
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_SELL_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductSellExport').'</td>';
|
||||||
print '<td>'.$langs->trans('OptionModeProductSellExportDesc');
|
print '<td>'.$langs->trans('OptionModeProductSellExportDesc');
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY"'.($accounting_product_mode == 'ACCOUNTANCY_BUY' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuy').'</td>';
|
||||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
if ($mysoc->isInEEC())
|
if ($mysoc->isInEEC()) {
|
||||||
{
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyIntra').'</td>';
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_INTRA"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyIntra').'</td>';
|
|
||||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven"><td class="titlefield"><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyExport').'</td>';
|
print '<tr class="oddeven"><td><input type="radio" name="accounting_product_mode" value="ACCOUNTANCY_BUY_EXPORT"'.($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT' ? ' checked' : '').'> '.$langs->trans('OptionModeProductBuyExport').'</td>';
|
||||||
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
print '<td>'.$langs->trans('OptionModeProductBuyDesc')."</td></tr>\n";
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
@ -405,8 +439,8 @@ if ($result)
|
|||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
|
$buttonsave = '<input type="submit" class="button button-save" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
|
||||||
//print '<br><div class="center">'.$buttonsave.'</div>';
|
//print '<br><div class="center">'.$buttonsave.'</div>';
|
||||||
|
|
||||||
$texte = $langs->trans("ListOfProductsServices");
|
$texte = $langs->trans("ListOfProductsServices");
|
||||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
|
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
|
||||||
@ -419,13 +453,14 @@ if ($result)
|
|||||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" size="5" name="search_vat" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" size="5" name="search_vat" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) {
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
|
||||||
|
}
|
||||||
// On sell
|
// On sell
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
print '<td class="liste_titre center">'.$form->selectyesno('search_onsell', $search_onsell, 1, false, 1).'</td>';
|
print '<td class="liste_titre center">'.$form->selectyesno('search_onsell', $search_onsell, 1, false, 1).'</td>';
|
||||||
}
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
// On buy
|
// On buy
|
||||||
elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
|
||||||
print '<td class="liste_titre center">'.$form->selectyesno('search_onpurchase', $search_onpurchase, 1, false, 1).'</td>';
|
print '<td class="liste_titre center">'.$form->selectyesno('search_onpurchase', $search_onpurchase, 1, false, 1).'</td>';
|
||||||
}
|
}
|
||||||
// Current account
|
// Current account
|
||||||
@ -444,29 +479,31 @@ if ($result)
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) {
|
||||||
|
print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "p.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "p.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
// On sell / On purchase
|
// On sell / On purchase
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_sell";
|
$fieldtosortaccount = "p.accountancy_code_sell";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_sell_intra";
|
$fieldtosortaccount = "p.accountancy_code_sell_intra";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnSell", $_SERVER["PHP_SELF"], "p.tosell", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_sell_export";
|
$fieldtosortaccount = "p.accountancy_code_sell_export";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_buy";
|
$fieldtosortaccount = "p.accountancy_code_buy";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_buy_intra";
|
$fieldtosortaccount = "p.accountancy_code_buy_intra";
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
$fieldtosortaccount = "p.accountancy_code_buy_export";
|
$fieldtosortaccount = "p.accountancy_code_buy_export";
|
||||||
}
|
}
|
||||||
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("AssignDedicatedAccountingAccount");
|
print_liste_field_titre("AssignDedicatedAccountingAccount");
|
||||||
$clickpitco = $form->showCheckAddButtons('checkforselect', 1);
|
$clickpitco = $form->showCheckAddButtons('checkforselect', 1);
|
||||||
print_liste_field_titre($clickpitco, '', '', '', '', '', '', '', 'center ');
|
print_liste_field_titre($clickpitco, '', '', '', '', '', '', '', 'center ');
|
||||||
@ -475,8 +512,7 @@ if ($result)
|
|||||||
$product_static = new Product($db);
|
$product_static = new Product($db);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit)) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
// Ref produit as link
|
// Ref produit as link
|
||||||
@ -494,12 +530,12 @@ if ($result)
|
|||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell;
|
$compta_prodsell_id = $aarowid_prodsell;
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell_intra;
|
$compta_prodsell_id = $aarowid_prodsell_intra;
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell_export;
|
$compta_prodsell_id = $aarowid_prodsell_export;
|
||||||
} else {
|
} else {
|
||||||
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
$compta_prodsell = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||||
$compta_prodsell_id = $aarowid_prodsell;
|
$compta_prodsell_id = $aarowid_prodsell;
|
||||||
}
|
}
|
||||||
@ -558,13 +594,12 @@ if ($result)
|
|||||||
|
|
||||||
print '<td class="left">'.$obj->label.'</td>';
|
print '<td class="left">'.$obj->label.'</td>';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC))
|
if (!empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) {
|
||||||
{
|
// TODO ADJUST DESCRIPTION SIZE
|
||||||
// TODO ADJUST DESCRIPTION SIZE
|
// print '<td class="left">' . $obj->description . '</td>';
|
||||||
// print '<td class="left">' . $obj->description . '</td>';
|
// TODO: we should set a user defined value to adjust user square / wide screen size
|
||||||
// TODO: we should set a user defined value to adjust user square / wide screen size
|
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
print '<td>'.nl2br(dol_trunc($obj->description, $trunclength)).'</td>';
|
||||||
print '<td>'.nl2br(dol_trunc($obj->description, $trunclength)).'</td>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
@ -572,100 +607,138 @@ if ($result)
|
|||||||
print vatrate($obj->tva_tx);
|
print vatrate($obj->tva_tx);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
|
if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT') {
|
||||||
print '<td class="center">'.$product_static->getLibStatut(3, 0).'</td>';
|
print '<td class="center">'.$product_static->getLibStatut(3, 0).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT')
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY' || $accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
print '<td class="center">'.$product_static->getLibStatut(3, 1).'</td>';
|
print '<td class="center">'.$product_static->getLibStatut(3, 1).'</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Current accounting account
|
// Current accounting account
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
print length_accountg($obj->accountancy_code_buy);
|
print length_accountg($obj->accountancy_code_buy);
|
||||||
if ($obj->accountancy_code_buy && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
if ($obj->accountancy_code_buy && empty($obj->aaid)) {
|
||||||
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
}
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
print length_accountg($obj->accountancy_code_buy_intra);
|
print length_accountg($obj->accountancy_code_buy_intra);
|
||||||
if ($obj->accountancy_code_buy_intra && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
if ($obj->accountancy_code_buy_intra && empty($obj->aaid)) {
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
print length_accountg($obj->accountancy_code_buy_export);
|
}
|
||||||
if ($obj->accountancy_code_buy_export && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
print length_accountg($obj->accountancy_code_buy_export);
|
||||||
print length_accountg($obj->accountancy_code_sell);
|
if ($obj->accountancy_code_buy_export && empty($obj->aaid)) {
|
||||||
if ($obj->accountancy_code_sell && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
}
|
||||||
print length_accountg($obj->accountancy_code_sell_intra);
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
if ($obj->accountancy_code_sell_intra && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
print length_accountg($obj->accountancy_code_sell);
|
||||||
|
if ($obj->accountancy_code_sell && empty($obj->aaid)) {
|
||||||
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
}
|
||||||
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
|
print length_accountg($obj->accountancy_code_sell_intra);
|
||||||
|
if ($obj->accountancy_code_sell_intra && empty($obj->aaid)) {
|
||||||
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print length_accountg($obj->accountancy_code_sell_export);
|
print length_accountg($obj->accountancy_code_sell_export);
|
||||||
if ($obj->accountancy_code_sell_export && empty($obj->aaid)) print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
if ($obj->accountancy_code_sell_export && empty($obj->aaid)) {
|
||||||
}
|
print ' '.img_warning($langs->trans("ValueNotIntoChartOfAccount"));
|
||||||
|
}
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// New account to set
|
// New account to set
|
||||||
$defaultvalue = '';
|
$defaultvalue = '';
|
||||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||||
// Accounting account buy
|
// Accounting account buy
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
if (empty($defaultvalue)) {
|
||||||
|
$defaultvalue = $compta_prodbuy;
|
||||||
|
}
|
||||||
$codesell = length_accountg($obj->accountancy_code_buy);
|
$codesell = length_accountg($obj->accountancy_code_buy);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
if (!empty($obj->aaid)) {
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
}
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
// Accounting account buy intra (In EEC)
|
// Accounting account buy intra (In EEC)
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
if (empty($defaultvalue)) {
|
||||||
|
$defaultvalue = $compta_prodbuy;
|
||||||
|
}
|
||||||
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
if (!empty($obj->aaid)) {
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
}
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
// Accounting account buy export (Out of EEC)
|
// Accounting account buy export (Out of EEC)
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
if (empty($defaultvalue)) {
|
||||||
|
$defaultvalue = $compta_prodbuy;
|
||||||
|
}
|
||||||
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
if (!empty($obj->aaid)) {
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
}
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
// Accounting account sell
|
// Accounting account sell
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
if (empty($defaultvalue)) {
|
||||||
|
$defaultvalue = $compta_prodsell;
|
||||||
|
}
|
||||||
$codesell = length_accountg($obj->accountancy_code_sell);
|
$codesell = length_accountg($obj->accountancy_code_sell);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
if (!empty($obj->aaid)) {
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
}
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
// Accounting account sell intra (In EEC)
|
// Accounting account sell intra (In EEC)
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
if (empty($defaultvalue)) {
|
||||||
$codesell = length_accountg($obj->accountancy_code_sell_intra);
|
$defaultvalue = $compta_prodsell;
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
}
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
$codesell = length_accountg($obj->accountancy_code_sell_intra);
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
print '</td>';
|
if (!empty($obj->aaid)) {
|
||||||
} else {
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
// Accounting account sell export (Out of EEC)
|
}
|
||||||
print '<td class="left">';
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
print '</td>';
|
||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
} else {
|
||||||
$codesell = length_accountg($obj->accountancy_code_sell_export);
|
// Accounting account sell export (Out of EEC)
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
print '<td class="left">';
|
||||||
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1);
|
//$defaultvalue=GETPOST('codeventil_' . $product_static->id,'alpha'); This is id and we need a code
|
||||||
print '</td>';
|
if (empty($defaultvalue)) {
|
||||||
}
|
$defaultvalue = $compta_prodsell;
|
||||||
|
}
|
||||||
|
$codesell = length_accountg($obj->accountancy_code_sell_export);
|
||||||
|
if (!empty($obj->aaid)) {
|
||||||
|
$defaultvalue = ''; // Do not suggest default new value is code is already valid
|
||||||
|
}
|
||||||
|
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
// Checkbox select
|
// Checkbox select
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="checkbox" class="checkforselect" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
print '<input type="checkbox" class="checkforselect productforselectcodeventil_'.$product_static->id.'" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -689,7 +762,17 @@ if ($result)
|
|||||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||||
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||||
}
|
}
|
||||||
jQuery(".checkforselect, #checkallactions").click(function() {
|
|
||||||
|
jQuery(".checkforselect").change(function() {
|
||||||
|
init_savebutton();
|
||||||
|
});
|
||||||
|
jQuery(".productforselect").change(function() {
|
||||||
|
console.log($(this).attr("id")+" "+$(this).val());
|
||||||
|
if ($(this).val() && $(this).val() != -1) {
|
||||||
|
$(".productforselect"+$(this).attr("id")).prop(\'checked\', true);
|
||||||
|
} else {
|
||||||
|
$(".productforselect"+$(this).attr("id")).prop(\'checked\', false);
|
||||||
|
}
|
||||||
init_savebutton();
|
init_savebutton();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -43,20 +43,30 @@ $search_label = GETPOST('search_label', 'alpha');
|
|||||||
$search_type = GETPOST('search_type', 'int');
|
$search_type = GETPOST('search_type', 'int');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0) accessforbidden();
|
if ($user->socid > 0) {
|
||||||
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
if (!$user->rights->accounting->chartofaccount) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) {
|
||||||
|
$page = 0;
|
||||||
|
} // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
if (!$sortfield) $sortfield = "label";
|
if (!$sortfield) {
|
||||||
if (!$sortorder) $sortorder = "ASC";
|
$sortfield = "label";
|
||||||
|
}
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = "ASC";
|
||||||
|
}
|
||||||
|
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'subaccount'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
'subaccount'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||||
@ -65,27 +75,35 @@ $arrayfields = array(
|
|||||||
'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
|
'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['reconcilable']);
|
if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||||
|
unset($arrayfields['reconcilable']);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
if (GETPOST('cancel', 'alpha')) {
|
||||||
if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; }
|
$action = 'list'; $massaction = '';
|
||||||
|
}
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha')) {
|
||||||
|
$massaction = '';
|
||||||
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($reshook))
|
if (empty($reshook)) {
|
||||||
{
|
if (!empty($cancel)) {
|
||||||
if (!empty($cancel)) $action = '';
|
$action = '';
|
||||||
|
}
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
|
||||||
{
|
|
||||||
$search_subaccount = "";
|
$search_subaccount = "";
|
||||||
$search_label = "";
|
$search_label = "";
|
||||||
$search_type = "";
|
$search_type = "";
|
||||||
@ -105,7 +123,7 @@ $title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
|
|||||||
llxHeader('', $title);
|
llxHeader('', $title);
|
||||||
|
|
||||||
// Customer
|
// Customer
|
||||||
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '0' as type, sa.entity";
|
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
|
||||||
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||||
$sql .= " AND sa.code_compta <> ''";
|
$sql .= " AND sa.code_compta <> ''";
|
||||||
@ -132,23 +150,28 @@ if (strlen(trim($search_subaccount))) {
|
|||||||
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
$search_subaccount_clean = $search_subaccount;
|
$search_subaccount_clean = $search_subaccount;
|
||||||
$startchar = '%';
|
$startchar = '%';
|
||||||
if (strpos($search_subaccount_tmp, '^') === 0)
|
if (strpos($search_subaccount_tmp, '^') === 0) {
|
||||||
{
|
|
||||||
$startchar = '';
|
$startchar = '';
|
||||||
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
}
|
}
|
||||||
$sql .= " AND (sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
$sql .= " AND (sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
$sql .= " OR sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
$sql .= " OR sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
} else $sql .= natural_search("sa.code_compta", $search_subaccount_tmp);
|
} else {
|
||||||
|
$sql .= natural_search("sa.code_compta", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
if (strlen(trim($search_label))) {
|
||||||
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
$sql .= natural_search("sa.nom", $search_label);
|
||||||
|
}
|
||||||
|
if (!empty($search_type) && $search_type >= 0) {
|
||||||
|
$sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
}
|
||||||
|
|
||||||
// Supplier
|
// Supplier
|
||||||
$sql .= " UNION ";
|
$sql .= " UNION ";
|
||||||
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '1' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa";
|
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa";
|
||||||
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||||
$sql .= " AND sa.code_compta_fournisseur <> ''";
|
$sql .= " AND sa.code_compta_fournisseur <> ''";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
@ -174,23 +197,28 @@ if (strlen(trim($search_subaccount))) {
|
|||||||
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
$search_subaccount_clean = $search_subaccount;
|
$search_subaccount_clean = $search_subaccount;
|
||||||
$startchar = '%';
|
$startchar = '%';
|
||||||
if (strpos($search_subaccount_tmp, '^') === 0)
|
if (strpos($search_subaccount_tmp, '^') === 0) {
|
||||||
{
|
|
||||||
$startchar = '';
|
$startchar = '';
|
||||||
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
}
|
}
|
||||||
$sql .= " AND (sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
$sql .= " AND (sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
$sql .= " OR sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
$sql .= " OR sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
} else $sql .= natural_search("sa.code_compta_fournisseur", $search_subaccount_tmp);
|
} else {
|
||||||
|
$sql .= natural_search("sa.code_compta_fournisseur", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
if (strlen(trim($search_label))) {
|
||||||
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
$sql .= natural_search("sa.nom", $search_label);
|
||||||
|
}
|
||||||
|
if (!empty($search_type) && $search_type >= 0) {
|
||||||
|
$sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
}
|
||||||
|
|
||||||
// User
|
// User
|
||||||
$sql .= " UNION ";
|
$sql .= " UNION ";
|
||||||
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '2' as type, u.entity FROM ".MAIN_DB_PREFIX."user u";
|
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity FROM ".MAIN_DB_PREFIX."user u";
|
||||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
$sql .= " AND u.accountancy_code <> ''";
|
$sql .= " AND u.accountancy_code <> ''";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
@ -216,30 +244,33 @@ if (strlen(trim($search_subaccount))) {
|
|||||||
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
$search_subaccount_clean = $search_subaccount;
|
$search_subaccount_clean = $search_subaccount;
|
||||||
$startchar = '%';
|
$startchar = '%';
|
||||||
if (strpos($search_subaccount_tmp, '^') === 0)
|
if (strpos($search_subaccount_tmp, '^') === 0) {
|
||||||
{
|
|
||||||
$startchar = '';
|
$startchar = '';
|
||||||
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
}
|
}
|
||||||
$sql .= " AND (u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
$sql .= " AND (u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
$sql .= " OR u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
$sql .= " OR u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
} else $sql .= natural_search("u.accountancy_code", $search_subaccount_tmp);
|
} else {
|
||||||
|
$sql .= natural_search("u.accountancy_code", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strlen(trim($search_label))) $sql .= natural_search("u.lastname", $search_label);
|
if (strlen(trim($search_label))) {
|
||||||
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
$sql .= natural_search("u.lastname", $search_label);
|
||||||
|
}
|
||||||
|
if (!empty($search_type) && $search_type >= 0) {
|
||||||
|
$sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
{
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$nbtotalofrecords = $db->num_rows($resql);
|
$nbtotalofrecords = $db->num_rows($resql);
|
||||||
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
{
|
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -250,19 +281,30 @@ $sql .= $db->plimit($limit + 1, $offset);
|
|||||||
dol_syslog('accountancy/admin/subaccount.php:: $sql='.$sql);
|
dol_syslog('accountancy/admin/subaccount.php:: $sql='.$sql);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($search_subaccount) $param .= '&search_subaccount='.urlencode($search_subaccount);
|
}
|
||||||
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||||
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
$param .= '&limit='.urlencode($limit);
|
||||||
|
}
|
||||||
|
if ($search_subaccount) {
|
||||||
|
$param .= '&search_subaccount='.urlencode($search_subaccount);
|
||||||
|
}
|
||||||
|
if ($search_label) {
|
||||||
|
$param .= '&search_label='.urlencode($search_label);
|
||||||
|
}
|
||||||
|
if ($optioncss != '') {
|
||||||
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
|
}
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') {
|
||||||
|
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
}
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
@ -285,10 +327,20 @@ if ($resql)
|
|||||||
|
|
||||||
// Line for search fields
|
// Line for search fields
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
if (!empty($arrayfields['subaccount']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_subaccount" value="'.$search_subaccount.'"></td>';
|
if (!empty($arrayfields['subaccount']['checked'])) {
|
||||||
if (!empty($arrayfields['label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_subaccount" value="'.$search_subaccount.'"></td>';
|
||||||
if (!empty($arrayfields['type']['checked'])) print '<td class="liste_titre center">'.$form->selectarray('search_type', array('0'=>$langs->trans('Customer'), '1'=>$langs->trans('Supplier'), '2'=>$langs->trans('Employee')), $search_type, 1).'</td>';
|
}
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
if (!empty($arrayfields['label']['checked'])) {
|
||||||
|
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['type']['checked'])) {
|
||||||
|
print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
|
||||||
|
}
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
if (!empty($arrayfields['reconcilable']['checked'])) {
|
||||||
|
print '<td class="liste_titre"> </td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
@ -296,62 +348,69 @@ if ($resql)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($arrayfields['subaccount']['checked'])) print_liste_field_titre($arrayfields['subaccount']['label'], $_SERVER["PHP_SELF"], "subaccount", "", $param, '', $sortfield, $sortorder);
|
if (!empty($arrayfields['subaccount']['checked'])) {
|
||||||
if (!empty($arrayfields['label']['checked'])) print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], "label", "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre($arrayfields['subaccount']['label'], $_SERVER["PHP_SELF"], "subaccount", "", $param, '', $sortfield, $sortorder);
|
||||||
if (!empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'center ');
|
}
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['reconcilable']['checked'])) print_liste_field_titre($arrayfields['reconcilable']['label'], $_SERVER["PHP_SELF"], 'reconcilable', '', $param, '', $sortfield, $sortorder, 'center '); }
|
if (!empty($arrayfields['label']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], "label", "", $param, '', $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
if (!empty($arrayfields['type']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
}
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
if (!empty($arrayfields['reconcilable']['checked'])) {
|
||||||
|
print_liste_field_titre($arrayfields['reconcilable']['label'], $_SERVER["PHP_SELF"], 'reconcilable', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
}
|
||||||
|
}
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit)) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Account number
|
// Account number
|
||||||
if (!empty($arrayfields['subaccount']['checked']))
|
if (!empty($arrayfields['subaccount']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print length_accounta($obj->subaccount);
|
print length_accounta($obj->subaccount);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subaccount label
|
// Subaccount label
|
||||||
if (!empty($arrayfields['label']['checked']))
|
if (!empty($arrayfields['label']['checked'])) {
|
||||||
{
|
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $obj->label;
|
print $obj->label;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
if (!empty($arrayfields['type']['checked']))
|
if (!empty($arrayfields['type']['checked'])) {
|
||||||
{
|
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$s = '';
|
$s = '';
|
||||||
// Customer
|
// Customer
|
||||||
if ($obj->type == 0)
|
if ($obj->type == 1) {
|
||||||
{
|
|
||||||
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
||||||
}
|
} elseif ($obj->type == 2) {
|
||||||
// Supplier
|
// Supplier
|
||||||
elseif ($obj->type == 1)
|
|
||||||
{
|
|
||||||
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||||
}
|
} elseif ($obj->type == 3) {
|
||||||
// User
|
// User
|
||||||
elseif ($obj->type == 2)
|
|
||||||
{
|
|
||||||
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
|
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
|
||||||
}
|
}
|
||||||
print $s;
|
print $s;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
@ -376,25 +435,22 @@ if ($resql)
|
|||||||
|
|
||||||
// Action
|
// Action
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$e = '';
|
$e = '';
|
||||||
// Customer
|
// Customer
|
||||||
if ($obj->type == 0)
|
if ($obj->type == 1) {
|
||||||
{
|
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
}
|
} elseif ($obj->type == 2) {
|
||||||
// Supplier
|
// Supplier
|
||||||
elseif ($obj->type == 1)
|
|
||||||
{
|
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
}
|
} elseif ($obj->type == 3) {
|
||||||
// User
|
// User
|
||||||
elseif ($obj->type == 2)
|
|
||||||
{
|
|
||||||
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
}
|
}
|
||||||
print $e;
|
print $e;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user