Merge remote-tracking branch 'origin' into add_hook_bank
This commit is contained in:
commit
db213f6870
2850 changed files with 796369 additions and 21781 deletions
7
.github/workflows/code_quality.yml
vendored
7
.github/workflows/code_quality.yml
vendored
|
|
@ -1,7 +1,7 @@
|
|||
name: Qodana
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 20 * * *"
|
||||
- cron: "0 20 * * 1,3,5"
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- develop
|
||||
|
|
@ -9,6 +9,9 @@ on:
|
|||
# branches:
|
||||
# - develop
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
qodana:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -18,7 +21,7 @@ jobs:
|
|||
fetch-depth: 1
|
||||
#php-version: '7.1'
|
||||
- name: 'Qodana Scan'
|
||||
uses: JetBrains/qodana-action@v2023.1.0
|
||||
uses: JetBrains/qodana-action@v2023.1.4
|
||||
#with:
|
||||
# php-version: '7.1'
|
||||
env:
|
||||
|
|
|
|||
362
.github/workflows/github_ci_php71_pgsql.yml
vendored
Normal file
362
.github/workflows/github_ci_php71_pgsql.yml
vendored
Normal file
|
|
@ -0,0 +1,362 @@
|
|||
name: GitHub CI PHP 7.1 Postgres
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- 1*
|
||||
- 2*
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
github_ci_php71_pgsql:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
ports:
|
||||
- 32574:3306
|
||||
postgres:
|
||||
image: postgres
|
||||
env:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
# Set health checks to wait until postgres has started
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
# git clone dolibarr into GITHUB_WORKSPACE = /home/runner/work/dolibarr/dolibarr
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Version PHP
|
||||
run: |
|
||||
php -i | head -
|
||||
|
||||
- name: Install packages for PHP 7.1
|
||||
run: |
|
||||
sudo composer self-update 2.2.18
|
||||
sudo chmod -R a+rwx /home/runner
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
|
||||
sudo add-apt-repository -y ppa:ondrej/php
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y pgloader memcached
|
||||
sudo apt install apache2 php7.1 php7.1-cli php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1
|
||||
sudo update-alternatives --set php /usr/bin/php7.1
|
||||
php -i | head -
|
||||
|
||||
cd $GITHUB_WORKSPACE
|
||||
ls $GITHUB_WORKSPACE
|
||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^7.5 \
|
||||
php-parallel-lint/php-parallel-lint ^1 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
||||
squizlabs/php_codesniffer ^3
|
||||
#For php7.3
|
||||
#composer -n require phpunit/phpunit ^7.5 \
|
||||
# php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
# php-parallel-lint/php-console-highlighter ^0 \
|
||||
# php-parallel-lint/php-var-dump-check ~0.4 \
|
||||
# squizlabs/php_codesniffer ^3
|
||||
sudo rm -fr htdocs/includes/phpunit/php-code-coverage/src/Report/Html
|
||||
|
||||
- name: Adding path of binaries tools installed by composer to the PATH
|
||||
run: |
|
||||
export PATH="$GITHUB_WORKSPACE/htdocs/includes/bin:$PATH"
|
||||
echo $PATH
|
||||
# We must have a directory bin created by the previous composer call
|
||||
ls $GITHUB_WORKSPACE/htdocs/includes/bin
|
||||
|
||||
- name: Version information
|
||||
run: |
|
||||
composer -V
|
||||
# Check Parallel-lint version
|
||||
echo "Parallel-lint version"
|
||||
htdocs/includes/bin/parallel-lint -V
|
||||
# Check PHP CodeSniffer version
|
||||
echo "PHPCS version"
|
||||
htdocs/includes/bin/phpcs --version | head -
|
||||
htdocs/includes/bin/phpcs -i | head -
|
||||
# Check PHP Vardump check version
|
||||
echo "PHP Vardump check version"
|
||||
htdocs/includes/bin/var-dump-check --version
|
||||
# Check PHPUnit version
|
||||
echo "PHPUnit version"
|
||||
htdocs/includes/bin/phpunit --version | head -
|
||||
# Check Apache version
|
||||
echo "Apache version"
|
||||
apache2 -v | head -
|
||||
# Check Database
|
||||
echo "Database version"
|
||||
mysql --version | head -
|
||||
psql --version
|
||||
echo "Check pgloader version"
|
||||
pgloader --version
|
||||
|
||||
- name: Create database
|
||||
run: |
|
||||
pwd
|
||||
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
|
||||
sudo apt-get install -y mysql-client
|
||||
mysql --version | head -
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SELECT VERSION();" | head -
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SHOW DATABASES"
|
||||
echo "Drop and create database"
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'FLUSH PRIVILEGES;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"
|
||||
|
||||
#psql -c 'create database travis;' -U postgres
|
||||
#psql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
#pgloader mysql://root:pass@127.0.0.1/dolibarr_src postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dest
|
||||
ps fauxww | grep postgres
|
||||
ls /etc/postgresql/14/main/
|
||||
sudo cat /etc/postgresql/14/main/pg_hba.conf
|
||||
|
||||
sudo echo "local all postgres trust" > /etc/postgresql/14/main/pg_hba.conf
|
||||
sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||
sudo echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||
sudo echo "host all all ::1/128 trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||
|
||||
sudo cat /etc/postgresql/14/main/pg_hba.conf
|
||||
|
||||
sudo /etc/init.d/postgresql restart
|
||||
|
||||
#$(PGPASSWORD="postgres"; psql -h 127.0.0.1 -p 5432 -U postgres -l -A)
|
||||
psql -h 127.0.0.1 -p 5432 -U postgres -l -A
|
||||
|
||||
echo sudo pgloader mysql://root:password@127.0.0.1/travis postgresql://postgres:postgres@127.0.0.1:5432/travis
|
||||
sudo mkdir -p /tmp/pgloader
|
||||
sudo chmod -R a+rwx /tmp/pgloader/
|
||||
sudo pgloader mysql://root:password@127.0.0.1/travis postgresql://postgres:postgres@127.0.0.1:5432/travis
|
||||
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql -U postgres travis
|
||||
echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql -U postgres travis
|
||||
# Create pgsql compatibility functions
|
||||
psql -U postgres travis < htdocs/install/pgsql/functions/functions.sql
|
||||
|
||||
- name: Generate Dolibarr conf file
|
||||
run: |
|
||||
export CONF_FILE=$GITHUB_WORKSPACE/htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php' > $CONF_FILE
|
||||
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_document_root=\'/var/www/html\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_data_root=\'/var/www/html/documents\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_user=\'root\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_pass=\'password\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_instance_unique_id=\'travis1234567890\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_port=\'32574\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
|
||||
cat $CONF_FILE
|
||||
- name: Generate install.forced.php file to test installation
|
||||
run: |
|
||||
export INSTALL_FORCED_FILE=$GITHUB_WORKSPACE/htdocs/install/install.forced.php
|
||||
echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation"
|
||||
# Ensure we catch errors
|
||||
set +e
|
||||
echo '<?php' > $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE
|
||||
# For mysql
|
||||
echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE
|
||||
#echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_databaselogin=\'root\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_databasepass=\'password\'';' >> $INSTALL_FORCED_FILE
|
||||
# For mysql
|
||||
echo '$'force_install_port=\'32574\'';' >> $INSTALL_FORCED_FILE
|
||||
#echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_main_data_root=\'/var/www/html\'';' >> $INSTALL_FORCED_FILE
|
||||
cat $INSTALL_FORCED_FILE
|
||||
|
||||
- name: Create document directory
|
||||
run: |
|
||||
echo "Create documents directory and set permissions"
|
||||
# and admin/temp subdirectory needed for unit tests
|
||||
sudo mkdir -p /var/www/html/documents/admin/temp
|
||||
sudo chmod -R a+rwx /var/www/html/documents
|
||||
sudo echo "***** First line of dolibarr.log" > /var/www/html/documents/dolibarr.log
|
||||
sudo chmod a+rwx /var/www/html/documents/dolibarr.log
|
||||
|
||||
- name: Copy app into /var/www
|
||||
run: |
|
||||
sudo cp -r $GITHUB_WORKSPACE/htdocs/. /var/www/html
|
||||
sudo mv /var/www/html/index.html /var/www/html/index.disabled.html
|
||||
sudo ln -fs /var/www/html /var/www/htdocs
|
||||
sudo cp -r $GITHUB_WORKSPACE/test/. /var/www/test
|
||||
sudo cp -r $GITHUB_WORKSPACE/dev/. /var/www/dev
|
||||
sudo cp -r $GITHUB_WORKSPACE/scripts/. /var/www/scripts
|
||||
|
||||
- name: Setup Apache
|
||||
run: |
|
||||
pwd
|
||||
whoami
|
||||
# install apache web server
|
||||
a2query -s
|
||||
a2query -m
|
||||
ls /etc/apache2/sites-available
|
||||
#sudo cp -f $GITHUB_WORKSPACE/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
|
||||
#sudo sed -e "s?%GITHUB_WORKSPACE%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
|
||||
a2ensite 000-default
|
||||
a2enmod php7.1
|
||||
ls /etc/apache2/sites-enabled
|
||||
sudo adduser $(whoami) www-data
|
||||
sudo adduser $(whoami) root
|
||||
sudo adduser root www-data
|
||||
sudo chown -R www-data:www-data /etc/apache2/sites-available/
|
||||
sudo chmod -R 777 /etc/apache2/sites-available/
|
||||
sudo chown -R www-data:www-data /var/www/html/
|
||||
ls -l /var/www/html
|
||||
#ls -l /var/www/html/conf
|
||||
#ls -l /var/www/html/install/
|
||||
set +e
|
||||
sudo cat /etc/apache2/sites-enabled/000-default.conf
|
||||
sudo service apache2 restart
|
||||
curl -I localhost
|
||||
- name: Chech Apache availability
|
||||
run: |
|
||||
echo "Checking webserver availability by a wget -O - --debug http://127.0.0.1"
|
||||
# Ensure we stop on error with set -e
|
||||
set +e
|
||||
ls /var/log/apache2
|
||||
#wget -O - --debug http://127.0.0.1/robots.txt
|
||||
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
|
||||
wget -O - --debug http://127.0.0.1 > $GITHUB_WORKSPACE/test.html 2>&1
|
||||
head -n 200 $GITHUB_WORKSPACE/test.html
|
||||
|
||||
echo Logs are...
|
||||
#sudo cat /tmp/install.log
|
||||
sudo cat /var/log/apache2/access.log
|
||||
sudo cat /var/log/apache2/error.log
|
||||
sudo cat /var/log/apache2/other_vhosts_access.log
|
||||
set +e
|
||||
|
||||
- name: Upgrading Dolibarr
|
||||
run: |
|
||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
|
||||
set -e
|
||||
sudo chmod -R a+rwx $GITHUB_WORKSPACE
|
||||
sudo chmod -R a+rwx /var/www
|
||||
ls -l /var/www
|
||||
cd /var/www/html/install
|
||||
echo Execute upgrade, upgrade2 and step5 for each major version
|
||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade350360.log
|
||||
php upgrade2.php 3.5.0 3.6.0 > $GITHUB_WORKSPACE/upgrade350360-2.log
|
||||
php step5.php 3.5.0 3.6.0 > $GITHUB_WORKSPACE/upgrade350360-3.log
|
||||
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade360370.log
|
||||
php upgrade2.php 3.6.0 3.7.0 > $GITHUB_WORKSPACE/upgrade360370-2.log
|
||||
php step5.php 3.6.0 3.7.0 > $GITHUB_WORKSPACE/upgrade360370-3.log
|
||||
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade370380.log
|
||||
php upgrade2.php 3.7.0 3.8.0 > $GITHUB_WORKSPACE/upgrade370380-2.log
|
||||
php step5.php 3.7.0 3.8.0 > $GITHUB_WORKSPACE/upgrade370380-3.log
|
||||
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade380390.log
|
||||
php upgrade2.php 3.8.0 3.9.0 > $GITHUB_WORKSPACE/upgrade380390-2.log
|
||||
php step5.php 3.8.0 3.9.0 > $GITHUB_WORKSPACE/upgrade380390-3.log
|
||||
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade390400.log
|
||||
php upgrade2.php 3.9.0 4.0.0 > $GITHUB_WORKSPACE/upgrade390400-2.log
|
||||
php step5.php 3.9.0 4.0.0 > $GITHUB_WORKSPACE/upgrade390400-3.log
|
||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade400500.log
|
||||
php upgrade2.php 4.0.0 5.0.0 > $GITHUB_WORKSPACE/upgrade400500-2.log
|
||||
php step5.php 4.0.0 5.0.0 > $GITHUB_WORKSPACE/upgrade400500-3.log
|
||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade500600.log
|
||||
php upgrade2.php 5.0.0 6.0.0 > $GITHUB_WORKSPACE/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $GITHUB_WORKSPACE/upgrade500600-3.log
|
||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade600700.log
|
||||
php upgrade2.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-2.log
|
||||
php step5.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-3.log
|
||||
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade700800.log
|
||||
php upgrade2.php 7.0.0 8.0.0 > $GITHUB_WORKSPACE/upgrade700800-2.log
|
||||
php step5.php 7.0.0 8.0.0 > $GITHUB_WORKSPACE/upgrade700800-3.log
|
||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade800900.log
|
||||
php upgrade2.php 8.0.0 9.0.0 > $GITHUB_WORKSPACE/upgrade800900-2.log
|
||||
php step5.php 8.0.0 9.0.0 > $GITHUB_WORKSPACE/upgrade800900-3.log
|
||||
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade9001000.log
|
||||
php upgrade2.php 9.0.0 10.0.0 > $GITHUB_WORKSPACE/upgrade9001000-2.log
|
||||
php step5.php 9.0.0 10.0.0 > $GITHUB_WORKSPACE/upgrade9001000-3.log
|
||||
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade10001100.log
|
||||
php upgrade2.php 10.0.0 11.0.0 > $GITHUB_WORKSPACE/upgrade10001100-2.log
|
||||
php step5.php 10.0.0 11.0.0 > $GITHUB_WORKSPACE/upgrade10001100-3.log
|
||||
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade11001200.log
|
||||
php upgrade2.php 11.0.0 12.0.0 > $GITHUB_WORKSPACE/upgrade11001200-2.log
|
||||
php step5.php 11.0.0 12.0.0 > $GITHUB_WORKSPACE/upgrade11001200-3.log
|
||||
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade12001300.log
|
||||
php upgrade2.php 12.0.0 13.0.0 > $GITHUB_WORKSPACE/upgrade12001300-2.log
|
||||
php step5.php 12.0.0 13.0.0 > $GITHUB_WORKSPACE/upgrade12001300-3.log
|
||||
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade13001400.log
|
||||
php upgrade2.php 13.0.0 14.0.0 > $GITHUB_WORKSPACE/upgrade13001400-2.log
|
||||
php step5.php 13.0.0 14.0.0 > $GITHUB_WORKSPACE/upgrade13001400-3.log
|
||||
php upgrade.php 14.0.0 15.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade14001500.log
|
||||
php upgrade2.php 14.0.0 15.0.0 > $GITHUB_WORKSPACE/upgrade14001500-2.log
|
||||
php step5.php 14.0.0 15.0.0 > $GITHUB_WORKSPACE/upgrade14001500-3.log
|
||||
php upgrade.php 15.0.0 16.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade15001600.log
|
||||
php upgrade2.php 15.0.0 16.0.0 > $GITHUB_WORKSPACE/upgrade15001600-2.log
|
||||
php step5.php 15.0.0 16.0.0 > $GITHUB_WORKSPACE/upgrade15001600-3.log
|
||||
php upgrade.php 16.0.0 17.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade16001700.log
|
||||
php upgrade2.php 16.0.0 17.0.0 > $GITHUB_WORKSPACE/upgrade16001700-2.log
|
||||
php step5.php 16.0.0 17.0.0 > $GITHUB_WORKSPACE/upgrade16001700-3.log
|
||||
php upgrade.php 17.0.0 18.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade17001800.log
|
||||
php upgrade2.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-2.log
|
||||
php step5.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-3.log
|
||||
|
||||
- name: Result of migration scripts
|
||||
if: always()
|
||||
run: |
|
||||
ls -alrt $GITHUB_WORKSPACE/
|
||||
|
||||
echo Show content of last file
|
||||
cat "$(ls -rt $GITHUB_WORKSPACE/ | tail -n1)"
|
||||
|
||||
- name: Enabling new modules
|
||||
run: |
|
||||
# Enable modules not enabled into original dump
|
||||
set -e
|
||||
cd /var/www/html/install
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE,MAIN_MODULE_EXPENSEREPORT > $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_EMAILCOLLECTOR >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
|
||||
- name: Result of migration scripts
|
||||
if: always()
|
||||
run: |
|
||||
echo Show content of enablemodule.log file
|
||||
cat $GITHUB_WORKSPACE/enablemodule.log
|
||||
|
||||
- name: Unit testing
|
||||
run: |
|
||||
# Ensure we catch errors. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file.
|
||||
set -e
|
||||
cd /var/www/html
|
||||
sudo chmod -R a+rwx /var/www/html/documents
|
||||
includes/bin/phpunit -d memory_limit=-1 -c /var/www/test/phpunit/phpunittest.xml /var/www/test/phpunit/AllTests.php
|
||||
phpunitresult=$?
|
||||
echo "Phpunit return code = $phpunitresult"
|
||||
set +e
|
||||
|
||||
332
.github/workflows/github_ci_php81_mysql.yml
vendored
Normal file
332
.github/workflows/github_ci_php81_mysql.yml
vendored
Normal file
|
|
@ -0,0 +1,332 @@
|
|||
name: GitHub CI PHP 8.1 MySQL
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- 1*
|
||||
- 2*
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
github_ci_php81_mysql:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: password
|
||||
ports:
|
||||
- 32574:3306
|
||||
|
||||
steps:
|
||||
# git clone dolibarr into GITHUB_WORKSPACE = /home/runner/work/dolibarr/dolibarr
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Version PHP
|
||||
run: |
|
||||
php -i | head -
|
||||
|
||||
- name: Install packages for PHP 8.1
|
||||
run: |
|
||||
sudo composer self-update 2.2.18
|
||||
sudo chmod -R a+rwx /home/runner
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
|
||||
sudo add-apt-repository -y ppa:ondrej/php
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y pgloader memcached
|
||||
sudo apt install apache2 php8.1 php8.1-cli php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
php -i | head -
|
||||
|
||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
||||
squizlabs/php_codesniffer ^3
|
||||
sudo rm -fr htdocs/includes/phpunit/php-code-coverage/src/Report/Html
|
||||
|
||||
- name: Adding path of binaries tools installed by composer to the PATH
|
||||
run: |
|
||||
export PATH="$GITHUB_WORKSPACE/htdocs/includes/bin:$PATH"
|
||||
echo $PATH
|
||||
# We must have a directory bin created by the previous composer call
|
||||
ls $GITHUB_WORKSPACE/htdocs/includes/bin
|
||||
|
||||
- name: Version information
|
||||
run: |
|
||||
composer -V
|
||||
# Check Parallel-lint version
|
||||
echo "Parallel-lint version"
|
||||
htdocs/includes/bin/parallel-lint -V
|
||||
# Check PHP CodeSniffer version
|
||||
echo "PHPCS version"
|
||||
htdocs/includes/bin/phpcs --version | head -
|
||||
htdocs/includes/bin/phpcs -i | head -
|
||||
# Check PHP Vardump check version
|
||||
echo "PHP Vardump check version"
|
||||
htdocs/includes/bin/var-dump-check --version
|
||||
# Check PHPUnit version
|
||||
echo "PHPUnit version"
|
||||
htdocs/includes/bin/phpunit --version | head -
|
||||
# Check Apache version
|
||||
echo "Apache version"
|
||||
apache2 -v | head -
|
||||
# Check Database
|
||||
echo "Database version"
|
||||
mysql --version | head -
|
||||
psql --version
|
||||
echo "Check pgloader version"
|
||||
pgloader --version
|
||||
|
||||
- name: Create database
|
||||
run: |
|
||||
pwd
|
||||
echo GITHUB_WORKSPACE = $GITHUB_WORKSPACE
|
||||
sudo apt-get install -y mysql-client
|
||||
mysql --version | head -
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SELECT VERSION();" | head -
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "SHOW DATABASES"
|
||||
echo "Drop and create database"
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -e 'FLUSH PRIVILEGES;'
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
mysql --host 127.0.0.1 --port 32574 -uroot -ppassword -D travis -e "UPDATE llx_const set value = '0666' WHERE name = 'MAIN_UMASK';"
|
||||
- name: Generate Dolibarr conf file
|
||||
run: |
|
||||
export CONF_FILE=$GITHUB_WORKSPACE/htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php' > $CONF_FILE
|
||||
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_document_root=\'/var/www/html\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_data_root=\'/var/www/html/documents\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_user=\'root\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_pass=\'password\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_instance_unique_id=\'travis1234567890\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_port=\'32574\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
|
||||
cat $CONF_FILE
|
||||
- name: Generate install.forced.php file to test installation
|
||||
run: |
|
||||
export INSTALL_FORCED_FILE=$GITHUB_WORKSPACE/htdocs/install/install.forced.php
|
||||
echo "Setting up Dolibarr $INSTALL_FORCED_FILE to test installation"
|
||||
# Ensure we catch errors
|
||||
set +e
|
||||
echo '<?php' > $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_noedit=2';' >> $INSTALL_FORCED_FILE
|
||||
# For mysql
|
||||
echo '$'force_install_type=\'mysqli\'';' >> $INSTALL_FORCED_FILE
|
||||
#echo '$'force_install_type=\'pgsql\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_dbserver=\'127.0.0.1\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_database=\'travis\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_databaselogin=\'root\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_databasepass=\'password\'';' >> $INSTALL_FORCED_FILE
|
||||
# For mysql
|
||||
echo '$'force_install_port=\'32574\'';' >> $INSTALL_FORCED_FILE
|
||||
#echo '$'force_install_port=\'5432\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_prefix=\'llx_\'';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_createdatabase=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_createuser=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_mainforcehttps=false';' >> $INSTALL_FORCED_FILE
|
||||
echo '$'force_install_main_data_root=\'/var/www/html\'';' >> $INSTALL_FORCED_FILE
|
||||
cat $INSTALL_FORCED_FILE
|
||||
|
||||
- name: Create document directory
|
||||
run: |
|
||||
echo "Create documents directory and set permissions"
|
||||
# and admin/temp subdirectory needed for unit tests
|
||||
sudo mkdir -p /var/www/html/documents/admin/temp
|
||||
sudo chmod -R a+rwx /var/www/html/documents
|
||||
sudo echo "***** First line of dolibarr.log" > /var/www/html/documents/dolibarr.log
|
||||
sudo chmod a+rwx /var/www/html/documents/dolibarr.log
|
||||
|
||||
- name: Copy app into /var/www
|
||||
run: |
|
||||
sudo cp -r $GITHUB_WORKSPACE/htdocs/. /var/www/html
|
||||
sudo mv /var/www/html/index.html /var/www/html/index.disabled.html
|
||||
sudo ln -fs /var/www/html /var/www/htdocs
|
||||
sudo cp -r $GITHUB_WORKSPACE/test/. /var/www/test
|
||||
sudo cp -r $GITHUB_WORKSPACE/dev/. /var/www/dev
|
||||
sudo cp -r $GITHUB_WORKSPACE/scripts/. /var/www/scripts
|
||||
|
||||
- name: Setup Apache
|
||||
run: |
|
||||
pwd
|
||||
whoami
|
||||
# install apache web server
|
||||
a2query -s
|
||||
a2query -m
|
||||
ls /etc/apache2/sites-available
|
||||
#sudo cp -f $GITHUB_WORKSPACE/build/travis-ci/apache-githubaction.conf /etc/apache2/sites-available/000-default.conf
|
||||
#sudo sed -e "s?%GITHUB_WORKSPACE%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
|
||||
a2ensite 000-default
|
||||
a2enmod php8.1
|
||||
ls /etc/apache2/sites-enabled
|
||||
sudo adduser $(whoami) www-data
|
||||
sudo adduser $(whoami) root
|
||||
sudo adduser root www-data
|
||||
sudo chown -R www-data:www-data /etc/apache2/sites-available/
|
||||
sudo chmod -R 777 /etc/apache2/sites-available/
|
||||
sudo chown -R www-data:www-data /var/www/html/
|
||||
ls -l /var/www/html
|
||||
#ls -l /var/www/html/conf
|
||||
#ls -l /var/www/html/install/
|
||||
set +e
|
||||
sudo cat /etc/apache2/sites-enabled/000-default.conf
|
||||
sudo service apache2 restart
|
||||
curl -I localhost
|
||||
- name: Chech Apache availability
|
||||
run: |
|
||||
echo "Checking webserver availability by a wget -O - --debug http://127.0.0.1"
|
||||
# Ensure we stop on error with set -e
|
||||
set +e
|
||||
ls /var/log/apache2
|
||||
#wget -O - --debug http://127.0.0.1/robots.txt
|
||||
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
|
||||
wget -O - --debug http://127.0.0.1 > $GITHUB_WORKSPACE/test.html 2>&1
|
||||
head -n 200 $GITHUB_WORKSPACE/test.html
|
||||
|
||||
echo Logs are...
|
||||
#sudo cat /tmp/install.log
|
||||
sudo cat /var/log/apache2/access.log
|
||||
sudo cat /var/log/apache2/error.log
|
||||
sudo cat /var/log/apache2/other_vhosts_access.log
|
||||
set +e
|
||||
|
||||
- name: Upgrading Dolibarr
|
||||
run: |
|
||||
# Ensure we catch errors. Set this to +e if you want to go to the end to see log files.
|
||||
set -e
|
||||
sudo chmod -R a+rwx $GITHUB_WORKSPACE
|
||||
sudo chmod -R a+rwx /var/www
|
||||
ls -l /var/www
|
||||
cd /var/www/html/install
|
||||
echo Execute upgrade, upgrade2 and step5 for each major version
|
||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade350360.log
|
||||
php upgrade2.php 3.5.0 3.6.0 > $GITHUB_WORKSPACE/upgrade350360-2.log
|
||||
php step5.php 3.5.0 3.6.0 > $GITHUB_WORKSPACE/upgrade350360-3.log
|
||||
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade360370.log
|
||||
php upgrade2.php 3.6.0 3.7.0 > $GITHUB_WORKSPACE/upgrade360370-2.log
|
||||
php step5.php 3.6.0 3.7.0 > $GITHUB_WORKSPACE/upgrade360370-3.log
|
||||
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade370380.log
|
||||
php upgrade2.php 3.7.0 3.8.0 > $GITHUB_WORKSPACE/upgrade370380-2.log
|
||||
php step5.php 3.7.0 3.8.0 > $GITHUB_WORKSPACE/upgrade370380-3.log
|
||||
php upgrade.php 3.8.0 3.9.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade380390.log
|
||||
php upgrade2.php 3.8.0 3.9.0 > $GITHUB_WORKSPACE/upgrade380390-2.log
|
||||
php step5.php 3.8.0 3.9.0 > $GITHUB_WORKSPACE/upgrade380390-3.log
|
||||
php upgrade.php 3.9.0 4.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade390400.log
|
||||
php upgrade2.php 3.9.0 4.0.0 > $GITHUB_WORKSPACE/upgrade390400-2.log
|
||||
php step5.php 3.9.0 4.0.0 > $GITHUB_WORKSPACE/upgrade390400-3.log
|
||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade400500.log
|
||||
php upgrade2.php 4.0.0 5.0.0 > $GITHUB_WORKSPACE/upgrade400500-2.log
|
||||
php step5.php 4.0.0 5.0.0 > $GITHUB_WORKSPACE/upgrade400500-3.log
|
||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade500600.log
|
||||
php upgrade2.php 5.0.0 6.0.0 > $GITHUB_WORKSPACE/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $GITHUB_WORKSPACE/upgrade500600-3.log
|
||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade600700.log
|
||||
php upgrade2.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-2.log
|
||||
php step5.php 6.0.0 7.0.0 > $GITHUB_WORKSPACE/upgrade600700-3.log
|
||||
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade700800.log
|
||||
php upgrade2.php 7.0.0 8.0.0 > $GITHUB_WORKSPACE/upgrade700800-2.log
|
||||
php step5.php 7.0.0 8.0.0 > $GITHUB_WORKSPACE/upgrade700800-3.log
|
||||
php upgrade.php 8.0.0 9.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade800900.log
|
||||
php upgrade2.php 8.0.0 9.0.0 > $GITHUB_WORKSPACE/upgrade800900-2.log
|
||||
php step5.php 8.0.0 9.0.0 > $GITHUB_WORKSPACE/upgrade800900-3.log
|
||||
php upgrade.php 9.0.0 10.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade9001000.log
|
||||
php upgrade2.php 9.0.0 10.0.0 > $GITHUB_WORKSPACE/upgrade9001000-2.log
|
||||
php step5.php 9.0.0 10.0.0 > $GITHUB_WORKSPACE/upgrade9001000-3.log
|
||||
php upgrade.php 10.0.0 11.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade10001100.log
|
||||
php upgrade2.php 10.0.0 11.0.0 > $GITHUB_WORKSPACE/upgrade10001100-2.log
|
||||
php step5.php 10.0.0 11.0.0 > $GITHUB_WORKSPACE/upgrade10001100-3.log
|
||||
php upgrade.php 11.0.0 12.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade11001200.log
|
||||
php upgrade2.php 11.0.0 12.0.0 > $GITHUB_WORKSPACE/upgrade11001200-2.log
|
||||
php step5.php 11.0.0 12.0.0 > $GITHUB_WORKSPACE/upgrade11001200-3.log
|
||||
php upgrade.php 12.0.0 13.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade12001300.log
|
||||
php upgrade2.php 12.0.0 13.0.0 > $GITHUB_WORKSPACE/upgrade12001300-2.log
|
||||
php step5.php 12.0.0 13.0.0 > $GITHUB_WORKSPACE/upgrade12001300-3.log
|
||||
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade13001400.log
|
||||
php upgrade2.php 13.0.0 14.0.0 > $GITHUB_WORKSPACE/upgrade13001400-2.log
|
||||
php step5.php 13.0.0 14.0.0 > $GITHUB_WORKSPACE/upgrade13001400-3.log
|
||||
php upgrade.php 14.0.0 15.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade14001500.log
|
||||
php upgrade2.php 14.0.0 15.0.0 > $GITHUB_WORKSPACE/upgrade14001500-2.log
|
||||
php step5.php 14.0.0 15.0.0 > $GITHUB_WORKSPACE/upgrade14001500-3.log
|
||||
php upgrade.php 15.0.0 16.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade15001600.log
|
||||
php upgrade2.php 15.0.0 16.0.0 > $GITHUB_WORKSPACE/upgrade15001600-2.log
|
||||
php step5.php 15.0.0 16.0.0 > $GITHUB_WORKSPACE/upgrade15001600-3.log
|
||||
php upgrade.php 16.0.0 17.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade16001700.log
|
||||
php upgrade2.php 16.0.0 17.0.0 > $GITHUB_WORKSPACE/upgrade16001700-2.log
|
||||
php step5.php 16.0.0 17.0.0 > $GITHUB_WORKSPACE/upgrade16001700-3.log
|
||||
php upgrade.php 17.0.0 18.0.0 ignoredbversion > $GITHUB_WORKSPACE/upgrade17001800.log
|
||||
php upgrade2.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-2.log
|
||||
php step5.php 17.0.0 18.0.0 > $GITHUB_WORKSPACE/upgrade17001800-3.log
|
||||
|
||||
- name: Result of migration scripts
|
||||
if: always()
|
||||
run: |
|
||||
ls -alrt $GITHUB_WORKSPACE/
|
||||
|
||||
echo Show content of last file
|
||||
cat "$(ls -rt $GITHUB_WORKSPACE/ | tail -n1)"
|
||||
|
||||
- name: Enabling new modules
|
||||
run: |
|
||||
# Enable modules not enabled into original dump
|
||||
set -e
|
||||
cd /var/www/html/install
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE,MAIN_MODULE_EXPENSEREPORT > $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_EMAILCOLLECTOR >> $GITHUB_WORKSPACE/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
|
||||
- name: Result of migration scripts
|
||||
if: always()
|
||||
run: |
|
||||
echo Show content of enablemodule.log file
|
||||
cat $GITHUB_WORKSPACE/enablemodule.log
|
||||
|
||||
- name: Unit testing
|
||||
run: |
|
||||
# Ensure we catch errors. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file.
|
||||
set -e
|
||||
cd /var/www/html
|
||||
sudo chmod -R a+rwx /var/www/html/documents
|
||||
includes/bin/phpunit -d memory_limit=-1 -c /var/www/test/phpunit/phpunittest.xml /var/www/test/phpunit/AllTests.php
|
||||
phpunitresult=$?
|
||||
echo "Phpunit return code = $phpunitresult"
|
||||
set +e
|
||||
|
||||
- name: Code quality check - Lint
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
htdocs/includes/bin/parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --exclude htdocs/includes/webklex --blame .
|
||||
|
||||
- name: Code quality check - phpcs
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
htdocs/includes/bin/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 .;
|
||||
|
||||
- name: Code quality check - var-dump-check
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
htdocs/includes/bin/var-dump-check --extensions php --tracy --exclude htdocs/includes --exclude test/ --exclude htdocs/public/test/ --exclude htdocs/core/lib/functions.lib.php .
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -58,3 +58,10 @@ package-lock.json
|
|||
|
||||
doc/install.lock
|
||||
/.asciidoctorconfig.adoc
|
||||
|
||||
# Qodana
|
||||
.idea/vcs.xml
|
||||
.idea/modules.xml
|
||||
.idea/workspace.xml
|
||||
.idea/inspectionProfiles/Project_Default.xml
|
||||
.idea/jsLinters/jshint.xml
|
||||
198
.travis.yml
198
.travis.yml
|
|
@ -2,11 +2,11 @@
|
|||
# from Dolibarr GitHub repository.
|
||||
# For syntax, see https://docs.travis-ci.com/user/languages/php/
|
||||
|
||||
# We use dist: bionic = 18.04
|
||||
# We use dist: bionic = 18.04, focal = 20.04
|
||||
os: linux
|
||||
dist: bionic
|
||||
dist: focal
|
||||
|
||||
language: php
|
||||
language: generic
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
|
@ -18,46 +18,25 @@ services:
|
|||
- postgresql
|
||||
|
||||
|
||||
before_install:
|
||||
- |
|
||||
echo "Add ondrej PPA"
|
||||
sudo add-apt-repository -y ppa:ondrej/php
|
||||
sudo apt-get update
|
||||
echo "Disabling Xdebug for composer"
|
||||
export PHP_VERSION_NAME=$(phpenv version-name)
|
||||
echo $PHP_VERSION_NAME
|
||||
ls ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
||||
phpenv config-rm xdebug.ini
|
||||
phpenv rehash
|
||||
echo
|
||||
|
||||
addons:
|
||||
#addons:
|
||||
# Force postgresql version
|
||||
postgresql: '10'
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ondrej/php'
|
||||
packages:
|
||||
#postgresql: '10'
|
||||
#apt:
|
||||
#sources:
|
||||
#- sourceline: 'ppa:ondrej/php'
|
||||
#update: true
|
||||
#packages:
|
||||
# We need a webserver to test the webservices
|
||||
# Let's install Apache with.
|
||||
- apache2
|
||||
#- apache2
|
||||
# We need pgloader for import mysql database into pgsql
|
||||
- pgloader
|
||||
- php
|
||||
- php7.1-pgsql
|
||||
- php7.1-mysqli
|
||||
- php7.1-xml
|
||||
- php7.1-intl
|
||||
- php8.1-pgsql
|
||||
- php8.1-mysqli
|
||||
- php8.1-xml
|
||||
- php8.1-intl
|
||||
- php8.2-pgsql
|
||||
- php8.2-mysqli
|
||||
- php8.2-xml
|
||||
- php8.2-intl
|
||||
|
||||
#- pgloader
|
||||
#- php8.1
|
||||
#- php8.1-pgsql
|
||||
#- php8.1-mysqli
|
||||
#- php8.1-xml
|
||||
#- php8.1-intl
|
||||
|
||||
env:
|
||||
global:
|
||||
# Set to true for very verbose output
|
||||
|
|
@ -71,15 +50,19 @@ jobs:
|
|||
- stage: PHP 7.0-8.1
|
||||
if: type = push
|
||||
php: '7.1'
|
||||
env: DB=postgresql
|
||||
env:
|
||||
- DB=postgresql
|
||||
- TRAVIS_PHP_VERSION=7.1
|
||||
- stage: PHP 7.0-8.1
|
||||
if: type = pull_request OR type = push
|
||||
php: '8.1'
|
||||
env: DB=mysql
|
||||
- stage: PHP Dev
|
||||
if: type = push AND branch = developdisabled
|
||||
php: '8.2'
|
||||
env: DB=mysql
|
||||
env:
|
||||
- DB=mysql
|
||||
- TRAVIS_PHP_VERSION=8.1
|
||||
#- stage: PHP Dev
|
||||
# if: type = push AND branch = developdisabled
|
||||
# php: '8.2'
|
||||
# env: DB=mysql
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
|
@ -93,22 +76,59 @@ notifications:
|
|||
use_notice: true
|
||||
|
||||
|
||||
before_install:
|
||||
- |
|
||||
echo "Remove awful phpenv and install packages"
|
||||
sudo rm -fr ~/.phpenv
|
||||
sudo rm -fr /root/.phpenv
|
||||
sudo add-apt-repository -y ppa:ondrej/php
|
||||
sudo apt-get update
|
||||
echo TRAVIS_PHP_VERSION=$TRAVIS_PHP_VERSION
|
||||
|
||||
- |
|
||||
echo Install packages for PHP
|
||||
sudo apt-get install -y pgloader memcached
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
|
||||
sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
|
||||
sudo apt install unzip apache2 php8.1 php8.1-cli php8.1-curl php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1
|
||||
fi
|
||||
|
||||
- |
|
||||
echo Install packages for PHP
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
psql -U postgres -h 127.0.0.1 -c 'create database travis_ci_test;'
|
||||
psql -U postgres -h 127.0.0.1 -c 'create database travis;'
|
||||
fi
|
||||
|
||||
install:
|
||||
- |
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php7.1
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
fi
|
||||
php -i | head -
|
||||
|
||||
- |
|
||||
echo "Updating Composer config"
|
||||
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
|
||||
HASH=`curl -sS https://composer.github.io/installer.sig`
|
||||
echo $HASH
|
||||
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||
sudo chmod -R a+rwx /usr/local/bin/composer
|
||||
composer -V
|
||||
#rm $TRAVIS_BUILD_DIR/composer.json
|
||||
#rm $TRAVIS_BUILD_DIR/composer.lock
|
||||
#composer -n init
|
||||
#composer -n config vendor-dir htdocs/includes
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Update Composer version and Install tools - PHP Unit, Parallel Lint, PHP CodeSniffer, PHP Vardump check - for $TRAVIS_PHP_VERSION"
|
||||
echo "(version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)"
|
||||
echo "(composer version 2.5 is bugged and generate phpunit error Exception: Serialization of 'Closure' is not allowed)"
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||
composer self-update 2.2.18
|
||||
sudo composer self-update 2.2.18
|
||||
composer -n require phpunit/phpunit ^7.5 \
|
||||
php-parallel-lint/php-parallel-lint ^1 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
|
|
@ -116,7 +136,7 @@ install:
|
|||
squizlabs/php_codesniffer ^3
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||
composer self-update 2.2.18
|
||||
sudo composer self-update 2.2.18
|
||||
composer -n require phpunit/phpunit ^7.5 \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
|
|
@ -125,13 +145,14 @@ install:
|
|||
fi
|
||||
# phpunit 9 is required for php 8
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
composer self-update 2.4.4
|
||||
sudo composer self-update 2.4.4
|
||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^8 \
|
||||
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||
php-parallel-lint/php-console-highlighter ^0 \
|
||||
php-parallel-lint/php-var-dump-check ~0.4 \
|
||||
squizlabs/php_codesniffer ^3
|
||||
fi
|
||||
|
||||
# Remove non expected files
|
||||
rm -fr /home/travis/build/Dolibarr/dolibarr/htdocs/includes/phpunit/php-code-coverage/src/Report/Html/Renderer/Template/js
|
||||
echo
|
||||
|
|
@ -140,7 +161,7 @@ install:
|
|||
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||
echo $PATH
|
||||
ls $TRAVIS_BUILD_DIR/vendor
|
||||
ls $TRAVIS_BUILD_DIR/htdocs/includes
|
||||
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
|
||||
echo
|
||||
|
||||
|
|
@ -153,19 +174,6 @@ before_script:
|
|||
echo Home dir is `echo ~`
|
||||
echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR
|
||||
|
||||
- |
|
||||
echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit"
|
||||
phpenv config-add /tmp/xdebug.ini
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Setting up PHP"
|
||||
echo
|
||||
echo "Set timezone"
|
||||
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
phpenv rehash
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Versions information"
|
||||
echo
|
||||
|
|
@ -195,11 +203,13 @@ before_script:
|
|||
# Check Database
|
||||
echo "Database version"
|
||||
mysql --version | head -
|
||||
mysql -e "SELECT VERSION();" | head -
|
||||
psql --version
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
echo "Check pgloader version"
|
||||
pgloader --version
|
||||
ps fauxww | grep postgres
|
||||
ls /etc/postgresql/13/main/
|
||||
sudo cat /etc/postgresql/11/main/pg_hba.conf
|
||||
fi
|
||||
echo
|
||||
|
||||
|
|
@ -208,7 +218,8 @@ before_script:
|
|||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
|
||||
echo "MySQL"
|
||||
mysql -u root -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql -u root -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
||||
mysql -u root -e 'CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8';'
|
||||
mysql -u root -e "CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password';"
|
||||
mysql -u root -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
mysql -u root -e 'FLUSH PRIVILEGES;'
|
||||
mysql -u root -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
|
|
@ -217,10 +228,14 @@ before_script:
|
|||
#psql -c 'create database travis;' -U postgres
|
||||
#psql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
#pgloader mysql://root:pass@127.0.0.1/dolibarr_src postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dest
|
||||
echo pgloader mysql://root@127.0.0.1/travis postgresql://postgres@/travis
|
||||
pgloader mysql://root@127.0.0.1/travis postgresql://postgres@/travis
|
||||
echo sudo pgloader mysql://root@127.0.0.1/travis postgresql://postgres:postgres@127.0.0.1:5432/travis
|
||||
sudo mkdir -p /tmp/pgloader
|
||||
sudo chmod -R a+rwx /tmp/pgloader/
|
||||
sudo pgloader mysql://root@127.0.0.1/travis postgresql://postgres:postgres@127.0.0.1:5432/travis
|
||||
echo 'ALTER SEQUENCE llx_accountingaccount_rowid_seq RENAME TO llx_accounting_account_rowid_seq' | psql -U postgres travis
|
||||
echo 'ALTER SEQUENCE llx_accounting_account_rowid_seq RESTART WITH 1000001;' | psql -U postgres travis
|
||||
# Create pgsql compatibility functions
|
||||
psql -U postgres travis < htdocs/install/pgsql/functions/functions.sql
|
||||
fi
|
||||
echo
|
||||
|
||||
|
|
@ -256,24 +271,24 @@ before_script:
|
|||
echo
|
||||
|
||||
|
||||
- echo "Setting up Apache + FPM"
|
||||
- echo "Setting up Apache"
|
||||
# setup link for php legacy
|
||||
- sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php
|
||||
#- sudo ln -s ~/.phpenv/versions/$(phpenv version-name)/bin/php /bin/php
|
||||
# install apache web server
|
||||
- sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php
|
||||
#- sudo apt-get install apache2 php-fpm php-mysql php-pgsql php-gd php-ldap php-xml php-mbstring libapache2-mod-php
|
||||
# enable php-fpm
|
||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||
- |
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
- sudo a2enmod proxy_fcgi rewrite setenvif cgi alias
|
||||
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
#- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||
#- |
|
||||
# if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ] || [ "$TRAVIS_PHP_VERSION" = '8.0' ] || [ "$TRAVIS_PHP_VERSION" = '8.1' ] || [ "$TRAVIS_PHP_VERSION" = '8.2' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# # Copy the included pool
|
||||
# sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf
|
||||
# fi
|
||||
#- sudo a2enmod proxy_fcgi rewrite setenvif cgi alias
|
||||
#- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
|
||||
#- sudo chown -R travis:travis /var/lib/apache2/fastcgi
|
||||
# start php-fpm
|
||||
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
||||
#- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
||||
# configure apache virtual hosts
|
||||
- sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/000-default.conf
|
||||
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
|
||||
|
|
@ -284,11 +299,11 @@ before_script:
|
|||
|
||||
script:
|
||||
- |
|
||||
echo "Checking webserver availability by a wget -O - http://127.0.0.1"
|
||||
echo "Checking webserver availability by a wget -O - --debug http://127.0.0.1"
|
||||
# Ensure we stop on error with set -e
|
||||
set +e
|
||||
# The wget should return a page with line '<meta name="generator" content="Dolibarr installer">
|
||||
wget -O - http://127.0.0.1 > test.html
|
||||
wget -O - --debug http://127.0.0.1 > test.html
|
||||
head test.html
|
||||
sudo cat /var/log/apache2/travis_error_log
|
||||
set +e
|
||||
|
|
@ -298,7 +313,6 @@ script:
|
|||
echo "Checking PHP syntax errors (only 1 version to not overload travis and avoid duplicate tests)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PHP_VERSION" = "8.1" ]; then
|
||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
|
|
@ -459,6 +473,9 @@ script:
|
|||
php upgrade2.php 17.0.0 18.0.0 > $TRAVIS_BUILD_DIR/upgrade17001800-2.log
|
||||
php step5.php 17.0.0 18.0.0 > $TRAVIS_BUILD_DIR/upgrade17001800-3.log
|
||||
ls -alrt $TRAVIS_BUILD_DIR/
|
||||
echo
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade17001800.log
|
||||
#cat $TRAVIS_BUILD_DIR/upgrade17001800-2.log
|
||||
|
||||
- |
|
||||
echo "Enabling new modules"
|
||||
|
|
@ -468,6 +485,7 @@ script:
|
|||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_EMAILCOLLECTOR >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
set +e
|
||||
|
|
@ -492,7 +510,7 @@ after_script:
|
|||
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
echo "After script - Output last lines of apache error.log"
|
||||
sudo ls /var/log/apache2
|
||||
sudo tail -n 50 /var/log/apache2/travis_error_log
|
||||
sudo tail -n 200 /var/log/apache2/travis_error_log
|
||||
|
||||
after_success:
|
||||
- |
|
||||
|
|
@ -510,14 +528,14 @@ after_failure:
|
|||
done
|
||||
# Show Apache log file
|
||||
echo "Debugging informations for file apache error.log"
|
||||
sudo tail -n 50 /var/log/apache2/travis_error_log
|
||||
sudo tail -n 200 /var/log/apache2/travis_error_log
|
||||
if [ "$DEBUG" = true ]; then
|
||||
# Dolibarr log file
|
||||
echo "Debugging informations for file dolibarr.log (latest 50 lines)"
|
||||
tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
tail -n 200 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||
# Database log file
|
||||
echo "Debugging informations for file mysql error.log"
|
||||
sudo tail -n 50 /var/log/mysql/error.log
|
||||
sudo tail -n 200 /var/log/mysql/error.log
|
||||
# TODO: PostgreSQL log file
|
||||
echo
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -40,13 +40,15 @@ PHPPrintIPP 1.3 GPL-2+ Yes
|
|||
PSR/Logs 1.0 MIT License Yes Library for logs (used by DebugBar)
|
||||
PSR/simple-cache ? MIT License Yes Library for cache (used by PHPSpreadSheet)
|
||||
Restler 3.1.1 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||
Sabre 3.2.2 BSD Yes DAV support
|
||||
Sabre 4.0.2 BSD Yes DAV support
|
||||
Swift Mailer 5.4.2-DEV MIT License Yes Comprehensive mailing tools for PHP
|
||||
Symfony/var-dumper ??? MIT License Yes Library to make var dump (used by DebugBar)
|
||||
Stripe 10.7.0 MIT Licence Yes Library for Stripe module
|
||||
TCPDF 6.3.2 LGPL-3+ Yes PDF generation
|
||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||
|
||||
bacon, dasprid, swiss-qr-bill, kmukku, symfony/validator
|
||||
|
||||
JS libraries:
|
||||
Ace 1.4.14 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||
ChartJS 3.7.1 MIT License Yes JS library for graph
|
||||
|
|
|
|||
432
ChangeLog
432
ChangeLog
|
|
@ -2,8 +2,225 @@
|
|||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 17.0.2 compared to 17.0.1 *****
|
||||
|
||||
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
||||
|
||||
For uses:
|
||||
---------
|
||||
|
||||
NEW: PHP 8.2 compatibility (test not yet completed).
|
||||
NEW: Module Workstations Management upgraded to stable status.
|
||||
NEW: Module Webhook upgraded to stable status
|
||||
NEW: #23436 Group social networks fields
|
||||
NEW: Accountancy - Add specific page to export accounting data rather than the journals page
|
||||
NEW: Accountancy - Add sub-account balance FPC22
|
||||
NEW: Accountancy - Manage customer retained warranty FPC21+
|
||||
NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22
|
||||
NEW: Accountancy - iSuiteExpert export model
|
||||
NEW: Accountancy - Quadratus export with attachments in accountancy export
|
||||
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
|
||||
NEW: authentication mode: #22740 Add OpenID Connect impl
|
||||
NEW: authentication mode: Add experimental support for Google OAuth2 connexion
|
||||
NEW: Add a public virtual card page for each user
|
||||
NEW: Add a status on supplier price ref (WIP to close a supplier ref)
|
||||
NEW: add bookmarks in selectable landing pages for users
|
||||
NEW: Add column ext_payment_site into societe_rib to allow multiple payment mode
|
||||
NEW: add convertion of images to webp for a single image in website media editor
|
||||
NEW: Add CRC for currency symbol before amount
|
||||
NEW: add customer code to invoices listing
|
||||
NEW: Add Customer Order delivered (ORDER_NEW) in module Notification
|
||||
NEW: Add date due and labels into customer comm card
|
||||
NEW: Add filter on nb of generation done in list of recurring invoices
|
||||
NEW: Add filters and sort on product unit column
|
||||
NEW: adding button Send Email on the salary file
|
||||
NEW: Add link to edit VAT list from error message of missing VAT
|
||||
NEW: add margins in paiement/card.php
|
||||
NEW: Add mass action delete on VAT
|
||||
NEW: Add origin info when create a product batch when created from a movement stock
|
||||
NEW: Add possibility to choose format #21426
|
||||
NEW: Add SQL contraint on product_stock table to allow only exsting product and warehouse #23543
|
||||
NEW: Add STRIPE_DEBUG, a way to log Stripe IPN
|
||||
NEW: An external module can modify the quick search fields
|
||||
NEW: Auto activate some modules on install (Export/Import/Wysiwyg editor)
|
||||
NEW: Autofill email form with the email template with status "Default" on
|
||||
NEW: Bank name no more mandatory on creation. Can be generated if empty.
|
||||
NEW: Bank: Add fields zip, town, country for owner of a bank account
|
||||
NEW: batch referential objets
|
||||
NEW: Better responsive for mass actions
|
||||
NEW: Can add any contact on events if global MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is set at 1
|
||||
NEW: Can add the add now link on date into addfieldvalue()
|
||||
NEW: Can bin accounting line for a given month
|
||||
NEW: Can edit account on miscellaneous payment (if not transfered)
|
||||
NEW: Can edit inline the VAT number from supplier tab
|
||||
NEW: Can fill date of salary payment with date of start of salary
|
||||
NEW: Can filter on a custom group of accounts. Perf or ledger list.
|
||||
NEW: Can go back to draft on shipment when stock change not on validate
|
||||
NEW: Can modify bank account of sepa payment (if file not sent yet)
|
||||
NEW: Salary: Can modify the date of payment of a salary (if not reconciled)
|
||||
NEW: OAuth: Can now edit service name for oauth token
|
||||
NEW: Reception: Can receive more than qty ordered on reception
|
||||
NEW: Can select the export format during export of journals
|
||||
NEW: Can set a checkbox in formconfirm by clicking on the label
|
||||
NEW: Can set background style with MAIN_LOGIN_BACKGROUND_STYLE
|
||||
NEW: Can set flag default value on email templates
|
||||
NEW: Can set the page "List of opportunities" as landing page
|
||||
NEW: Can show the sql request used on emailing selection
|
||||
NEW: can stay on edit field when errors occurs
|
||||
NEW: category of operation for crabe PDF model
|
||||
NEW: comment in api_mymodule for seperate methods
|
||||
NEW: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT
|
||||
NEW: create email substitution variable for intervention signature URL
|
||||
NEW: Date for salary payment includes the hour/min
|
||||
NEW: Debug the custom CSS feature to avoid a directory search/scan at
|
||||
NEW: dev name
|
||||
NEW: Disable bad reputation product price
|
||||
NEW: dolExplodeIntoArray can accept regex
|
||||
NEW: dol_sort_array can sort on alphabetical order even if val is num
|
||||
NEW: Email: don't have closed contact proposed as receiver for the mails
|
||||
NEW: element time integration code + SQL
|
||||
NEW: Email-Collector: Add field reply-to in email collector as possible filter
|
||||
NEW: Email-Collector: substitute date now in email collector
|
||||
NEW: events list with color
|
||||
NEW: expend/collapse list of social networks
|
||||
NEW: Filter on amount and qty on list of service's contracts
|
||||
NEW: formconfirm can support field with format datetime
|
||||
NEW: getCommonSubstitutionArray to have more substitute keys
|
||||
NEW: GeoIP: Can test a geoip conversion from the geoip setup page
|
||||
NEW: GUI: add a CSS editor into the admin GUI
|
||||
NEW: GUI: add dropdown button actions (example on Create button on project)
|
||||
NEW: GUI: color for start date and owner
|
||||
NEW: GUI: new tab for reception and shipment
|
||||
NEW: GUI: better design for the page of discounts of a thirdparty
|
||||
NEW: Help: Tooltip to explain how to add a photo on a product
|
||||
NEW: Help: Possibility to link to German pages in help
|
||||
NEW: helper functions for dates + small demo case
|
||||
NEW: hook printFieldListFrom in contact list
|
||||
NEW: Import: filter on entity in import
|
||||
NEW: inc.php: handle parameters from argv
|
||||
NEW: Invoice - show category of operations
|
||||
NEW: Keep a link between user created from recruitment and application
|
||||
NEW: List product in orders
|
||||
NEW: map table to element for get entity in import
|
||||
NEW: Members: add numbering modules for members
|
||||
NEW: Members: add widget box_members_by_tags.php
|
||||
NEW: Members: Captcha for public member's subscription form
|
||||
NEW: migration script + delete old table + rename fields and indexes
|
||||
NEW: MRP MO: Dynamic choice of warehouse and batch in MO production.
|
||||
NEW: Multicurrency REST API to create, update, delete, update rate...
|
||||
NEW: Multiselect for filter on prospection status
|
||||
NEW: [Bulk delete Project tasks]
|
||||
NEW: No overwrite of optionals during put() contact
|
||||
NEW: Notification for Sign or Refused Propal from Online Page
|
||||
NEW: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR)
|
||||
NEW: Now we can edit amount on VAT and salaries clone action
|
||||
NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver
|
||||
NEW: operation type in email collector to load or create contact
|
||||
NEW: option filter for NoSalesRepresentativeAffected in proposals list
|
||||
NEW: Option to manage deposit slips for more payment modes (not only
|
||||
NEW: Option to show column for field and line selection on the left
|
||||
NEW: Orders: add sub total in order list det
|
||||
NEW: Orders export: allow to export field 'shipment method'.
|
||||
NEW: payment default values when supplier order created from reception
|
||||
NEW: Payment : manage contracts
|
||||
NEW: presend mass action in contact list
|
||||
NEW: Print PDF: Name and date to print on PDF Sign
|
||||
NEW: Print PDF: Use the more recent PDF templates for documents by default on a fresh install
|
||||
NEW: product images on popup are cached
|
||||
NEW: Products: Add statistics by amount on statistics of products.
|
||||
NEW: Proposals: filter for Signed+Billed in proposals
|
||||
NEW: Proposals: can modify margin rates in offers like VAT rates
|
||||
NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key
|
||||
NEW: referential objects of batch
|
||||
NEW: remove default percentage for event creation url
|
||||
NEW: remove keys whose table element is the same as element in map list
|
||||
NEW: repair script skip views
|
||||
NEW: Security: Save date to invalidate other session into user table
|
||||
NEW: Security: Invalidate all sessions of a user when password is modified.
|
||||
NEW: search on time spent duration range
|
||||
NEW: sepaStripe now creates the payment mode with type pm_ using new API
|
||||
NEW: set payment default values when supplier order created from reception
|
||||
NEW: set today start time at beginning
|
||||
NEW: Setup emailcollector easier. Can also use ! for negative search.
|
||||
NEW: Show counter of access of website in website list
|
||||
NEW: Show main currency in company info user tooltip
|
||||
NEW: Show module into list of emails templates
|
||||
NEW: Show picto into the combobox of widgets
|
||||
NEW: Show supplier invoice ref of direct debit transfer tab invoices
|
||||
NEW: show supplier name in getNomUrl of supplier order
|
||||
NEW: sort of column of custom group of account
|
||||
NEW: Supplier Invoices: add ability of ODT support to supplier invoices
|
||||
NEW: Stock limit for alert and desired optimal stock by product and warehouse import
|
||||
NEW: Stock: Add warehouse create and modify triggers.
|
||||
NEW: Stock: Can select several warehouses into the view stock at date in past
|
||||
NEW: Support different bank account for several direct debit payments
|
||||
NEW: Support multiselect in the warehouse selection combo box
|
||||
NEW: Support option MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
|
||||
NEW: Survey: Comment on survey is possible only after vote.
|
||||
NEW: table llx_element_time to store time spent on several elements (mo, ticket...)
|
||||
NEW: TakePOS: adapt category and product pictures sizes on TakePOS
|
||||
NEW: TakePOS: limit load products in TakePOS
|
||||
NEW: The batch for remind on due date can be setup for using validation date
|
||||
NEW: The refresh link for imap collector is always visible
|
||||
NEW: The upgrade process can be done by creating a file upgrade.unlock
|
||||
NEW: Tickets: --Send an email when ticket assigned--
|
||||
NEW: Tickets: Send a notification email when ticket assigned
|
||||
NEW: Tickets: set ticket status to answered if the client has answered from the public interface
|
||||
NEW: Tickets: added an option to display the progress of tickets on the public interface
|
||||
NEW: Tickets: add link to thirdparty tickets history
|
||||
NEW: Use a cache file for external RSS in calendar
|
||||
NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO
|
||||
NEW: use more recent model by default
|
||||
NEW: VAT can be modified during add of line
|
||||
NEW: Website Module: Increment website counter on each page access in website module
|
||||
NEW: write all fields and their properties in asciidoc format
|
||||
NEW: Can add an array of several links in date selector
|
||||
NEW: Option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF
|
||||
NEW: Option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF
|
||||
NEW: Widgets: Implement MAIN_ACTIVATE_FILECACHE on birthday widget
|
||||
NEW: Widgets: Add widget "The next upcoming events"
|
||||
NEW: Widgets: Add widget of open opportunities
|
||||
NEW: Use an ajax component to swith prospection status on thirdparty list
|
||||
NEW: Add partial payment reason "withholding tax"
|
||||
|
||||
|
||||
|
||||
For developers or integrators:
|
||||
------------------------------
|
||||
|
||||
NEW: Make it possible to select hours and minutes in form_confirm
|
||||
NEW: add triggers on mailing
|
||||
NEW: Add a trigger when create a shipping line batch and fix propagate missing errors
|
||||
NEW: add function for listiong objects from directory
|
||||
NEW: add helplist property to describe fields of objects
|
||||
NEW: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign
|
||||
NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe.
|
||||
NEW: Support contact in post() document API
|
||||
NEW: More APIs (update currency rate, upload of supplier documents, ...)
|
||||
NEW: ModuleBuilder: updating in modulbuilder on tab Menu when adding object
|
||||
NEW: ModuleBuilder: add/edit permissions
|
||||
NEW: ModuleBuilder: better generated documentation
|
||||
NEW: add sent info in the parameters provided to the hook sendMailAfter
|
||||
NEW: add setAsSelectUser into factory for generic setup page
|
||||
NEW: add option keepspace into dol_string_nospecialchar()
|
||||
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Minimal PHP version is now PHP 7.1 instead of PHP 7.0
|
||||
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
||||
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
||||
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
||||
* Deprecated property libelle removed from entrepot class.
|
||||
* The type 'text' in ->fields property does not accept html content anymore. Use the type 'html' for that.
|
||||
* The module for WebService SOAP API have been deprecated. Use instead the Webservice REST API module.
|
||||
* The method htmlPrintOnlinePaymentFooter() used for public footer pages has been renamed into htmlPrintOnlineFooter() and moved into company.lib.php
|
||||
* The method getCheckOption() and deleteCPUser() of class Holiday has been removed (it was not used)
|
||||
|
||||
|
||||
***** ChangeLog for 17.0.2 compared to 17.0.1 *****
|
||||
FIX: Change strpos for expedition and receipt in files.lib $haystack and $needle inversion
|
||||
FIX: Add hidden conf to add extrafields in canelle template : INVOICE_ADD_EXTRAFIELD_IN_NOTE
|
||||
FIX: #24414
|
||||
FIX: #24798 Deleting member subscription is not possible
|
||||
FIX: add a test for updating date on task update in tab time consummed pro…
|
||||
|
|
@ -84,219 +301,6 @@ FIX: Warehouse total line
|
|||
FIX: When salary module is not enabled, bad permission check on user list
|
||||
FIX: wrong colspan for tasks list
|
||||
|
||||
***** ChangeLog for 18.0.0 compared to 17.0.0 *****
|
||||
|
||||
For uses:
|
||||
---------
|
||||
|
||||
NEW: PHP 8.2 compatibility (test not yet completed).
|
||||
NEW: Module Workstations Management upgraded to stable status
|
||||
NEW: Module Webhook upgraded to stable status
|
||||
NEW: #23436 Group social networks fields
|
||||
NEW: Accountancy - Add specific page to export accounting data rather than the journals page
|
||||
NEW: Accountancy - Add sub-account balance FPC22
|
||||
NEW: Accountancy - Manage customer retained warranty FPC21+
|
||||
NEW: Accountancy - Manage intra-community VAT on supplier invoices - FPC22
|
||||
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
|
||||
NEW: authentication mode: #22740 Add OpenID Connect impl
|
||||
NEW: authentication mode: Add experimental support for Google OAuth2 connexion
|
||||
NEW: adapt category and product pictures sizes on TakePOS
|
||||
NEW: Supplier Invoices: add ability of ODT support to supplier invoices
|
||||
NEW: Add a public virtual card page for each user
|
||||
NEW: Add a status on supplier price ref (WIP to close a supplier ref)
|
||||
NEW: add bookmarks in selectable landing pages for users
|
||||
NEW: Add column ext_payment_site into societe_rib to allow multiple payment mode
|
||||
NEW: add convertion of images to webp for a single image in website media editor
|
||||
NEW: Add CRC for currency symbol before amount
|
||||
NEW: add a CSS editor into the admin GUI
|
||||
NEW: add customer code to invoices listing
|
||||
NEW: Add Customer Order delivered (ORDER_NEW) in module Notification
|
||||
NEW: Add date due and labels into customer comm card
|
||||
NEW: Add dropdown button actions (example on Create button on project)
|
||||
NEW: Tickets: added an option to display the progress of tickets on the public interface
|
||||
NEW: Add field reply-to in email collector as possible filter
|
||||
NEW: Add filter on nb of generation done in list of recurring invoices
|
||||
NEW: Add filters and sort on product unit column
|
||||
NEW: adding button Send Email on the salary file
|
||||
NEW: Add link to edit VAT list from error message of missing VAT
|
||||
NEW: add link to thirdparty tickets history
|
||||
NEW: add margins in paiement/card.php
|
||||
NEW: Add mass action delete on VAT
|
||||
NEW: Add fields zip, town, country for owner of a bank account
|
||||
NEW: Members: add numbering modules for members
|
||||
NEW: Add origin info when create a product batch when created from a movement stock
|
||||
NEW: Add possibility to choose format #21426
|
||||
NEW: Add SQL contraint on product_stock table to allow only exsting product and warehouse#23543
|
||||
NEW: Add statistics by amount on statistics of products.
|
||||
NEW: Add STRIPE_DEBUG, a way to log Stripe IPN
|
||||
NEW: Add sub total in order list det
|
||||
NEW: Add warehouse create and modify triggers.
|
||||
NEW: Add widget box_members_by_tags.php
|
||||
NEW: An external module can modify the quick search fields
|
||||
NEW: Auto activate some modules on install (Export/Import/Wysiwyg editor)
|
||||
NEW: Autofill email form with the email template with status "Default" on
|
||||
NEW: Bank name no more mandatory on creation. Can be generated if empty.
|
||||
NEW: batch referential objets
|
||||
NEW: Better responsive for mass actions
|
||||
NEW: Can add any contact on events if global MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is set at 1
|
||||
NEW: Can add the add now link on date into addfieldvalue()
|
||||
NEW: Can bin accounting line for a given month
|
||||
NEW: Can edit account on miscellaneous payment (if not transfered)
|
||||
NEW: Can edit inline the VAT number from supplier tab
|
||||
NEW: Can fill date of salary payment with date of start of salary
|
||||
NEW: Can filter on a custom group of accounts. Perf or ledger list.
|
||||
NEW: Can go back to draft on shipment when stock change not on validate
|
||||
NEW: Can modify bank account of sepa payment (if file not sent yet)
|
||||
NEW: Proposals: Can modify margin rates in offers like VAT rates.
|
||||
NEW: Salary: Can modify the date of payment of a salary (if not reconciled)
|
||||
NEW: OAuth: Can now edit service name for oauth token
|
||||
NEW: Reception: Can receive more than qty ordered on reception
|
||||
NEW: Can select several warehouses into the view stock at date in past
|
||||
NEW: Can select the export format during export of journals
|
||||
NEW: Can set a checkbox in formconfirm by clicking on the label
|
||||
NEW: Can set background style with MAIN_LOGIN_BACKGROUND_STYLE
|
||||
NEW: Can set flag default value on email templates
|
||||
NEW: Can set the page "List of opportunities" as landing page
|
||||
NEW: Can show the sql request used on emailing selection
|
||||
NEW: can stay on edit field when errors occurs
|
||||
NEW: GeoIP: Can test a geoip conversion from the geoip setup page
|
||||
NEW: Members: Captcha for public member's subscription form
|
||||
NEW: category of operation for crabe PDF model
|
||||
NEW: color for start date and owner
|
||||
NEW: comment in api_mymodule for seperate methods
|
||||
NEW: constant PROPALE_ADDON_NOTE_PUBLIC_DEFAULT
|
||||
NEW: create email substitution variable for intervention signature URL
|
||||
NEW: Date for salary payment includes the hour/min
|
||||
NEW: Debug the custom CSS feature to avoid a directory search/scan at
|
||||
NEW: dev name
|
||||
NEW: Disable bad reputation product price
|
||||
NEW: dolExplodeIntoArray can accept regex
|
||||
NEW: dol_sort_array can sort on alphabetical order even if val is num
|
||||
NEW: don't have closed contact proposed as receiver for the mails
|
||||
NEW: MO: Dynamic choice of warehouse and batch in MO production.
|
||||
NEW: element time integration code + sql
|
||||
NEW: events list with color
|
||||
NEW: expend/collapse list of social networks
|
||||
NEW: Proposals: filter for Signed+Billed in proposals
|
||||
NEW: Filter on amount and qty on list of service's contracts
|
||||
NEW: Import: filter on entity in import
|
||||
NEW: formconfirm can support field with format datetime
|
||||
NEW: getCommonSubstitutionArray to have more substitute keys
|
||||
NEW: helper functions for dates + small demo case
|
||||
NEW: hook printFieldListFrom in contact list
|
||||
NEW: inc.php: handle parameters from argv
|
||||
NEW: Website Module: Increment website counter on each page access in website module
|
||||
NEW: Invalidate all sessions of a user when password is modified.
|
||||
NEW: Invoice - show category of operations
|
||||
NEW: iSuiteExpert export model
|
||||
NEW: Keep a link between user created from recruitment and application
|
||||
NEW: limit load products in TakePOS
|
||||
NEW: List product in orders
|
||||
NEW: map table to element for get entity in import
|
||||
NEW: migration script + delete old table + rename fields and indexes
|
||||
NEW: Multicurrency REST API to create, update, delete, update rate...
|
||||
NEW: Multiselect for filter on prospection status
|
||||
NEW: Name and date to print on PDF Sign
|
||||
NEW: [Bulk delete Project tasks]
|
||||
NEW: No overwrite of optionals during put() contact
|
||||
NEW: Notification for Sign or Refused Propal from Online Page
|
||||
NEW: notify also the contributor affected to a ticket if a new message public is post (add global TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ALSO_CONTRIBUTOR)
|
||||
NEW: Now we can edit amount on vat and salaries clone action
|
||||
NEW: only get openned contact from liste_contact function, to not have acces to closed contact as mail receiver
|
||||
NEW: operation type in email collector to load or create contact
|
||||
NEW: option filter for NoSalesRepresentativeAffected in proposals list
|
||||
NEW: Option to manage deposit slips for more payment modes (not only
|
||||
NEW: Option to show column for field and line selection on the left
|
||||
NEW: Order export : allow to export field 'shipment method'.
|
||||
NEW: payment default values when supplier order created from reception
|
||||
NEW: Payment : manage contracts
|
||||
NEW: Possibility to link to German pages in help
|
||||
NEW: presend mass action in contact list
|
||||
NEW: product images on popup are cached
|
||||
NEW: Provide the oldcopy value when calling setValueFrom() function with a trigger key
|
||||
NEW: Accountancy: Quadratus export with attachments in accountancy export
|
||||
NEW: referential objects of batch
|
||||
NEW: remove default percentage for event creation url
|
||||
NEW: remove keys whose table element is the same as element in map list
|
||||
NEW: repair script skip views
|
||||
NEW: Save date to invalidate other session into user table
|
||||
NEW: search on time spent duration range
|
||||
NEW: Send an email when ticket assigned
|
||||
NEW: Send a notification email when ticket assigned
|
||||
NEW: sepaStripe now creates the payment mode with type pm_ using new API
|
||||
NEW: set payment default values when supplier order created from reception
|
||||
NEW: Tickets: set ticket status to answered if the client has answered from the public interface
|
||||
NEW: set today start time at beginning
|
||||
NEW: Setup emailcollector easier. Can also use ! for negative search.
|
||||
NEW: Show counter of access of website in website list
|
||||
NEW: Show main currency in company info user tooltip
|
||||
NEW: Show module into list of emails templates
|
||||
NEW: Show picto into the combobox of widgets
|
||||
NEW: Show supplier invoice ref of direct debit transfer tab invoices
|
||||
NEW: show supplier name in getNomUrl of supplier order
|
||||
NEW: sort of column of custom group of account
|
||||
NEW: Stock limit for alert and desired optimal stock by product and warehouse import
|
||||
NEW: substitute date now in email collector
|
||||
NEW: Support different bank account for several direct debit payments
|
||||
NEW: Support multiselect in the warehouse selection combo box
|
||||
NEW: Support option MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
|
||||
NEW: table llx_element_time to store time spent on several elements (mo, ticket...)
|
||||
NEW: The batch for remind on due date can be setup for using validation date
|
||||
NEW: The refresh link for imap collector is always visible
|
||||
NEW: The upgrade process can be done by creating a file upgrade.unlock
|
||||
NEW: Tooltip to explain how to add a photo on a product
|
||||
NEW: Use a cache file for external RSS in calendar
|
||||
NEW: Use by default the domain $dolibarr_main_url_root for SMTP HELO
|
||||
NEW: use more recent model by default
|
||||
NEW: VAT can be modified during add of line
|
||||
NEW: write all fields and their properties in asciidoc format
|
||||
NEW: Can add an array of several links in date selector
|
||||
NEW: Add option PDF_SHOW_PHONE_AFTER_USER_CONTACT to show phone after specific assigned contact on PDF
|
||||
NEW: Add option PDF_SHOW_EMAIL_AFTER_USER_CONTACT to show email after specific assigned contact on PDF
|
||||
NEW: Widgets: Implement MAIN_ACTIVATE_FILECACHE on birthday widget
|
||||
NEW: Widgets: Add widget "The next upcoming events"
|
||||
NEW: Widgets: Add widget of open opportunities
|
||||
NEW: Use an ajax component to swith prospection status on thidparty list
|
||||
NEW: Comment on survey is possible only after vote.
|
||||
NEW: Add partial payment reason "withholding tax"
|
||||
NEW: A new tab for reception and shipment
|
||||
NEW: Use the more recent PDF templates for documents by default on a fresh install
|
||||
NEW: Better design for the page of discounts of a thirdparty
|
||||
|
||||
For developers or integrators:
|
||||
------------------------------
|
||||
|
||||
NEW: Make it possible to select hours and minutes in form_confirm
|
||||
NEW: add triggers on mailing
|
||||
NEW: Add a trigger when create a shipping line batch and fix propagate missing errors
|
||||
NEW: add function for listiong objects from directory
|
||||
NEW: add helplist property to describe fields of objects
|
||||
NEW: add hook in loadLotStock() in html.formproduct.class.php file, add hook 'llxFooter', Add hook online sign
|
||||
NEW: Update lib parsedownto 1.7.4, phpspreadsheet lib to v1.12, ESCPOS v3.0, jquery, Stripe.
|
||||
NEW: Support contact in post() document API
|
||||
NEW: More APIs (update currency rate, upload of supplier documents, ...)
|
||||
NEW: ModuleBuilder: updating in modulbuilder on tab Menu when adding object
|
||||
NEW: ModuleBuilder: add/edit permissions
|
||||
NEW: ModuleBuilder: better generated documentation
|
||||
NEW: add sent info in the parameters provided to the hook sendMailAfter
|
||||
NEW: add setAsSelectUser into factory for generic setup page
|
||||
NEW: add option keepspace into dol_string_nospecialchar()
|
||||
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Minimal PHP version is now PHP 7.1 instead of PHP 7.0
|
||||
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
|
||||
* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
|
||||
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
|
||||
* Deprecated property libelle removed from entrepot class.
|
||||
* The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that.
|
||||
* The module for WebService SOAP API have been deprecated. Use instead the Webservice REST API module.
|
||||
* The method htmlPrintOnlinePaymentFooter() used for public footer pages has been renamed into htmlPrintOnlineFooter() and moved into company.lib.php
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 17.0.1 compared to 17.0.0 *****
|
||||
|
||||
FIX: 17.0 PHP Warning invalid argument supplied for foreach
|
||||
|
|
|
|||
14
SECURITY.md
14
SECURITY.md
|
|
@ -57,13 +57,13 @@ ONLY vulnerabilities discovered, when the following setup on test platform is us
|
|||
* 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 that only the documents directory is in write mode. The root directory called htdocs must be read-only.
|
||||
* CSRF attacks are accepted but double check that you have set MAIN_SECURITY_CSRF_WITH_TOKEN to value 3.
|
||||
* The module DebugBar and ModuleBuilder must NOT be enabled (by default, these modules are not enabled. They are developer tools)
|
||||
* The modules DebugBar and ModuleBuilder must NOT be enabled. (by default, these modules are not enabled. They are developer tools)
|
||||
* 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.
|
||||
* Fail2ban rules for rate limit on the login page,password forgotten page and all public pages (/public/*) must be installed as recommendend into the section "About - Admin tools - Section Access limits and mitigation".
|
||||
|
||||
Scope is the web application (back office) and the APIs.
|
||||
|
||||
## Example of vulnerabilities Qualified for reporting.
|
||||
## Examples of vulnerabilities that are Qualified for reporting.
|
||||
|
||||
* Remote code execution (RCE)
|
||||
* Local files access and manipulation (LFI, RFI, XXE, SSRF, XSPA)
|
||||
|
|
@ -72,14 +72,14 @@ Scope is the web application (back office) and the APIs.
|
|||
* Cross-Site Requests Forgery (CSRF) with real security impact (when using GET URLs, CSRF are qualified only for creating, updating or deleting data from pages restricted to admin users)
|
||||
* Open redirect
|
||||
* Broken authentication & session management
|
||||
* Insecure direct object references
|
||||
* CORS with real security impact
|
||||
* Insecure direct object references (IDOR)
|
||||
* Cross-Origin Resource Sharing (CORS) with real security impact
|
||||
* Horizontal and vertical privilege escalation
|
||||
* "HTTP Host Header" XSS
|
||||
* Software version disclosure (for non admin users only)
|
||||
* Stack traces or path disclosure (for non admin users only)
|
||||
|
||||
## Example of vulnerabilities non Non-qualified for reporting.
|
||||
## Examples of vulnerabilities that are Non-qualified for reporting.
|
||||
|
||||
* "Self" XSS
|
||||
* SSL/TLS best practices
|
||||
|
|
@ -93,7 +93,7 @@ Scope is the web application (back office) and the APIs.
|
|||
* Reports from automated web vulnerability scanners (Acunetix, Vega, etc.) that have not been validated
|
||||
* Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC)
|
||||
* Reports on features flagged as "experimental" or "development"
|
||||
* Software version or private IP disclosure when logged user is admin
|
||||
* Stack traces or path disclosure when logged user is admin
|
||||
* Software version or private IP disclosure when logged-in user is admin
|
||||
* Stack traces or path disclosure when logged-in user is admin
|
||||
* Any vulnerabilities due to a configuration different than the one defined into chapter "Scope for qualified vulnerabilities".
|
||||
* Brute force attacks on login page, password forgotten page or any public pages (/public/*) are not qualified if the fail2ban recommended fail2ban rules were not installed.
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@
|
|||
</Directory>
|
||||
|
||||
# Wire up Apache to use Travis CI's php-fpm.
|
||||
<IfModule mod_fastcgi.c>
|
||||
AddHandler php5-fcgi .php
|
||||
Action php5-fcgi /php5-fcgi
|
||||
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
||||
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
||||
|
||||
<Directory /usr/lib/cgi-bin>
|
||||
Require all granted
|
||||
</Directory>
|
||||
</IfModule>
|
||||
#<IfModule mod_fastcgi.c>
|
||||
# AddHandler php5-fcgi .php
|
||||
# Action php5-fcgi /php5-fcgi
|
||||
# Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
||||
# FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
||||
#
|
||||
#<Directory /usr/lib/cgi-bin>
|
||||
# Require all granted
|
||||
#</Directory>
|
||||
#</IfModule>
|
||||
</VirtualHost>
|
||||
|
|
|
|||
|
|
@ -1962,6 +1962,7 @@ CREATE TABLE `llx_c_holiday_types` (
|
|||
`delay` int(11) NOT NULL,
|
||||
`newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
|
||||
`fk_country` int(11) DEFAULT NULL,
|
||||
`block_if_negative` int(11) NOT NULL DEFAULT 0,
|
||||
`active` int(11) DEFAULT 1,
|
||||
`sortorder` smallint(6) DEFAULT NULL,
|
||||
PRIMARY KEY (`rowid`),
|
||||
|
|
@ -1975,7 +1976,11 @@ CREATE TABLE `llx_c_holiday_types` (
|
|||
|
||||
LOCK TABLES `llx_c_holiday_types` WRITE;
|
||||
/*!40000 ALTER TABLE `llx_c_holiday_types` DISABLE KEYS */;
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (1,'LEAVE_SICK','Sick leave',0,0,0.00000,NULL,1,NULL),(2,'LEAVE_OTHER','Other leave',0,0,0.00000,NULL,1,NULL),(3,'LEAVE_PAID','Paid vacation',1,7,0.00000,NULL,1,NULL),(4,'LEAVE_RTT_FR','RTT',1,7,0.83000,1,0,NULL),(5,'LEAVE_PAID_FR','Paid vacation',1,30,2.08334,1,0,NULL);
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (1,'LEAVE_SICK','Sick leave',0,0,0.00000,NULL,0,1,NULL);
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (2,'LEAVE_OTHER','Other leave',0,0,0.00000,NULL,0,1,NULL);
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (3,'LEAVE_PAID','Paid vacation',1,7,0.00000,NULL,0,1,NULL);
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (4,'LEAVE_RTT_FR','RTT',1,7,0.83000,1,0,0,NULL);
|
||||
INSERT INTO `llx_c_holiday_types` VALUES (5,'LEAVE_PAID_FR','Paid vacation',1,30,2.08334,1,0,0,NULL);
|
||||
/*!40000 ALTER TABLE `llx_c_holiday_types` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ filter = web-dolibarr-rulesbruteforce
|
|||
logpath = /mypath/documents/documents/dolibarr.log
|
||||
action = %(action_mw)s
|
||||
bantime = 86400 ; 1 day
|
||||
findtime = 3600 ; 1 hour
|
||||
maxretry = 10
|
||||
findtime = 14400 ; 4 hours
|
||||
maxretry = 20
|
||||
|
||||
|
||||
[web-dol-limitpublic]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ README (english)
|
|||
User guide
|
||||
--------------------------------
|
||||
|
||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||
* All Dolibarr guides are available, online, on the Dolibarr Websites:
|
||||
|
||||
https://www.dolibarr.org
|
||||
https://wiki.dolibarr.org
|
||||
|
|
|
|||
|
|
@ -161,11 +161,11 @@ if (empty($reshook)) {
|
|||
|
||||
if (!empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
}
|
||||
if (!empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
}
|
||||
if (!empty($search_doc_date)) {
|
||||
$filter['t.doc_date'] = $search_doc_date;
|
||||
|
|
@ -177,7 +177,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||
}
|
||||
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
|
||||
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
|
||||
}
|
||||
if (!empty($search_accountancy_code_end)) {
|
||||
if ($type == 'sub') {
|
||||
|
|
@ -185,7 +185,7 @@ if (empty($reshook)) {
|
|||
} else {
|
||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||
}
|
||||
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
|
||||
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
|
||||
}
|
||||
if (!empty($search_ledger_code)) {
|
||||
$filter['t.code_journal'] = $search_ledger_code;
|
||||
|
|
@ -375,10 +375,12 @@ if ($action != 'export_csv') {
|
|||
}
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<label for="notreconciled">'.$langs->trans('NotReconciled').'</label>: ';
|
||||
$moreforfilter .= '<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>';
|
||||
$moreforfilter .= '</div>';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= '<label for="notreconciled">'.$langs->trans('NotReconciled').'</label>: ';
|
||||
$moreforfilter .= '<input type="checkbox" name="search_not_reconciled" id="notreconciled" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>';
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
|
|
@ -395,6 +397,14 @@ if ($action != 'export_csv') {
|
|||
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '<td class="liste_titre" colspan="'.$colspan.'">';
|
||||
print '</td>';
|
||||
|
||||
|
|
@ -404,13 +414,18 @@ if ($action != 'export_csv') {
|
|||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
// TODO : Retrieve the type of third party: Customer / Supplier / Employee
|
||||
//if ($type == 'sub') {
|
||||
|
|
@ -428,7 +443,9 @@ if ($action != 'export_csv') {
|
|||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$total_debit = 0;
|
||||
|
|
@ -532,6 +549,14 @@ if ($action != 'export_csv') {
|
|||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print $link;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Accounting account
|
||||
if ($type == 'sub') {
|
||||
print '<td>'.$line->subledger_account.' <span class="opacitymedium">('.$line->subledger_label.')</span></td>';
|
||||
|
|
@ -581,9 +606,14 @@ if ($action != 'export_csv') {
|
|||
} else {
|
||||
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
}
|
||||
print '<td class="center">';
|
||||
print $link;
|
||||
print '</td>';
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center">';
|
||||
print $link;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
// Records the sub-total
|
||||
|
|
@ -593,7 +623,12 @@ if ($action != 'export_csv') {
|
|||
}
|
||||
|
||||
if (!empty($show_subgroup)) {
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
print '<tr class="liste_total">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
|
||||
}
|
||||
|
|
@ -604,11 +639,19 @@ if ($action != 'export_csv') {
|
|||
} else {
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
|
||||
print '<tr class="liste_total">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print '<td class="right">'.$langs->trans("AccountBalance").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
|
||||
}
|
||||
|
|
@ -619,7 +662,10 @@ if ($action != 'export_csv') {
|
|||
} else {
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print "<td></td>\n";
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->rights->accounting->mouvements->creer) {
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accounting', 'mouvements', 'creer')) {
|
||||
$arrayofmassactions['letteringauto'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringAuto');
|
||||
$arrayofmassactions['preunletteringauto'] = img_picto('', 'uncheck', 'class="pictofixedwidth"') . $langs->trans('UnletteringAuto');
|
||||
$arrayofmassactions['letteringmanual'] = img_picto('', 'check', 'class="pictofixedwidth"') . $langs->trans('LetteringManual');
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ if (empty($reshook)) {
|
|||
$param = '&type='.$type.$param;
|
||||
}
|
||||
|
||||
//if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
|
||||
//if ($action == 'delbookkeepingyearconfirm' && $user->hasRight('accounting', 'mouvements', 'supprimer')_tous) {
|
||||
// $delmonth = GETPOST('delmonth', 'int');
|
||||
// $delyear = GETPOST('delyear', 'int');
|
||||
// if ($delyear == -1) {
|
||||
|
|
@ -1297,7 +1297,7 @@ print "</table>";
|
|||
print '</div>';
|
||||
|
||||
// TODO Replace this with mass delete action
|
||||
//if ($user->rights->accounting->mouvements->supprimer_tous) {
|
||||
//if ($user->hasRight('accounting', 'mouvements, 'supprimer_tous')) {
|
||||
// print '<div class="tabsAction tabsActionNoBottom">'."\n";
|
||||
// print '<a class="butActionDelete" name="button_delmvt" href="'.$_SERVER["PHP_SELF"].'?action=delbookkeepingyear&token='.newToken().($param ? '&'.$param : '').'">'.$langs->trans("DeleteMvt").'</a>';
|
||||
// print '</div>';
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ $y = $year_current;
|
|||
|
||||
$buttonvalidate = '<a class="butAction" name="button_validate_movements" href="'.$_SERVER["PHP_SELF"].'?action=validate_movements&year='.$year_start.'">'.$langs->trans("ValidateMovements").'</a>';
|
||||
|
||||
print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), '', '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 1);
|
||||
print_barre_liste($langs->trans("OverviewOfMovementsNotValidated"), '', '', '', '', '', '', -1, '', '', 0, $buttonvalidate, '', 0, 1, 0);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
|
||||
if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||
|
|
@ -446,7 +446,7 @@ if ($result) {
|
|||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
);
|
||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
//if ($user->hasRight('mymodule', 'supprimer')) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
if ($massaction !== 'set_default_account') {
|
||||
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if ($action == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
if (!$cancel) {
|
||||
if ($codeventil < 0) {
|
||||
$codeventil = 0;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
$search_date_end = '';
|
||||
}
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$error = 0;
|
||||
|
||||
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
|
||||
if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
if (!empty($mesCasesCochees)) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -109,14 +109,14 @@ $sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva
|
|||
$sql .= " p.default_vat_code AS product_buy_default_vat_code, p.tva_tx as product_buy_vat, p.localtax1_tx as product_buy_localvat1, p.localtax2_tx as product_buy_localvat2,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.fk_pays,";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
|
||||
$sql .= " spe.accountancy_code_customer as code_compta,";
|
||||
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||
} else {
|
||||
$sql .= " s.code_compta as code_compta,";
|
||||
$sql .= " s.code_compta_fournisseur,";
|
||||
}
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " ppe.accountancy_code_buy,";
|
||||
} else {
|
||||
$sql .= " p.accountancy_code_buy,";
|
||||
|
|
@ -124,20 +124,20 @@ if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
|||
$sql .= " aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as fd";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " WHERE f.fk_statut > 0";
|
||||
$sql .= " AND fd.fk_code_ventilation > 0";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")";
|
||||
|
|
@ -146,8 +146,8 @@ if ($date_start && $date_end) {
|
|||
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already') {
|
||||
|
|
@ -177,10 +177,10 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
// Variables
|
||||
$cptfour = ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined';
|
||||
$cpttva = (!empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined';
|
||||
$rcctva = (!empty($conf->global->ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT)) ? $conf->global->ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT : 'NotDefined';
|
||||
$rcdtva = (!empty($conf->global->ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT)) ? $conf->global->ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT : 'NotDefined';
|
||||
$cptfour = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER', 'NotDefined');
|
||||
$cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
|
||||
$rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
|
||||
$rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
|
||||
$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
|
||||
|
||||
$i = 0;
|
||||
|
|
@ -193,9 +193,9 @@ if ($result) {
|
|||
$compta_prod = $obj->compte;
|
||||
if (empty($compta_prod)) {
|
||||
if ($obj->product_type == 0) {
|
||||
$compta_prod = (!empty($conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT : 'NotDefined';
|
||||
$compta_prod = getDolGlobalString('ACCOUNTING_PRODUCT_BUY_ACCOUNT', 'NotDefined');
|
||||
} else {
|
||||
$compta_prod = (!empty($conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT : 'NotDefined';
|
||||
$compta_prod = getDolGlobalString('ACCOUNTING_SERVICE_BUY_ACCOUNT', 'NotDefined');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ if ($result) {
|
|||
$compta_tva = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_counterpart_tva_npr = (!empty($conf->global->ACCOUNTING_COUNTERPART_VAT_NPR)) ? $conf->global->ACCOUNTING_COUNTERPART_VAT_NPR : 'NotDefined';
|
||||
$compta_counterpart_tva_npr = getDolGlobalString('ACCOUNTING_COUNTERPART_VAT_NPR', 'NotDefined');
|
||||
|
||||
// Define array to display all VAT rates that use this accounting account $compta_tva
|
||||
if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) {
|
||||
|
|
@ -241,7 +241,7 @@ if ($result) {
|
|||
}
|
||||
|
||||
// VAT Reverse charge
|
||||
if (($mysoc->country_code == 'FR' || !empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) && $obj->vat_reverse_charge == 1 && in_array($obj->country_code, $country_code_in_EEC)) {
|
||||
if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && in_array($obj->country_code, $country_code_in_EEC)) {
|
||||
$rcvatdata = getTaxesFromId($obj->product_buy_vat . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''), $mysoc, $mysoc, 0);
|
||||
$rcc_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
|
||||
$rcd_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
|
||||
|
|
@ -340,7 +340,7 @@ if ($action == 'writebookkeeping') {
|
|||
$invoicestatic = new FactureFournisseur($db);
|
||||
$accountingaccountsupplier = new AccountingAccount($db);
|
||||
|
||||
$accountingaccountsupplier->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||
$accountingaccountsupplier->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), true);
|
||||
|
||||
foreach ($tabfac as $key => $val) { // Loop on each invoice
|
||||
$errorforline = 0;
|
||||
|
|
@ -404,7 +404,7 @@ if ($action == 'writebookkeeping') {
|
|||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
|
||||
$bookkeeping->label_compte = $accountingaccountsupplier->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount");
|
||||
|
|
@ -462,7 +462,7 @@ if ($action == 'writebookkeeping') {
|
|||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_fournisseur;
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT)) {
|
||||
if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
|
||||
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) {
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
|
|
@ -523,7 +523,7 @@ if ($action == 'writebookkeeping') {
|
|||
}
|
||||
|
||||
// VAT Reverse charge
|
||||
if ($mysoc->country_code == 'FR' || !empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
|
||||
if ($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
|
||||
$has_vat = false;
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
|
|
@ -704,7 +704,7 @@ $form = new Form($db);
|
|||
|
||||
// Export
|
||||
if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
|
||||
$filename = 'journal';
|
||||
$type_export = 'journal';
|
||||
|
|
@ -752,7 +752,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
|
|
@ -796,7 +796,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
}
|
||||
|
||||
// VAT Reverse charge
|
||||
if ($mysoc->country_code == 'FR' || !empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
|
||||
if ($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
|
||||
$has_vat = false;
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
|
|
@ -871,7 +871,7 @@ if (empty($action) || $action == 'view') {
|
|||
$exportlink = '';
|
||||
$builddate = dol_now();
|
||||
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$description .= $langs->trans("DepositsAreNotIncluded");
|
||||
} else {
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
|
|
@ -886,7 +886,8 @@ if (empty($action) || $action == 'view') {
|
|||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
// Button to write into Ledger
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
$acctSupplierNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), ['','-1']);
|
||||
if ($acctSupplierNotConfigured) {
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
|
|
@ -894,10 +895,10 @@ if (empty($action) || $action == 'view') {
|
|||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom centerimp">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
|
||||
if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') {
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
}
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
if ($acctSupplierNotConfigured) {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
} else {
|
||||
if ($in_bookkeeping == 'notyet') {
|
||||
|
|
@ -1023,7 +1024,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
@ -1067,7 +1068,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT)) {
|
||||
if (getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
|
||||
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT')) {
|
||||
print length_accounta($tabcompany[$key]['code_compta']);
|
||||
}
|
||||
|
|
@ -1097,7 +1098,7 @@ if (empty($action) || $action == 'view') {
|
|||
}
|
||||
|
||||
// VAT Reverse charge
|
||||
if ($mysoc->country_code == 'FR' || !empty($conf->global->ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE)) {
|
||||
if ($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
|
||||
$has_vat = false;
|
||||
foreach ($arrayofvat[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
|||
$sql = "SELECT f.rowid, f.ref, f.type, f.situation_cycle_ref, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code, f.retained_warranty,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur,";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
|
||||
$sql .= " spe.accountancy_code_customer as code_compta,";
|
||||
$sql .= " spe.accountancy_code_supplier as code_compta_fournisseur,";
|
||||
} else {
|
||||
|
|
@ -117,26 +117,26 @@ if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
|||
$sql .= " s.code_compta_fournisseur,";
|
||||
}
|
||||
$sql .= " p.rowid as pid, p.ref as pref, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte,";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " ppe.accountancy_code_sell";
|
||||
} else {
|
||||
$sql .= " p.accountancy_code_sell";
|
||||
}
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
||||
$sql .= " AND f.entity IN (".getEntity('invoice', 0).')'; // We don't share object for accountancy, we use source object sharing
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Non common setup
|
||||
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { // Non common setup
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||
|
|
@ -146,8 +146,8 @@ if ($date_start && $date_end) {
|
|||
$sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
// Already in bookkeeping or not
|
||||
if ($in_bookkeeping == 'already') {
|
||||
|
|
@ -177,8 +177,8 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
// Variables
|
||||
$cptcli = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "")) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined';
|
||||
$cpttva = (!empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : 'NotDefined';
|
||||
$cptcli = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER', 'NotDefined');
|
||||
$cpttva = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT', 'NotDefined');
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
|
|
@ -190,9 +190,9 @@ if ($result) {
|
|||
$compta_prod = $obj->compte;
|
||||
if (empty($compta_prod)) {
|
||||
if ($obj->product_type == 0) {
|
||||
$compta_prod = (!empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : 'NotDefined';
|
||||
$compta_prod = getDolGlobalString('ACCOUNTING_PRODUCT_SOLD_ACCOUNT', 'NotDefined');
|
||||
} else {
|
||||
$compta_prod = (!empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : 'NotDefined';
|
||||
$compta_prod = getDolGlobalString('ACCOUNTING_SERVICE_SOLD_ACCOUNT', 'NotDefined');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ if ($result) {
|
|||
// It also seems that credit notes on situation invoices are correctly saved (but it depends on the version used in fact).
|
||||
// For credit notes, we hope to have situation_ratio = 1 so the compensation has no effect to avoid introducing troubles with credit notes.
|
||||
$total_ttc = $obj->total_ttc * $situation_ratio;
|
||||
if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY) && $obj->retained_warranty > 0) {
|
||||
if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY') && $obj->retained_warranty > 0) {
|
||||
$retained_warranty = (double) price2num($total_ttc * $obj->retained_warranty / 100, 'MT');
|
||||
$tabwarranty[$obj->rowid][$compta_soc] += $retained_warranty;
|
||||
$total_ttc -= $retained_warranty;
|
||||
|
|
@ -315,11 +315,11 @@ if ($action == 'writebookkeeping') {
|
|||
$invoicestatic = new Facture($db);
|
||||
$accountingaccountcustomer = new AccountingAccount($db);
|
||||
|
||||
$accountingaccountcustomer->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||
$accountingaccountcustomer->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), true);
|
||||
|
||||
$accountingaccountcustomerwarranty = new AccountingAccount($db);
|
||||
|
||||
$accountingaccountcustomerwarranty->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY, true);
|
||||
$accountingaccountcustomerwarranty->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY'), true);
|
||||
|
||||
foreach ($tabfac as $key => $val) { // Loop on each invoice
|
||||
$errorforline = 0;
|
||||
|
|
@ -381,7 +381,7 @@ if ($action == 'writebookkeeping') {
|
|||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY');
|
||||
$bookkeeping->label_compte = $accountingaccountcustomerwarranty->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty");
|
||||
|
|
@ -430,7 +430,7 @@ if ($action == 'writebookkeeping') {
|
|||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
|
||||
$bookkeeping->label_compte = $accountingaccountcustomer->label;
|
||||
|
||||
$bookkeeping->label_operation = dol_trunc($companystatic->name, 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount");
|
||||
|
|
@ -488,7 +488,7 @@ if ($action == 'writebookkeeping') {
|
|||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = $companystatic->code_client;
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) {
|
||||
if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
|
||||
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) {
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
|
|
@ -657,7 +657,7 @@ $form = new Form($db);
|
|||
|
||||
// Export
|
||||
if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
|
||||
$filename = 'journal';
|
||||
$type_export = 'journal';
|
||||
|
|
@ -704,7 +704,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Retainedwarranty").'"'.$sep;
|
||||
|
|
@ -723,7 +723,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
|
||||
print '"'.length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER')).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
|
|
@ -800,7 +800,7 @@ if (empty($action) || $action == 'view') {
|
|||
$exportlink = '';
|
||||
$builddate = dol_now();
|
||||
$description = $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$description .= $langs->trans("DepositsAreNotIncluded");
|
||||
} else {
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
|
|
@ -815,7 +815,8 @@ if (empty($action) || $action == 'view') {
|
|||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
// Button to write into Ledger
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
$acctCustomerNotConfigured = in_array(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), ['','-1']);
|
||||
if ($acctCustomerNotConfigured) {
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
|
|
@ -823,10 +824,10 @@ if (empty($action) || $action == 'view') {
|
|||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom centerimp">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
|
||||
if (getDolGlobalString('ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL') && $in_bookkeeping == 'notyet') {
|
||||
print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
}
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
if ($acctCustomerNotConfigured) {
|
||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||
} else {
|
||||
if ($in_bookkeeping == 'notyet') {
|
||||
|
|
@ -950,7 +951,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY);
|
||||
$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_RETAINED_WARRANTY'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
@ -980,7 +981,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
$accountoshow = length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
@ -1024,7 +1025,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) {
|
||||
if (getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
|
||||
if ($k == getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT')) {
|
||||
print length_accounta($tabcompany[$key]['code_compta']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if ($action == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
if (!$cancel) {
|
||||
if ($codeventil < 0) {
|
||||
$codeventil = 0;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->bind->write)) {
|
||||
if (!$user->hasRight('accounting', 'bind', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ if (empty($user->rights->accounting->mouvements->lire)) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
|
||||
if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
// Clean database
|
||||
$db->begin();
|
||||
$sql1 = "UPDATE ".$db->prefix()."facture_fourn_det as fd";
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ if (!isModEnabled('accounting')) {
|
|||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($user->rights->accounting->mouvements->lire)) {
|
||||
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||
$search_tvaintra = '';
|
||||
}
|
||||
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->rights->accounting->bind->write) {
|
||||
if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$error = 0;
|
||||
|
||||
if (!(GETPOST('account_parent', 'int') >= 0)) {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
|
||||
if ($massaction == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
if (!empty($mesCasesCochees)) {
|
||||
|
|
@ -453,7 +453,7 @@ if ($result) {
|
|||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
);
|
||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
//if ($user->hasRight('mymodule', 'supprimer')) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
//if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
|
||||
if ($massaction !== 'set_default_account') {
|
||||
$massactionbutton = $form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||
|
|
|
|||
|
|
@ -56,16 +56,16 @@ $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL_
|
|||
// Editing global variables not related to a specific theme
|
||||
$constantes = array(
|
||||
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
|
||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>array('type'=>'emailtemplate:member'),
|
||||
'ADHERENT_MAIL_FROM' =>array('type'=>'string'),
|
||||
'ADHERENT_CC_MAIL_FROM' =>array('type'=>'string'),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>array('type'=>'string'),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>array('type'=>'html', 'tooltip'=>$helptext)
|
||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_MAIL_FROM' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_CC_MAIL_FROM' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>array('type'=>'html', 'tooltip'=>$helptext,'label'=>'')
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ if ($object->id > 0) {
|
|||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).($object->id > 0 ? '?id='.$object->id : '').'&origin=member&originid='.$id);
|
||||
}
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
print '<br>';
|
||||
|
||||
$param = '&id='.$id;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ abstract class ActionsAdherentCardCommon
|
|||
|
||||
$this->tpl['visibility'] = $this->object->getmorphylib($this->object->morphy);
|
||||
|
||||
$this->tpl['note'] = nl2br($this->object->note);
|
||||
$this->tpl['note'] = $this->object->note_private;
|
||||
}
|
||||
|
||||
if ($action == 'create_user') {
|
||||
|
|
@ -241,7 +241,7 @@ abstract class ActionsAdherentCardCommon
|
|||
/**
|
||||
* Assign POST values into object
|
||||
*
|
||||
* @return string HTML output
|
||||
* @return void
|
||||
*/
|
||||
private function assign_post()
|
||||
{
|
||||
|
|
@ -251,7 +251,8 @@ abstract class ActionsAdherentCardCommon
|
|||
$this->object->old_name = GETPOST("old_name");
|
||||
$this->object->old_firstname = GETPOST("old_firstname");
|
||||
|
||||
$this->object->fk_soc = GETPOST("fk_soc");
|
||||
$this->object->fk_soc = GETPOST("fk_soc", 'int');
|
||||
$this->object->socid = GETPOST("fk_soc", 'int');
|
||||
$this->object->lastname = GETPOST("lastname");
|
||||
$this->object->firstname = GETPOST("firstname");
|
||||
$this->object->civility_id = GETPOST("civility_id");
|
||||
|
|
@ -262,8 +263,8 @@ abstract class ActionsAdherentCardCommon
|
|||
$this->object->state_id = GETPOST("state_id", 'int');
|
||||
$this->object->phone_perso = GETPOST("phone_perso");
|
||||
$this->object->phone_mobile = GETPOST("phone_mobile");
|
||||
$this->object->email = GETPOST("email", 'alphawithlgt');
|
||||
$this->object->note = GETPOST("note", 'restricthtml');
|
||||
$this->object->email = GETPOST("email", 'alphawithlgt');
|
||||
$this->object->note_private = GETPOST("note", 'restricthtml');
|
||||
$this->object->canvas = GETPOST("canvas");
|
||||
|
||||
// We set country_id, and country_code label of the chosen country
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ if (empty($reshook)) {
|
|||
$object->birth = $birthdate;
|
||||
$object->default_lang = GETPOST('default_lang', 'alpha');
|
||||
$object->typeid = GETPOST("typeid", 'int');
|
||||
//$object->note = trim(GETPOST("comment","alpha"));
|
||||
//$object->note = trim(GETPOST("comment", "restricthtml"));
|
||||
$object->morphy = GETPOST("morphy", 'alpha');
|
||||
|
||||
if (GETPOST('deletephoto', 'alpha')) {
|
||||
|
|
@ -1336,7 +1336,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
if (!$value['active']) {
|
||||
break;
|
||||
}
|
||||
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="'.$key.'" class="minwidth100" value="'.(GETPOSTISSET($key) ? GETPOST($key, 'alphanohtml') : $object->socialnetworks[$key]).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans($value['label']).'</td><td><input type="text" name="'.$key.'" class="minwidth100" value="'.(GETPOSTISSET($key) ? GETPOST($key, 'alphanohtml') : (isset($object->socialnetworks[$key])? $object->socialnetworks[$key] : null)).'"></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1008,7 +1008,7 @@ class AdherentType extends CommonObject
|
|||
|
||||
//$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
|
||||
if ($user->rights->adherent->configurer) {
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
$return .= '<span class="right paddingleft"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.urlencode($this->ref).'">'.img_edit().'</a></span>';
|
||||
} else {
|
||||
$return .= '<span class="right"> </span>';
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ class Members extends DolibarrApi
|
|||
*
|
||||
* Return an array with member informations
|
||||
*
|
||||
* @param int $id ID of member
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $id ID of member
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ class MembersTypes extends DolibarrApi
|
|||
*
|
||||
* Return an array with member type informations
|
||||
*
|
||||
* @param int $id ID of member type
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $id ID of member type
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,10 +51,10 @@ class Subscriptions extends DolibarrApi
|
|||
*
|
||||
* Return an array with subscription informations
|
||||
*
|
||||
* @param int $id ID of subscription
|
||||
* @return Object data without useless information
|
||||
* @param int $id ID of subscription
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -96,10 +96,13 @@ class Subscription extends CommonObject
|
|||
public $amount;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
* @var int ID of bank in llx_bank
|
||||
*/
|
||||
public $fk_bank;
|
||||
|
||||
/**
|
||||
* @var array Array with all fields into database and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>15),
|
||||
|
|
@ -128,7 +131,7 @@ class Subscription extends CommonObject
|
|||
|
||||
|
||||
/**
|
||||
* Function who permitted cretaion of the subscription
|
||||
* Function who permitted creation of the subscription
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
|
|
@ -151,7 +154,6 @@ class Subscription extends CommonObject
|
|||
$this->datec = $now;
|
||||
}
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
|
||||
|
|
@ -217,7 +219,7 @@ class Subscription extends CommonObject
|
|||
$sql .= " datef,";
|
||||
$sql .= " subscription, note as note_public, fk_bank";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
$sql .= " WHERE rowid=".((int) $rowid);
|
||||
$sql .= " WHERE rowid = ".((int) $rowid);
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
|
@ -274,11 +276,11 @@ class Subscription extends CommonObject
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".((int) $this->fk_type).",";
|
||||
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
|
||||
$sql .= " note=".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
|
||||
$sql .= " note = ".($this->note_public ? "'".$this->db->escape($this->note_public)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
$sql .= " dateadh = '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef = '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec = '".$this->db->idate($this->datec)."',";
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Define variables to know what current user can do on properties of user linked to edited member
|
||||
if ($object->user_id) {
|
||||
// $User is the user who edits, $object->user_id is the id of the related user in the edited member
|
||||
$caneditfielduser = ((($user->id == $object->user_id) && !empty($user->rights->user->self->creer))
|
||||
$caneditfielduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'creer'))
|
||||
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer')));
|
||||
$caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password)
|
||||
$caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password'))
|
||||
|| (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password')));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ $result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid
|
|||
/*
|
||||
* Actions
|
||||
*/
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -148,7 +148,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('adheren
|
|||
header("Location: ".DOL_URL_ROOT."/adherents/card.php?rowid=".$object->fk_adherent);
|
||||
exit;
|
||||
} else {
|
||||
$mesg = $adh->error;
|
||||
$errmesg = $adh->error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,45 +194,51 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'edit') {
|
|||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
print '<td class="valeur">';
|
||||
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Member
|
||||
$adh->ref = $adh->getFullName($langs);
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||
print '<td>'.$langs->trans("Member").'</td>';
|
||||
print '<td class="valeur">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Type
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("Type").'</td><td class="valeur" colspan="3">';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid") : $object->fk_type));
|
||||
print'</td></tr>';
|
||||
|
||||
// Date start subscription
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectDate($object->datef, 'datesubend', 0, 0, 0, 'update', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur" colspan="2">';
|
||||
print '<input type="text" class="flat" size="10" name="amount" value="'.price($object->amount).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input type="text" class="flat width200" name="amount" value="'.price($object->amount).'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="2">';
|
||||
print '<input type="text" class="flat" size="60" name="note" value="'.$object->note.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input type="text" class="flat" name="note" value="'.$object->note_private.'"></td></tr>';
|
||||
|
||||
// Bank line
|
||||
if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||
if ($object->fk_bank) {
|
||||
$bankline = new AccountLine($db);
|
||||
$result = $bankline->fetch($object->fk_bank);
|
||||
|
|
@ -324,7 +330,7 @@ if ($rowid && $action != 'edit') {
|
|||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur"><span class="amount">'.price($object->amount).'</span></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur sensiblehtmlcontent">'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)).'</td></tr>';
|
||||
|
||||
// Bank line
|
||||
if (isModEnabled("banque") && (!empty($conf->global->ADHERENT_BANK_USE) || $object->fk_bank)) {
|
||||
|
|
|
|||
|
|
@ -715,7 +715,7 @@ while ($i < $imaxinloop) {
|
|||
|
||||
// Label
|
||||
if (!empty($arrayfields['t.libelle']['checked'])) {
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note).'">';
|
||||
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->note_private).'">';
|
||||
print dol_escape_htmltag(dolGetFirstLineOfText($obj->note_private));
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($user->rights->adherent->configurer) {
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<td class="center"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
}
|
||||
}
|
||||
|
|
@ -374,7 +374,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
if ($user->rights->adherent->configurer) {
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
}
|
||||
}
|
||||
|
|
@ -537,10 +537,12 @@ if ($rowid > 0) {
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($object->note)."</td></tr>";
|
||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private));
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
|
||||
print nl2br($object->mail_valid)."</td></tr>";
|
||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->mail_valid));
|
||||
print "</td></tr>";
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
|
|||
|
|
@ -755,7 +755,7 @@ if ($mysoc->useLocalTax(1)) {
|
|||
$opcions = array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"), $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"), $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
||||
|
||||
print '<br><label for="clt1">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print $form->selectarray("clt1", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC1);
|
||||
print $form->selectarray("clt1", $opcions, getDolGlobalString('MAIN_INFO_LOCALTAX_CALC1'));
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
|
@ -796,7 +796,7 @@ if ($mysoc->useLocalTax(2)) {
|
|||
$formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
||||
}
|
||||
print '<br><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
print $form->selectarray("clt2", $opcions, $conf->global->MAIN_INFO_LOCALTAX_CALC2);
|
||||
print $form->selectarray("clt2", $opcions, getDolGlobalString('MAIN_INFO_LOCALTAX_CALC2'));
|
||||
print "</div>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ foreach ($dirmodels as $reldir) {
|
|||
|
||||
// Defaut
|
||||
print '<td class="center">';
|
||||
if ($conf->global->CONTRACT_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString('CONTRACT_ADDON_PDF') == $name) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ if ($action == 'edit') {
|
|||
if ($key == 'DAV_ALLOW_PRIVATE_DIR') {
|
||||
print $langs->trans("AlwaysActive");
|
||||
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {
|
||||
print $form->selectyesno($key, $conf->global->$key, 1);
|
||||
print $form->selectyesno($key, getDolGlobalString($key), 1);
|
||||
} else {
|
||||
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
|
|
@ -140,9 +140,9 @@ if ($action == 'edit') {
|
|||
if ($key == 'DAV_ALLOW_PRIVATE_DIR') {
|
||||
print $langs->trans("AlwaysActive");
|
||||
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {
|
||||
print yn($conf->global->$key);
|
||||
print yn(getDolGlobalString($key));
|
||||
} else {
|
||||
print $conf->global->$key;
|
||||
print getDolGlobalString($key);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
@ -189,7 +189,7 @@ $message .= '</div>';
|
|||
$message .= ajax_autoselect('webdavpublicurl');
|
||||
|
||||
$message .= '<br>';
|
||||
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
|
||||
if (!empty(getDolGlobalString('DAV_ALLOW_PUBLIC_DIR'))) {
|
||||
$urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
|
||||
$url = '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '</a>';
|
||||
|
||||
|
|
|
|||
|
|
@ -605,7 +605,9 @@ foreach ($tabcomplete as $key => $value) {
|
|||
$keytable = '';
|
||||
if ($id > 0) {
|
||||
$arrayofkeys = array_keys($tabcomplete);
|
||||
$keytable = $arrayofkeys[$id - 1];
|
||||
if (array_key_exists($id -1, $arrayofkeys)) {
|
||||
$keytable = $arrayofkeys[$id - 1];
|
||||
}
|
||||
}
|
||||
|
||||
// Defaut sortorder
|
||||
|
|
@ -2238,7 +2240,9 @@ if ($id > 0) {
|
|||
$valuetoshow = $obj->{$value}." ".img_picto("", $obj->{$value});
|
||||
} elseif ($value == 'type_duration') {
|
||||
$TDurationTypes = array('y'=>$langs->trans('Years'), 'm'=>$langs->trans('Month'), 'w'=>$langs->trans('Weeks'), 'd'=>$langs->trans('Days'), 'h'=>$langs->trans('Hours'), 'i'=>$langs->trans('Minutes'));
|
||||
$valuetoshow =$TDurationTypes[$obj->{$value}];
|
||||
if (!empty($obj->{$value}) && array_key_exists($obj->{$value}, $TDurationTypes)) {
|
||||
$valuetoshow = $TDurationTypes[$obj->{$value}];
|
||||
}
|
||||
}
|
||||
$class .= ($class ? ' ' : '').'tddict';
|
||||
if ($value == 'note' && $id == 10) {
|
||||
|
|
@ -2428,12 +2432,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
$withentity = '';
|
||||
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
if ($value == 'entity') {
|
||||
if ($value == 'entity' && isset($obj->$value)) {
|
||||
$withentity = $obj->$value;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && in_array($obj->type, array('system', 'systemauto'))) {
|
||||
if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && isset($obj->$value) && in_array($obj->type, array('system', 'systemauto'))) {
|
||||
$hidden = (!empty($obj->{$value}) ? $obj->{$value}:'');
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="'. $value .'" value="'.$hidden.'">';
|
||||
|
|
@ -2530,10 +2534,12 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||
// Special case for labels
|
||||
if ($tabname == 'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$transkey = "PaymentCondition".strtoupper($obj->code);
|
||||
if ($langs->trans($transkey) != $transkey) {
|
||||
$transfound = 1;
|
||||
print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
|
||||
if (isset($obj->code) && !empty($obj->code)) {
|
||||
$transkey = "PaymentCondition" . strtoupper($obj->code);
|
||||
if ($langs->trans($transkey) != $transkey) {
|
||||
$transfound = 1;
|
||||
print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$transfound) {
|
||||
|
|
|
|||
|
|
@ -395,9 +395,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$connectstringtarget = '';
|
||||
|
||||
// Note: $object->host has been loaded by the fetch
|
||||
$usessl = 1;
|
||||
|
||||
$connectstringserver = $object->getConnectStringIMAP($usessl);
|
||||
$connectstringserver = $object->getConnectStringIMAP();
|
||||
|
||||
if ($action == 'scan') {
|
||||
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
|
||||
|
|
@ -645,9 +643,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
console.log("We change a filter");
|
||||
if (jQuery("#filtertype option:selected").attr("data-noparam")) {
|
||||
jQuery("#rulevalue").attr("placeholder", "");
|
||||
jQuery("#rulevalue").text(""); jQuery("#rulevalue").prop("disabled", true);
|
||||
}
|
||||
else { jQuery("#rulevalue").prop("disabled", false); }
|
||||
jQuery("#rulevalue").text("");
|
||||
jQuery("#rulevalue").prop("disabled", true);
|
||||
jQuery("#rulevaluehelp").addClass("unvisible");
|
||||
} else {
|
||||
jQuery("#rulevalue").prop("disabled", false);
|
||||
jQuery("#rulevaluehelp").removeClass("unvisible");
|
||||
}
|
||||
jQuery("#rulevalue").attr("placeholder", (jQuery("#filtertype option:selected").attr("data-placeholder")));
|
||||
';
|
||||
/*$noparam = array();
|
||||
|
|
@ -658,8 +660,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '})';
|
||||
print '</script>'."\n";
|
||||
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="rulevalue" id="rulevalue">';
|
||||
print '</td><td class="nowraponall">';
|
||||
print '<div class="nowraponall">';
|
||||
print '<input type="text" name="rulevalue" id="rulevalue" class="inline-block valignmiddle">';
|
||||
print '<div class="inline-block valignmiddle unvisible" id="rulevaluehelp">';
|
||||
print img_warning($langs->trans("FilterSearchImapHelp"), '', 'pictowarning classfortooltip');
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
print '<td class="right"><input type="submit" name="addfilter" id="addfilter" class="flat button smallpaddingimp" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ if ($action == 'edit') {
|
|||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ if ($action != 'edit') {
|
|||
echo '<td class="linecoltype">' . $form->selectExpense('', 'fk_c_type_fees', 0, 1, 1) . '</td>';
|
||||
echo '<td class="linecoltyperule">' . $form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0) . '</td>';
|
||||
echo '<td class="linecoldatestart">' . $form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0) . '</td>';
|
||||
echo '<td class="linecoldateend>' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0) . '</td>';
|
||||
echo '<td class="linecoldateend">' . $form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0) . '</td>';
|
||||
echo '<td class="linecolamount"><input type="text" value="" class="maxwidth100" name="amount" class="amount right" /></td>';
|
||||
echo '<td class="linecolrestrictive">' . $form->selectyesno('restrictive', 0, 1) . '</td>';
|
||||
echo '<td class="right linecolbutton"><input type="submit" class="button button-add" value="' . $langs->trans('Add') . '" /></td>';
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ print '</tr>';
|
|||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("ActivateCheckReadKey").'</td><td>';
|
||||
print '<input class="minwidth100 maxwdith250 widthcentpercentminusx" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.$conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY.'">';
|
||||
print '<input class="minwidth100 maxwdith250 widthcentpercentminusx" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAILING_EMAIL_UNSUBSCRIBE_KEY" value="'.getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY').'">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
|
|||
|
||||
$substitutionarrayfortest = array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefinedtag&securitykey='.dol_hash($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY."-undefinedtag", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0" />',
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefinedtag&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefinedtag", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0" />',
|
||||
'__USER_LOGIN__' => $user->login,
|
||||
'__USER_EMAIL__' => $user->email,
|
||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ if ($action == 'test' || $action == 'send') {
|
|||
|
||||
$substitutionarrayfortest = array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefinedtag&securitykey='.dol_hash($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY."-undefinedtag", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag=undefinedtag&securitykey='.dol_hash(getDolGlobalString('MAILING_EMAIL_UNSUBSCRIBE_KEY')."-undefinedtag", 'md5').'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
'__USER_LOGIN__' => $user->login,
|
||||
'__USER_EMAIL__' => $user->email,
|
||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||
|
|
|
|||
|
|
@ -182,10 +182,10 @@ $elementList = array();
|
|||
$elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --';
|
||||
$elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --';
|
||||
$elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser'));
|
||||
if (isModEnabled('adherent') && !empty($user->rights->adherent->lire)) {
|
||||
if (isModEnabled('adherent') && $user->hasRight('adherent', 'lire')) {
|
||||
$elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember'));
|
||||
}
|
||||
if (isModEnabled('recruitment') && !empty($user->rights->recruitment->recruitmentjobposition->read)) {
|
||||
if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) {
|
||||
$elementList['recruitmentcandidature_send'] = img_picto('', 'recruitmentcandidature', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('RecruitmentCandidatures'));
|
||||
}
|
||||
if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) {
|
||||
|
|
@ -194,13 +194,13 @@ if (isModEnabled("societe") && $user->hasRight('societe', 'lire')) {
|
|||
if (isModEnabled('project')) {
|
||||
$elementList['project'] = img_picto('', 'project', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToProject'));
|
||||
}
|
||||
if (isModEnabled("propal") && !empty($user->rights->propal->lire)) {
|
||||
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
|
||||
$elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal'));
|
||||
}
|
||||
if (isModEnabled('commande') && !empty($user->rights->commande->lire)) {
|
||||
if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) {
|
||||
$elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder'));
|
||||
}
|
||||
if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
|
||||
if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice'));
|
||||
}
|
||||
if (isModEnabled("expedition")) {
|
||||
|
|
@ -221,7 +221,7 @@ if (isModEnabled("supplier_order") && ($user->hasRight('fournisseur', 'commande'
|
|||
if (isModEnabled("supplier_invoice") && ($user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'read'))) {
|
||||
$elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice'));
|
||||
}
|
||||
if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) {
|
||||
if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) {
|
||||
$elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract'));
|
||||
}
|
||||
if (isModEnabled('ticket') && !empty($user->rights->ticket->read)) {
|
||||
|
|
@ -236,7 +236,7 @@ if (isModEnabled('agenda')) {
|
|||
if (isModEnabled('eventorganization') && !empty($user->rights->eventorganization->read)) {
|
||||
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
|
||||
}
|
||||
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
|
||||
if (isModEnabled('partnership') && !empty($user->rights->partnership->read)) {
|
||||
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership'));
|
||||
}
|
||||
|
||||
|
|
@ -1144,7 +1144,7 @@ if ($num) {
|
|||
// If template is for a module, check module is enabled.
|
||||
if ($obj->module) {
|
||||
$tempmodulekey = $obj->module;
|
||||
if (empty($conf->$tempmodulekey) || empty($conf->$tempmodulekey->enabled)) {
|
||||
if (empty($conf->$tempmodulekey) || !isModEnabled($tempmodulekey)) {
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1306,7 +1306,7 @@ if ($num) {
|
|||
|
||||
// If no record found
|
||||
if ($nbqualified == 0) {
|
||||
$colspan = 10;
|
||||
$colspan = 12;
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ if ($mode == 'setup' && $user->admin) {
|
|||
if (is_object($tokenobj)) {
|
||||
// Token refresh
|
||||
print '<tr class="oddeven">';
|
||||
print '<td'.($key['required'] ? ' class="required"' : '').'>';
|
||||
print '<td'.(empty($key['required']) ? '' : ' class="required"').'>';
|
||||
//var_dump($key);
|
||||
print $langs->trans("TOKEN_REFRESH");
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if ($action == 'update') {
|
|||
dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) {
|
||||
dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('INVOICE_CATEGORY_OF_OPERATION')) {
|
||||
|
|
@ -168,14 +168,14 @@ if (isModEnabled('facture')) {
|
|||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), '');
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), $langs->trans("INVOICE_ADD_SWISS_QR_CODEMore"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('INVOICE_ADD_SWISS_QR_CODE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, $conf->global->INVOICE_ADD_SWISS_QR_CODE);
|
||||
}
|
||||
//if ($conf->use_javascript_ajax) {
|
||||
// print ajax_constantonoff('INVOICE_ADD_SWISS_QR_CODE');
|
||||
//} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"), 'bottom' => $langs->trans("AtBottomOfPage").' ('.$langs->trans("Experimental").' - Need PHP 8.1+)');
|
||||
print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, $conf->global->INVOICE_ADD_SWISS_QR_CODE);
|
||||
//}
|
||||
print '</td></tr>';
|
||||
|
||||
// Mention category of operations
|
||||
|
|
|
|||
|
|
@ -164,6 +164,8 @@ print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("BankToRece
|
|||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1);
|
||||
// TODO Add plus to add a bank account
|
||||
print ' <a href="'.DOL_URL_ROOT.'/compta/bank/card.php?action=create&backtopage='.DOL_URL_ROOT.'/admin/prelevement.php"><span class="fa fa-plus-circle"></span></a>';
|
||||
print '</td></tr>';
|
||||
|
||||
/* Moved to bank account data
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ if (GETPOST('sendit') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
|
|||
if ($action == 'updateform') {
|
||||
$antivircommand = GETPOST('MAIN_ANTIVIRUS_COMMAND', 'restricthtml'); // Use GETPOST restricthtml because we must accept ". Example c:\Progra~1\ClamWin\bin\clamscan.exe
|
||||
$antivirparam = GETPOST('MAIN_ANTIVIRUS_PARAM', 'restricthtml'); // Use GETPOST restricthtml because we must accept ". Example --database="C:\Program Files (x86)\ClamWin\lib"
|
||||
$antivircommand = dol_string_nospecial($antivircommand, '', array("|", ";", "<", ">", "&")); // Sanitize command
|
||||
$antivirparam = dol_string_nospecial($antivirparam, '', array("|", ";", "<", ">", "&")); // Sanitize params
|
||||
$antivircommand = dol_string_nospecial($antivircommand, '', array("|", ";", "<", ">", "&", "+")); // Sanitize command
|
||||
$antivirparam = dol_string_nospecial($antivirparam, '', array("|", ";", "<", ">", "&", "+")); // Sanitize params
|
||||
|
||||
if ($antivircommand && !empty($dolibarr_main_restrict_os_commands)) {
|
||||
$arrayofallowedcommand = explode(',', $dolibarr_main_restrict_os_commands);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ print '<br>';
|
|||
// Module debugbar
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
|
||||
$test = empty($conf->debugbar->enabled);
|
||||
$test = !isModEnabled('debugbar');
|
||||
if ($test) {
|
||||
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
|
||||
} else {
|
||||
|
|
@ -110,7 +110,7 @@ print '<br>';
|
|||
// Applicative cache
|
||||
print '<br>';
|
||||
print '<strong>'.$langs->trans("ApplicativeCache").'</strong>: ';
|
||||
$test = !empty($conf->memcached->enabled);
|
||||
$test = isModEnabled('memcached');
|
||||
if ($test) {
|
||||
if (!empty($conf->global->MEMCACHED_SERVER)) {
|
||||
print $langs->trans("MemcachedAvailableAndSetup");
|
||||
|
|
|
|||
|
|
@ -539,14 +539,14 @@ print '<br>';
|
|||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("API"), '', 'folder');
|
||||
|
||||
if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
|
||||
if (!isModEnabled('api') && !isModEnabled('webservices')) {
|
||||
print $langs->trans("APIsAreNotEnabled");
|
||||
} else {
|
||||
if (!empty($conf->webservices->enabled)) {
|
||||
if (isModEnabled('webservices')) {
|
||||
print $langs->trans('YouEnableDeprecatedWSAPIsUseRESTAPIsInstead')."<br>\n";
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->api->enabled)) {
|
||||
if (isModEnabled('api')) {
|
||||
print '<strong>API_ENDPOINT_RULES</strong> = '.getDolGlobalString('API_ENDPOINT_RULES', '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': login:0,users:0,setup:1,status:1,tickets:1,...)</span>')."<br>\n";
|
||||
print '<br>';
|
||||
}
|
||||
|
|
@ -631,6 +631,11 @@ print '<br>';
|
|||
print '<strong>MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS</strong> = '.getDolGlobalString('MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS', '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS</strong> = '.getDolGlobalString('MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS', '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
|
||||
print '<br>';
|
||||
|
||||
// MAIN_ALLOW_LOCAL_LINKS_AS_EXTERNAL_LINKS
|
||||
|
||||
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.getDolGlobalString('MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL', '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
|
||||
print '<br>';
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ $action = GETPOST('action', 'aZ09');
|
|||
// Product On delivery On delivery
|
||||
// Service On invoice On invoice
|
||||
|
||||
$tax_mode = empty($conf->global->TAX_MODE) ? 0 : $conf->global->TAX_MODE;
|
||||
$tax_mode = getDolGlobalString('TAX_MODE') ? 0 : getDolGlobalInt('TAX_MODE');
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
|
@ -220,7 +220,7 @@ if (empty($mysoc->tva_assuj)) {
|
|||
// Products
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Product").'</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment') {
|
||||
if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment') {
|
||||
print $langs->trans("OnPayment");
|
||||
print ' ('.$langs->trans("SupposedToBePaymentDate").')';
|
||||
} else {
|
||||
|
|
@ -229,7 +229,7 @@ if (empty($mysoc->tva_assuj)) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment') {
|
||||
if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment') {
|
||||
print $langs->trans("OnPayment");
|
||||
print ' ('.$langs->trans("SupposedToBePaymentDate").')';
|
||||
} else {
|
||||
|
|
@ -241,7 +241,7 @@ if (empty($mysoc->tva_assuj)) {
|
|||
// Services
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Services").'</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->TAX_MODE_BUY_SERVICE == 'payment') {
|
||||
if (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') {
|
||||
print $langs->trans("OnPayment");
|
||||
print ' ('.$langs->trans("SupposedToBePaymentDate").')';
|
||||
} else {
|
||||
|
|
@ -250,7 +250,7 @@ if (empty($mysoc->tva_assuj)) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
|
||||
if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
|
||||
print $langs->trans("OnPayment");
|
||||
print ' ('.$langs->trans("SupposedToBePaymentDate").')';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ if ($errormsg) {
|
|||
$resultstring = '<div class="ok">';
|
||||
$resultstring .= $langs->trans("BackupFileSuccessfullyCreated").'.<br>';
|
||||
$resultstring .= $langs->trans("YouCanDownloadBackupFile");
|
||||
$resultstring .= '<div>';
|
||||
$resultstring .= '</div>';
|
||||
|
||||
$_SESSION["commandbackupresult"] = $resultstring;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ if ($action == 'edit') {
|
|||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
|
|
|
|||
|
|
@ -40,11 +40,6 @@ $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions
|
|||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
|
||||
/*$arrayofparameters = array(
|
||||
'WORKSTATION_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1),
|
||||
'WORKSTATION_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1)
|
||||
);*/
|
||||
|
||||
$error = 0;
|
||||
$setupnotempty = 0;
|
||||
|
||||
|
|
@ -295,7 +290,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WORKSTATION_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if (getDolGlobalString($constforvar) == $file) {
|
||||
if (getDolGlobalString($constforvar, 'mod_workstation_standard') == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||
|
|
@ -309,7 +304,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
// Info
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
$htmltooltip .= $langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
|
||||
$nextval = $module->getNextValue($mytmpinstance);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
|
|
@ -437,10 +432,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WORKSTATION_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if (getDolGlobalString($constforvar) == $name) {
|
||||
if (getDolGlobalString($constforvar, 'mod_workstation_standard') == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -98,8 +98,8 @@ class DolibarrApi
|
|||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ class Documents extends DolibarrApi
|
|||
} elseif ($modulepart == 'propal' || $modulepart == 'proposal') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->propal->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('propal', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ class Documents extends DolibarrApi
|
|||
} elseif ($modulepart == 'commande' || $modulepart == 'order') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -403,7 +403,7 @@ class Documents extends DolibarrApi
|
|||
throw new RestException(404, 'Purchase order not found');
|
||||
}
|
||||
|
||||
$upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->fournisseur->dir_output."/commande/".dol_sanitizeFileName($object->ref);
|
||||
} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ class Documents extends DolibarrApi
|
|||
} elseif ($modulepart == 'facture' || $modulepart == 'invoice') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('facture', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->propal->lire && !DolibarrApiAccess::$user->rights->commande->lire && !DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('propal', 'lire') && !DolibarrApiAccess::$user->hasRight('commande', 'lire') && !DolibarrApiAccess::$user->hasRight('facture', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -310,8 +310,8 @@ class Setup extends DolibarrApi
|
|||
/**
|
||||
* Get region by ID.
|
||||
*
|
||||
* @param int $id ID of region
|
||||
* @return array Array of cleaned object properties
|
||||
* @param int $id ID of region
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET dictionary/regions/{id}
|
||||
*
|
||||
|
|
@ -325,8 +325,8 @@ class Setup extends DolibarrApi
|
|||
/**
|
||||
* Get region by Code.
|
||||
*
|
||||
* @param string $code Code of region
|
||||
* @return array Array of cleaned object properties
|
||||
* @param string $code Code of region
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET dictionary/regions/byCode/{code}
|
||||
*
|
||||
|
|
@ -659,7 +659,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('commande', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
@ -1249,7 +1249,7 @@ class Setup extends DolibarrApi
|
|||
{
|
||||
$list = array();
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->propal->lire && !DolibarrApiAccess::$user->rights->commande->lire && !DolibarrApiAccess::$user->rights->facture->lire) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('propal', 'lire') && !DolibarrApiAccess::$user->hasRight('commande', 'lire') && !DolibarrApiAccess::$user->hasRight('facture', 'lire')) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ if ($action == 'edit') {
|
|||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, getDolGlobalString($constname), 1);
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ if ($object->id > 0) {
|
|||
$out = '&origin=' . urlencode($object->element . '@' . $object->module) . '&originid=' . urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
||||
$out .= '&backtopage=' . urlencode($urlbacktopage);
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
|
|
@ -182,7 +182,7 @@ if ($object->id > 0) {
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '">' . $langs->trans("AddAction") . '</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AddAction") . '</a>';
|
||||
|
|
@ -191,7 +191,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
$param = '&id=' . $object->id . '&socid=' . $socid;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage=' . urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,8 @@ if ($result < 0) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,8 @@ if ($result < 0) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,8 @@ if (!isset($object->disposal_date) || $object->disposal_date === "") accessforbi
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id;
|
||||
}
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->asset->multidir_output[$object->entity] . "/model/" . $object->id;
|
||||
}
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
|
|
@ -168,7 +168,7 @@ if ($object->id > 0) {
|
|||
$out = '&origin=' . urlencode($object->element . '@' . $object->module) . '&originid=' . urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
||||
$out .= '&backtopage=' . urlencode($urlbacktopage);
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
|
|
@ -184,7 +184,7 @@ if ($object->id > 0) {
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
// if (isModEnabled('agenda')) {
|
||||
// if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
// if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
// print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '">' . $langs->trans("AddAction") . '</a>';
|
||||
// } else {
|
||||
// print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AddAction") . '</a>';
|
||||
|
|
@ -193,7 +193,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
// if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
// if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
// $param = '&id=' . $object->id . '&socid=' . $socid;
|
||||
// if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
// $param .= '&contextpage=' . urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ if (empty($action) && empty($id) && empty($ref)) {
|
|||
// Load object
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete))) || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'delete')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'delete'))) || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||
$permissionnote = $permissiontoadd; // Used by the include of actions_setnotes.inc.php
|
||||
$permissiondellink = $permissiontoadd; // Used by the include of actions_dellink.inc.php
|
||||
$upload_dir = $conf->asset->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id;
|
||||
}
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
|
|
|
|||
|
|
@ -121,9 +121,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
|||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write)));
|
||||
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete)));
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write')));
|
||||
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'delete')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'delete')));
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('asset')) {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ if ($id > 0 || !empty($ref)) {
|
|||
$upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id;
|
||||
}
|
||||
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->read) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->read)));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->write) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->write))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissiontoread = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'read')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'read')));
|
||||
$permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'write')) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('asset', 'model_advance', 'write'))); // Used by the include of actions_addupdatedelete.inc.php
|
||||
$permissionnote = $permissiontoadd; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Security check (enable the most restrictive one)
|
||||
|
|
@ -68,7 +68,8 @@ if (!$permissiontoread) accessforbidden();
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ if (!isModEnabled('asset')) accessforbidden();
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ jQuery(document).ready(function() {
|
|||
print '<input id="fillmanually" type="radio" '.((!GETPOST("selectorforbarcode") || GETPOST("selectorforbarcode") == 'fillmanually') ? 'checked ' : '').'name="selectorforbarcode" value="fillmanually" class="radiobarcodeselect"><label for="fillmanually"> '.$langs->trans("FillBarCodeTypeAndValueManually").'</label>';
|
||||
print '<br>';
|
||||
|
||||
if (!empty($user->rights->produit->lire) || !empty($user->rights->service->lire)) {
|
||||
if (!empty($user->rights->produit->lire) || $user->hasRight('service', 'lire')) {
|
||||
print '<input id="fillfromproduct" type="radio" '.((GETPOST("selectorforbarcode") == 'fillfromproduct') ? 'checked ' : '').'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"><label for="fillfromproduct"> '.$langs->trans("FillBarCodeTypeAndValueFromProduct").'</label>';
|
||||
print '<br>';
|
||||
print '<div class="showforproductselector">';
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||
$langs->loadLangs(array('admin', 'bills', 'blockedlog', 'other'));
|
||||
|
||||
// Access Control
|
||||
if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
|
||||
if ((!$user->admin && !$user->hasRight('blockedlog', 'read')) || empty($conf->blockedlog->enabled)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
|||
$id = GETPOST('id', 'int');
|
||||
$block = new BlockedLog($db);
|
||||
|
||||
if ((!$user->admin && empty($user->rights->blockedlog->read)) || empty($conf->blockedlog->enabled)) {
|
||||
if ((!$user->admin && !$user->hasRight('blockedlog', 'read')) || empty($conf->blockedlog->enabled)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ if ($object->id > 0) {
|
|||
$objcon = new stdClass();
|
||||
|
||||
$out = '&origin='.$object->element.'&originid='.$object->id;
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
|
|
@ -226,7 +226,7 @@ if ($object->id > 0) {
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
|
@ -235,7 +235,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
$param = '&id='.$object->id.'&socid='.$socid;
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$viewlink = dolGetButtonTitle($langs->trans('GroupByX', $langs->transnoentitiesnoconv("Products")), '', 'fa fa-bars imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&token='.newToken(), '', 1, array('morecss' => 'reposition '.($action !== 'treeview' ? 'btnTitleSelected':'')));
|
||||
$viewlink .= dolGetButtonTitle($langs->trans('TreeView'), '', 'fa fa-stream imgforviewmode', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=treeview&token='.newToken(), '', 1, array('morecss' => 'reposition marginleftonly '.($action == 'treeview' ? 'btnTitleSelected':'')));
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMNetNeeds"), $viewlink, '');
|
||||
print load_fiche_titre($langs->trans("BOMNetNeeds"), $viewlink, 'product');
|
||||
|
||||
/*
|
||||
* Lines
|
||||
|
|
|
|||
|
|
@ -74,7 +74,8 @@ restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class Boms extends DolibarrApi
|
|||
*
|
||||
* Return an array with bom informations
|
||||
*
|
||||
* @param int $id ID of bom
|
||||
* @return array|mixed data without useless information
|
||||
* @param int $id ID of bom
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @url GET {id}
|
||||
* @throws RestException
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ if ($object->id > 0) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
|
|
@ -216,7 +216,7 @@ if ($object->id > 0) {
|
|||
$out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
|
|
@ -232,7 +232,7 @@ if ($object->id > 0) {
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
|
@ -241,7 +241,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ if ($object->id) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ if ($object->id) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ if ($object->id > 0) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
|
|
@ -216,7 +216,7 @@ if ($object->id > 0) {
|
|||
$out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
|
|
@ -232,7 +232,7 @@ if ($object->id > 0) {
|
|||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
|
@ -241,7 +241,7 @@ if ($object->id > 0) {
|
|||
|
||||
print '</div>';
|
||||
|
||||
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ if ($object->id) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ if ($object->id) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (! empty($conf->project->enabled))
|
||||
if (isModEnabled('project'))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
|||
|
||||
// Remove
|
||||
if ($permissiontodelete && $action != 'edit') {
|
||||
print '<a class="butActionDelete" href="list.php?bid='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="list.php?id='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ $langs->load("categories");
|
|||
|
||||
// Security check
|
||||
$socid = (int) GETPOST('socid', 'int');
|
||||
if (!$user->rights->categorie->lire) {
|
||||
if (!$user->hasRight('categorie', 'lire')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,8 +286,8 @@ class Categorie extends CommonObject
|
|||
$mapCode = $mapList['code'];
|
||||
self::$MAP_ID_TO_CODE[$mapId] = $mapCode;
|
||||
$this->MAP_ID[$mapCode] = $mapId;
|
||||
$this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk'];
|
||||
$this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table'];
|
||||
$this->MAP_CAT_FK[$mapCode] = isset($mapList['cat_fk']) ? $mapList['cat_fk'] : null;
|
||||
$this->MAP_CAT_TABLE[$mapCode] = isset($mapList['cat_table']) ? $mapList['cat_table'] : null;
|
||||
$this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class'];
|
||||
$this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table'];
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue