Browse Source

Merge branch 'develop' into develop_sunimport

cla 9 years ago
parent
commit
cb96618460
100 changed files with 853 additions and 513 deletions
  1. 294 135
      .travis.yml
  2. 2 2
      COPYRIGHT
  3. 137 1
      ChangeLog
  4. 0 0
      build/.gitignore
  5. 0 0
      build/aps/APP-META-1.1.xml
  6. 0 0
      build/aps/APP-META-1.2.xml
  7. 0 0
      build/aps/README
  8. 1 1
      build/aps/configure.php
  9. 0 1
      build/aps/install.forced.php.install
  10. 0 2
      build/debian/conf.php.install
  11. 0 0
      build/debian/dolibarr.install
  12. 0 0
      build/debian/dolibarr.lintian-overrides
  13. 0 0
      build/debian/dolibarr.templates.futur
  14. 0 2
      build/debian/install.forced.php.install
  15. 0 0
      build/debian/po/POTFILES.in
  16. 0 0
      build/debian/po/fr.po
  17. 0 0
      build/doxygen/doxygen_footer.html
  18. 0 0
      build/doxygen/doxygen_header.html
  19. 1 1
      build/generate_filecheck_xml.php
  20. 2 0
      build/makepack-dolibarr.pl
  21. 2 2
      build/makepack-howto.txt
  22. 0 0
      build/rpm/conf.php
  23. 0 0
      build/rpm/dolibarr-forrpm.patch
  24. 0 0
      build/rpm/dolibarr.desktop
  25. 0 0
      build/rpm/file_contexts.dolibarr
  26. 0 2
      build/rpm/install.forced.php.fedora
  27. 0 1
      build/rpm/install.forced.php.generic
  28. 0 2
      build/rpm/install.forced.php.mandriva
  29. 0 2
      build/rpm/install.forced.php.opensuse
  30. 18 0
      build/travis-ci/apache.conf
  31. 5 5
      composer.json
  32. 19 106
      composer.lock
  33. 0 0
      dev/codesniffer/README
  34. 0 0
      dev/codesniffer/php.ini
  35. 1 0
      dev/codesniffer/ruleset.dtd
  36. 6 6
      dev/codesniffer/ruleset.xml
  37. 0 0
      dev/codetemplates/README
  38. 0 0
      dev/codetemplates/codetemplates.dtd
  39. 0 0
      dev/codetemplates/codetemplates.xml
  40. 0 0
      dev/examples/README
  41. 1 1
      dev/examples/create_invoice.php
  42. 1 1
      dev/examples/create_order.php
  43. 1 1
      dev/examples/create_product.php
  44. 1 1
      dev/examples/create_user.php
  45. 1 1
      dev/examples/get_contracts.php
  46. 1 1
      dev/initdata/generate-invoice.php
  47. 1 1
      dev/initdata/generate-order.php
  48. 1 1
      dev/initdata/generate-product.php
  49. 1 1
      dev/initdata/generate-proposal.php
  50. 1 1
      dev/initdata/generate-thirdparty.php
  51. 1 1
      dev/initdata/sftpget_and_loaddump.php
  52. 0 0
      dev/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF
  53. 0 0
      dev/iso-normes/address_format.txt
  54. 0 0
      dev/iso-normes/banknumber_format.txt
  55. BIN
      dev/iso-normes/format_FEC-Lien_outil_de_test_agréé.pdf
  56. BIN
      dev/iso-normes/format_FEC.pdf
  57. 0 0
      dev/iso-normes/xmlexport.txt
  58. 0 0
      dev/phpunit/README
  59. 0 0
      dev/phpunit/eclipse_setup_for_pti_phpunit.png
  60. 1 1
      dev/skeletons/build_api_class.php
  61. 1 1
      dev/skeletons/build_class_from_table.php
  62. 1 1
      dev/skeletons/build_webservice_from_class.php
  63. 7 3
      dev/skeletons/modMyModule.class.php
  64. 1 1
      dev/skeletons/skeleton_card.php
  65. 2 2
      dev/skeletons/skeleton_list.php
  66. 1 1
      dev/skeletons/skeleton_script.php
  67. 1 1
      dev/translation/autotranslator.php
  68. 184 89
      dev/translation/sanity_check_en_langfiles.php
  69. 1 1
      dev/translation/strip_language_file.php
  70. 0 0
      doc/images/appicon_128.png
  71. 0 0
      doc/images/appicon_16.ico
  72. 0 0
      doc/images/appicon_16.png
  73. 0 0
      doc/images/appicon_32.png
  74. 0 0
      doc/images/appicon_48.ico
  75. 0 0
      doc/images/appicon_64.png
  76. 0 0
      doc/images/dolibarr_73x73.png
  77. 0 0
      doc/images/dolibarr_logo.png
  78. 2 1
      htdocs/.gitignore
  79. 3 2
      htdocs/accountancy/admin/card.php
  80. 1 2
      htdocs/accountancy/admin/fiscalyear_info.php
  81. 42 3
      htdocs/accountancy/bookkeeping/list.php
  82. 2 1
      htdocs/accountancy/bookkeeping/listbyyear.php
  83. 30 0
      htdocs/accountancy/class/bookkeeping.class.php
  84. 1 1
      htdocs/accountancy/class/html.formventilation.class.php
  85. 11 5
      htdocs/accountancy/customer/list.php
  86. 41 76
      htdocs/accountancy/journal/bankjournal.php
  87. 2 2
      htdocs/accountancy/journal/index.php
  88. 3 4
      htdocs/accountancy/journal/purchasesjournal.php
  89. 1 3
      htdocs/accountancy/journal/sellsjournal.php
  90. 2 2
      htdocs/accountancy/supplier/list.php
  91. 2 1
      htdocs/adherents/canvas/actions_adherentcard_common.class.php
  92. 1 8
      htdocs/adherents/card.php
  93. 0 6
      htdocs/adherents/card_subscriptions.php
  94. 1 2
      htdocs/adherents/info_subscription.php
  95. 1 1
      htdocs/adherents/stats/index.php
  96. 2 3
      htdocs/adherents/type.php
  97. 1 1
      htdocs/admin/compta.php
  98. 1 2
      htdocs/admin/confexped.php
  99. 2 1
      htdocs/admin/const.php
  100. 2 3
      htdocs/admin/external_rss.php

+ 294 - 135
.travis.yml

@@ -1,149 +1,308 @@
 # This script is used by Travis CI to run automatically Continuous test integration
 # from Dolibarr GitHub repository.
-# Command run is phpunit
 # For syntax, see http://about.travis-ci.org/docs/user/languages/php/
 
-notifications:
-  email:
-    on_success: never # [always|never|change] default: change
-    on_failure: change # [always|never|change] default: always
-    
+sudo: required
+
+language: php
+
+php:
+- '5.3'
+- '5.4'
+- '5.5'
+- '5.6'
+- '7.0'
+- nightly
+
 addons:
-  postgresql: "9.3"
+  mariadb: '10.0'
+  # FIXME: find a way to import a MySQL dump into PostgreSQL
+  #postgresql: '9.3'
+  apt:
+    packages:
+    # We need a webserver to test the webservices
+    # Let's install Apache with.
+    - apache2
+    # mod_php is not supported by Travis. Add fcgi. We install FPM later on.
+    - libapache2-mod-fastcgi
 
+# Start on every boot
 services:
- - memcached # will start memcached
+- memcached
 
-# This will tell travis to run phpunit
-language: php
-php:
-# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available
- - 5.3
- - 5.4
- - 5.5 
- - 5.6
- - 7.0
+env:
+  global:
+  # Set to true for very verbose output
+  - DEBUG=false
+  matrix:
+  # MariaDB overrides MySQL installation so it's not possible to test both yet
+  #- DB=mysql
+  - DB=mariadb
+  # FIXME: find a way to import a MySQL dump into PostgreSQL
+  #- DB=postgresql
+  # TODO
+  #- DB=sqlite
+  # See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
+  #- WS=apache
+  # See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
+  #- WS=nginx
 
 matrix:
+  fast_finish: true
   allow_failures:
-    - php: 7.0
+  - php: '7.0'
+  - php: nightly
+  # FIXME
+  #- env: DB=postgresql
+  # TODO
+  #- env: DB=sqlite
 
-env:
- - DB=mysql
-# - DB=postgres  
-
-before_script: 
- - echo Start travis
- - echo Current dir is `pwd`
- - echo Home dir is `echo ~`
- - export PHPV=`phpenv version-name`
- - echo PHP version $PHPV 
-# - echo Update composer
-# - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update 
- - echo PHPUnit version
- - which phpunit
- - phpunit --version
- - echo Install phpcs then show installed rules
- - pyrus install pear/PHP_CodeSniffer
- - phpenv rehash
- - which phpcs
- - phpcs --version
- - phpcs -i
- - echo Create dir $(pwd)/htdocs/documents
- - sudo mkdir -p $(pwd)/htdocs/documents/admin/temp;
- - sudo touch $(pwd)/htdocs/documents/dolibarr.log;
- - sudo chmod a+rwx /home; sudo chmod a+rwx /home/travis; sudo chmod -R a+rwx /home/travis/build;
- - sudo chmod -R a+rwx $(pwd);
- - sudo chown -R www-data:travis $(pwd)/htdocs/documents;
- - find $(pwd)/htdocs/documents -type d -exec ls -alt {} \;
- - echo Edit php.ini file
- - echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
-# - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - sh -c "if [ '$PHPV' = '5.3' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- - sh -c "if [ '$PHPV' = '5.4' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- - sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- - sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- - cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo Mysql version
- # INSTALL MYSQL 5.6
- # (https://github.com/piwik/piwik/commit/20bd2e1c24e5d673dce3feb256204ad48c29f160)
- # TODO: Remove when mysql 5.6 is provided by travis.
- # Otherwise, our migrations will raise a syntax error.
- - "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5"
- - "sudo apt-get autoremove"
- - "sudo apt-get install libaio1"
- - "wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/"
- - "sudo dpkg -i mysql-5.6.14.deb"
- - "sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server"
- - "sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/"
- - "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf"
- - "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf"
- - "sudo sed -i'' 's/basedir[^=]\\+=.*$/basedir = \\/opt\\/mysql\\/server-5.6/' /etc/mysql/my.cnf"
- - "sudo /etc/init.d/mysql.server start"
- - mysql --version
- - mysql -e "SELECT VERSION();"
- # /END MYSQL 5.6- mysql --version
- - echo Init database
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
- - echo Create config file htdocs/conf/conf.php
- - echo '<?php ' > htdocs/conf/conf.php
- - sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
- - sh -c "if [ '$DB' = 'mysql' ]; then echo '$'dolibarr_main_db_type=\'mysqli\'';' >> htdocs/conf/conf.php; fi"
- - echo '$'dolibarr_main_url_root=\'http://localhost/\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_document_root=\'$(pwd)/htdocs\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_data_root=\'$(pwd)/htdocs/documents\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_db_host=\'localhost\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_db_name=\'myapp_test\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_db_user=\'travis\'';' >> htdocs/conf/conf.php
- - echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> htdocs/conf/conf.php
- - echo '?>' >> htdocs/conf/conf.php
- - echo Show conf.php content
- - cat htdocs/conf/conf.php
- - echo Install apache server
- - sudo apt-get update
- - sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-pgsql php5-intl
- - sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default
- - echo Show default virtual host
- - sudo cat /etc/apache2/sites-available/default
- - sudo /etc/init.d/apache2 restart
- - wget http://localhost/
- - sudo cat /etc/apache2/envvars
- - sudo cat /var/log/apache2/error.log
- - cat index.html
-
-
-
-script: 
- - cd htdocs/install
- - date
-# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade340350.log
-# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade340350-2.log
- - php upgrade.php 3.5.0 3.6.0 ignoredbversion > upgrade350360.log
- - php upgrade2.php 3.5.0 3.6.0 ignoredbversion > upgrade350360-2.log
- - php upgrade.php 3.6.0 3.7.0 ignoredbversion > upgrade360370.log
- - php upgrade2.php 3.6.0 3.7.0 ignoredbversion > upgrade360370-2.log
- - php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log
-# - cat upgrade370380.log
- - php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
- - php upgrade.php 3.8.0 3.9.0 ignoredbversion > upgrade380390.log
-# - cat upgrade380390.log
- - php upgrade2.php 3.8.0 3.9.0 ignoredbversion > upgrade380390-2.log
-# - cat upgrade380390-2.log
- - cd ../..
- - date
- - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
- - date
-# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1
- - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/htdocs/conf/conf.php,/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1
- - date
+notifications:
+  email:
+    on_success: never # [always|never|change] default: change
+    on_failure: change # [always|never|change] default: always
+  irc:
+    channels:
+    - "chat.freenode.net#dolibarr"
+    on_success: change
+    on_failure: always
+    use_notice: true
 
-after_script:
-# - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log
- - echo Output apache log file; sudo cat /var/log/apache2/error.log
- - echo End travis
+before_install:
+- |
+  echo "Disabling Xdebug for composer"
+  export PHP_VERSION_NAME=$(phpenv version-name)
+  cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
+  phpenv config-rm xdebug.ini
+  echo
+
+install:
+- |
+  echo "Updating Composer"
+  composer self-update
+  echo
+
+- |
+  echo "Installing Parallel Lint"
+  composer -n require jakub-onderka/php-parallel-lint ^0
+  composer -n require jakub-onderka/php-console-highlighter ^0
+  echo
+
+- |
+  echo "Installing PHP Unit"
+  if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
+    composer -n require phpunit/phpunit ^4
+  fi
+  if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+    composer -n require phpunit/phpunit ^5
+  fi
+  echo
+
+- |
+  echo "Installing PHP CodeSniffer"
+  composer require squizlabs/php_codesniffer ^2
+  echo
 
+- |
+  echo "Adding Composer binaries to the path"
+  export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
+  echo
+
+before_script:
+- |
+  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
+  if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
+    echo
+    echo "Enabling APC for PHP <= 5.4"
+    #   Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
+    echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
+    echo
+    echo "Enabling Memcached for PHP <= 5.4"
+    #   Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
+    echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
+  fi
+  phpenv rehash
+  echo
+
+- |
+  if [ "$DEBUG" = true ]; then
+    echo "Debugging informations"
+    # Check PHP
+    php -i
+    # Check PHP CodeSniffer installation
+    which phpcs
+    phpcs --version
+    phpcs -i
+    # Check PHPUnit installation
+    which phpunit
+    phpunit --version
+    # Check MySQL
+    mysql --version
+    mysql -e "SELECT VERSION();"
+    echo
+  fi
+
+- |
+  echo "Setting up database"
+  if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
+    echo "MySQL"
+    mysql -e 'DROP DATABASE IF EXISTS travis;'
+    mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
+    mysql -D travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
+  fi
+  # FIXME: find a way to import a MySQL dump into PostgreSQL
+  #if [ "$DB" = 'postgresql' ]; then
+  #  pgsql travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
+  #fi
+  # TODO: SQLite
+  echo
+
+- |
+  echo "Setting up Dolibarr"
+  export CONF_FILE=htdocs/conf/conf.php
+  echo '<?php ' > $CONF_FILE
+  echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
+  echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
+  echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/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=\'travis\'';' >> $CONF_FILE
+  if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
+    echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
+  fi
+  # FIXME
+  #if [ "$DB" = 'postgresql' ]; then
+  #  echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE
+  #fi
+  # TODO: SQLite
+  echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
+  echo
+
+- |
+  if [ "$DEBUG" = true ]; then
+    echo "Debugging informations"
+    cat $CONF_FILE
+    echo
+  fi
+
+- |
+  echo "Create documents directory and set permissions"
+  # and admin/temp subdirectory needed for unit tests
+  mkdir -p documents/admin/temp
+  echo
+
+- |
+  echo "Setting up Apache + FPM"
+  # enable php-fpm
+  cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
+  if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
+    # Copy the included pool
+    cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
+  fi
+  if [ "$DEBUG" = true ]; then
+    cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
+  fi
+  sudo a2enmod rewrite actions fastcgi alias
+  echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
+  if [ "$DEBUG" = true ]; then
+    cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
+  fi
+  ~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm
+  # configure apache virtual hosts
+  sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default
+  sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
+  if [ "$DEBUG" = true ]; then
+    sudo cat /etc/apache2/sites-available/default
+  fi
+  sudo service apache2 restart
+  echo
+
+script:
+- |
+  echo "Checking webserver availability"
+  # Ensure we catch errors
+  set -e
+  wget http://127.0.0.1
+  if [ "$DEBUG" = true ]; then
+    cat index.html
+  fi
+  set +e
+  echo
+
+- |
+  echo "Checking PHP syntax errors"
+  # Ensure we catch errors
+  set -e
+  parallel-lint --exclude htdocs/includes --blame .
+  set +e
+  echo
+
+# TODO: dev/* checks
+
+- |
+  echo "Checking coding style"
+  # Ensure we catch errors
+  set -e
+  # Exclusions are defined in the ruleset.xml file
+  phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/codesniffer/ruleset.xml --encoding=utf-8 .
+  set +e
+  echo
+
+# TODO: Check Javascript (jshint?)
+
+# TODO: Check CSS (csslint?)
+
+# TODO: check SQL syntax (pgsanity?)
+
+- |
+  echo "Upgrading Dolibarr"
+  # Ensure we catch errors
+  set -e
+  cd htdocs/install
+  php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
+  php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log
+  php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
+  php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log
+  php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
+  php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log
+  php upgrade.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390.log
+  php upgrade2.php 3.8.0 3.9.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade380390-2.log
+  cd -
+  set +e
+  echo
+
+- |
+  echo "Unit testing"
+  # Ensure we catch errors
+  set -e
+  phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
+  set +e
+  echo
+
+after_success:
+
+after_failure:
+- |
+  if [ "$DEBUG" = true ]; then
+    echo "Debugging informations"
+    # Upgrade log files
+    cat *.log
+    # Dolibarr log file
+    cat documents/dolibarr.log
+    # Apache log file
+    sudo cat /var/log/apache2/error.log
+    # MariaDB log file
+    sudo cat /var/log/mysql/error.log
+    # TODO: PostgreSQL log file
+    echo
+  fi
+
+after_script:

+ 2 - 2
COPYRIGHT

@@ -19,7 +19,7 @@ EvalMath               1.0           BSD                         Yes
 Escpos-php                           MIT License                 Yes             Thermal receipt printer library, for use with ESC/POS compatible printers
 FPDI                   1.5.2         Apache Software License 2.0 Yes             PDF templates management
 GeoIP                  1.4           LGPL-2.1+                   Yes             Sample code to make geoip convert (not into deb package)
-Mobiledetect           2.8.3         MIT License                 Yes             Detect mobile devices browsers
+Mobiledetect           2.8.17        MIT License                 Yes             Detect mobile devices browsers
 NuSoap                 0.9.5         LGPL 2.1+                   Yes             Library to develop SOAP Web services (not into rpm and deb package)
 PEAR Mail_MIME         1.8.9         BSD                         Yes             NuSoap dependency
 odtPHP                 1.0.1         GPL-2+  b                   Yes             Library to build/edit ODT files
@@ -28,7 +28,7 @@ php-iban               1.4.7         LGPL-3+                     Yes
 PHPoAuthLib            0.8.2         MIT License                 Yes             Library to provide oauth1 and oauth2 to different service
 PHPPrintIPP            1.3           GPL-2+                      Yes             Library to send print IPP requests
 Restler                3.0           LGPL-3+                     Yes             Library to develop REST Web services
-TCPDF                  6.2.6         LGPL-3+                     Yes             PDF generation
+TCPDF                  6.2.12        LGPL-3+                     Yes             PDF generation
 TCPDI                  1.0.0         LGPL-3+ / Apache 2.0        Yes             FPDI replacement
 
 JS libraries:

+ 137 - 1
ChangeLog

@@ -6,17 +6,151 @@ WARNING:
 
 Do not try to make any Dolibarr upgrade if you are running Mysql version 5.5.40.
 Mysql version 5.5.40 has a very critical bug making your data beeing definitely lost.
-You may also experience troubles with Mysql 5.5.41 with error "Lost connection" during migration.
+You may also experience troubles with Mysql 5.5.41/42/43 with error "Lost connection"
+during migration.
 Upgrading to any other version or any other database system is abolutely required BEFORE trying
 make a Dolibarr upgrade.
 
 
 ***** ChangeLog for 3.9 compared to 3.8.* *****
+For users:
+NEW: A new and more modern look for "eldy" theme.
+NEW: Introduce a new theme called "Material Design". 
+NEW: #3767 Allow changing multiple prices of a product at once
+NEW: Add a button to purge criteria in user list
+NEW: Add a filter field to restrict list of member when doing a LDAP list request. Use also this filter into ldap command line script making sync from ldap to dolibarr.
+NEW: Add all assigned users and all extrafields data in new event when we createFromClone
+NEW: Add hidden option to use standard position address in crabe model For electronic sending solutions
+NEW: Add a refresh button on page list of direct print jobs.
+NEW: Add a tab "document" in donation card
+NEW: Add cancel button on thirdparty create page
+NEW: Add chart of product statistics
+NEW: Add color on categories
+NEW: Add css class and ids on column of detail lines to allow module to easily manipulate fields.
+NEW: Add date value filter on account records list
+NEW: Add __PROJECT_NAME__ tag for customer invoice emails
+NEW: Add option PDF_ALLOW_HTML_FOR_FREE_TEXT to be able to enter pdf footer text with wysiwyg editor.
+NEW: Add fields into llx_cronjobs to be able to use job table to queue one shot jobs.
+NEW: Add filter on status on invoice list
+NEW: Add filter on status on shipments
+NEW: Add gender property managed on user card FIX: Better error messages when uploading photo of user when permission to write are not granted
+NEW: Add help tooltips on fields of dictionary edit pages.
+NEW: Add hidden option MAIN_MAILFORM_DISABLE_ENTERKEY to disable the key enter into the form to send email.
+NEW: Add hook in send mail
+NEW: Add hooks on list of members to allow an external module to add more fields into list view.
+NEW: Add hooks to allow an external module to complete list of events into calendar views.
+NEW: Add $ID$ into extrafields management to allow use of current object id on filter for select list from table and checkbox list from table
+NEW: Add info page on product card
+NEW: Add into about page, a sample text to use to promote new version release (visible only if version is last stable)
+NEW: Add none/all selection into list of files for FTP browser module
+NEW: Add opportunity amount on project card.
+NEW: Add parameter to add a link to use "date of invoice" in one click when fille a payment card.
+NEW: Add planned workload and declared progress on project summary list on project home page (data aggregated from tasks of project)
+NEW: Add "productpricecard" hook and uniformize code
+NEW: Add ref and label of project into export
+NEW: Add status into filters of graph
+NEW: Add tab document on salaries payment
+NEW: Add thumb of users into thumbs stats on home page
+NEW: A link to the bugtracker can be enabled in the GUI
+NEW: Better look for POS. More responsive design.
+NEW: Can add project search on left menu search area
+NEW: Can assign a task to yourself to have it appear on timesheet
+NEW: Can choose fields to show on project list
+NEW: Can close a project that has draft status with no need to switch it to validate status before.
+NEW: Can edit Background color for Top menu and Background color for table title line.
+NEW: Can edit email template using WYSIWYG editor
+NEW: Can edit list of prospect status for customers/prospects. Add a new entry into dictionary table to manage list fo status. Removed deprecated files.
+NEW: Can filter on contact status in prospect list. Removed deprecated menu entry.
+NEW: Can filter proposal on a tag of a product Enhance also the prototype test_arrays to include select form before table.
+NEW: Can filter proposal, orders or invoices with criteria "contain at least one product with following tag"
+NEW: Can select fields to show in product list. Extrafields are also supported.
+NEW: Can select fields to show into the contact list. Extrafields are also supported.
+NEW: Can select which field to show into list of users. Extrafields are also supported.
+NEW: Can set default value of event type when creating an event (if type of event option is used).
+NEW: Can upload files on leave requests. Use more standard permissions.
+NEW: Can use a "|" to make a OR search on several different criterias into text filters of tables.
+NEW: Can use the * as a joker characters into search boxes of lists
+NEW: Clean code into salary module, debug and add indexes NEW: Can filter on user list and salary payments on user with naural search.
+NEW: clone action on agenda events
+NEW: Color category is visible onto the thumb of tags on thirdparty, or products cards.
+NEW: conf to use next product/service ref when we clone a product/service
+NEW: Contract module can be used to follow both sold and bought contracts/recurring subscriptions.
+NEW: Enhance prototype, project list and proposal list with new hooks to have an external module able to add more fields.
+NEW: Enhance style engine. Add option to set color of links.
+NEW: Enter amount for withdraws requests
+NEW: FEATURE PROPOSAL: on proposal, order or invoice creation from scratch, reload page after customer selection so its informations can be loaded
+NEW: Filter "active" by default on user list. Fix label of permission of project module.
+NEW: Forms are using the tab look, even in creation mode.
+NEW: Free text for cheque deposit receipt can be HTML content.
+NEW: Hidden option THEME_ELDY_USE_HOVER is stable enough to become officialy visible into setup.
+NEW: If module salaries is on, you can set a hourly value for time consumed by users. Each time a user enter its time consumed on a project, a calculation is done to provide the cost for human services. This value appears into the "Transversal view" of project.
+NEW: Import Sales representatives of third parties
+NEW: Increase length of bank code to 128 char #3704
+NEW: info function for product card
+NEW: Into the overview of projects, the name of thirdparty appears into combo lists of elements to link to project.
+NEW: Introduce a "code" into fiels to describe vat. This will allow to suggest different vat lines with same value with ability to differentiate them.
+NEW: Introduce cost price on product.
+NEW: Introduce hidden option MAIN_LANDING_PAGE to decide the home page visible just after login.
+NEW: Introduce hidden option MAIN_REPLACE_TRANS_xx_XX to allow simple replacement of translated string on the fly.
+NEW: Introduce table llx_overwrite_trans to be able to overwrite translations by simple database edition.
+NEW: Introduce use of cache for thumbs images of users
+NEW: Experimental level multiprice generator based on per cent variations over base price
+NEW: List of projects of a thirdparty are visible on a project tab
+NEW: Merge all left menu search boxes into one.
+NEW: Merge all search fields of an area page into one search box
+NEW: next ref on clone doesn't need conf, it's used if mask exists
+NEW: ODT generators can set meta properties of ODT file
+NEW: On list of thirdparties, user can select fields to show. Make phpunit test working again localy. Add missing columns into llx_expedition.
+NEW: Only arrow of current sorted field is visible into table views. This save a lot of spaces. You can click on the column title to sort. This make clickable area larger and click to sort is easier.
+NEW: On page to see/edit contact of an ojbect, the status of contact is visible (for both external and internal users).
+NEW: Option encrypt password into databae is set to on by default on first install.
+NEW: print event type on third party card tab agenda list (only if AGENDA_USE_EVENT_TYPE = 1)
+NEW: Provide an easier way to understand if an order can be shipped.
+NEW: Quick searh filter works on invoice, proposal, order, intervention, contract
+NEW: Rename install "etape" into english "step"
+NEW: Replace category edition page on members with new select2 component.
+NEW: Show photo of logged user into login top right block. NEW: If no photo is available for user, we show a generic photo depending on gender
+NEW: Show photo of user into user list. A new function getImageFileNameForSize was also introduced to choose image best size according to usage to save bandwith.
+NEW: Show which fields are used for search when doing a generic search from the quick search form.
+NEW: Statistic graphs on products offer a filter on product type (product / service or both)
+NEW: Support logging to a Sentry server
+NEW: Syslog displays configuration errors
+NEW: The clicktodial module is now able to provide link "tel:" on phone numbers. So it is also possible to use clicktodial with a client solution like the "xivo" local client.
+NEW: The conditional IF into ODT templates works also on not defined var so we can show data only if defined. Close #3819
+NEW: The free text in PDF footer can now be a HTML content. So the WYSIWYG editor is on by default to edit it into module setup.
+NEW: The quick search box on left menu can also search into expense reports.
+NEW: The search box and the bookmarks are now rendered by the menu manager.
+NEW: The thirdparties tabs, the contacts tabs and the members tabs are now presented using a new top banner, saving space and using a same way to show address, status and navigation arrows.
+NEW: Thumbs for statistics on main page are fully clicable (not only link inside the thumb)
+NEW: Translate extrafield's labels
+NEW: Uniformize way of working for search filters. One filter per object.
+NEW: Used matching icons for Material Design theme
+NEW: Use new select2 component for juridical status, country and state selection.
+NEW: When creating order, proposal or invoice from thirdparty card, the project is asked during creation. A link to create project if it does not exists is also available. NEW: Uniformize form creation of proposal to add public and private notes during creation like done for order and invoice.
+
+For developers:
+NEW: Add a new widget $form->selectArrayAjax() to use combo list with content coming from an Ajax URL.
+NEW: Add doActions hook method call in contract card
+NEW: Added doActions hooks to user cards
+NEW: Add a new component to select categories/tags from the main edit page of product. The dedicated tab is also removed.
+NEW: upgrade jQuery Component Datable (and extras) to 1.10.7
+NEW: script to build API class from existing class
+NEW: Prepare database to store information per files (for example to define if an image can be used as a cover or not)
+NEW: log hooks loading
+NEW: Introduce property module_position so a module can decide where it appears into list of modules.
+NEW: Introduce function dolGetFirstLineOfText
+NEW: Introduce a method getDefaultCreateValueForField for developers to get a default value to use for a form in create mode. Implement it for public and private notes.
+NEW: A module can add its entries into cron module.
+NEW: Framework feature. To have a page being loaded at same scrollbar level after a click on a href link, just add the class "reposition" on this link.
+NEW: Add exemple of setup for multitail to render dolibarr log files
+NEW: Add restler framework. First step to build REST API into Dolibarr.
+
 
 WARNING: 
 
 Following changes may create regression for some external modules, but were necessary to make
 Dolibarr better:
+- Deprecated Product::setPriceExpression. Use Product::update instead
 - Deprecated hidden option MAIN_USE_CUSTOM_TRANSLATION has been removed. Use table llx_overwrite_trans instead.
 - Trigger LINECONTRACT_INSERT has been renamed into LINECONTRACT_CREATE to match common denomination.
 - A lot hooks used into PDF generation were not correctly implemented. We had to fix this. The result si that
@@ -26,6 +160,8 @@ This is list of hooks modified:
 'pdf_getlinenum', 'pdf_getlineref', 'pdf_getlineref_supplier', 'pdf_getlinevatrate', 'pdf_getlineupexcltax',
 'pdf_getlineupwithtax', 'pdf_getlineqty', 'pdf_getlineqty_asked', 'pdf_getlineqty_shipped', 'pdf_getlineqty_keeptoship',
 'pdf_getlineunit', 'pdf_getlineremisepercent', 'pdf_getlineprogress', 'pdf_getlinetotalexcltax', 'pdf_getlinetotalwithtax'
+- Renamed Product::isservice and Product::isproduct to match PSR-2
+- Remove deprecated Product::hidden property
 
 
  

+ 0 - 0
build/.gitignore


+ 0 - 0
build/aps/APP-META-1.1.xml


+ 0 - 0
build/aps/APP-META-1.2.xml


+ 0 - 0
build/aps/README


+ 1 - 1
build/aps/configure.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /*-----------------------------------------------------
  *

+ 0 - 1
build/aps/install.forced.php.install

@@ -21,4 +21,3 @@ $force_install_databaserootpass='';
 $force_install_dolibarrlogin='admin';
 $force_install_nophpinfo='1';
 $force_install_lockinstall='444';
-?>

+ 0 - 2
build/debian/conf.php.install

@@ -226,5 +226,3 @@ $dolibarr_main_prod='0';
 # Default value: 0 (use database value if exist)
 # Examples:
 # $dolibarr_mailing_limit_sendbyweb='0';
-
-?>

+ 0 - 0
build/debian/dolibarr.install


+ 0 - 0
build/debian/dolibarr.lintian-overrides


+ 0 - 0
build/debian/dolibarr.templates.futur


+ 0 - 2
build/debian/install.forced.php.install

@@ -42,5 +42,3 @@ $force_install_lockinstall='444';
 //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
 //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
 //$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf';
-
-?>

+ 0 - 0
build/debian/po/POTFILES.in


+ 0 - 0
build/debian/po/fr.po


+ 0 - 0
build/doxygen/doxygen_footer.html


+ 0 - 0
build/doxygen/doxygen_header.html


+ 1 - 1
build/generate_filecheck_xml.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2015 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 2 - 0
build/makepack-dolibarr.pl

@@ -533,8 +533,10 @@ if ($nboftargetok) {
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.txt`;
+        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/PHPExcel/Shared/PDF`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/PHPExcel/Shared/PCLZip`;
+        $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
         $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;

+ 2 - 2
build/makepack-howto.txt

@@ -9,7 +9,7 @@ beta version of Dolibarr, step by step.
 
 - Check all files are commited.
 - Update version/info in ChangeLog. 
-To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
+To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
 To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
 - Update version number with x.y.z-w in htdocs/filefunc.inc.php
 - Commit all changes.
@@ -31,7 +31,7 @@ complete release of Dolibarr, step by step.
 
 - Check all files are commited.
 - Update version/info in ChangeLog. 
-To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
+To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
 To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
 - Update version number with x.y.z in htdocs/filefunc.inc.php
 - Commit all changes.

+ 0 - 0
build/rpm/conf.php


+ 0 - 0
build/rpm/dolibarr-forrpm.patch


+ 0 - 0
build/rpm/dolibarr.desktop


+ 0 - 0
build/rpm/file_contexts.dolibarr


+ 0 - 2
build/rpm/install.forced.php.fedora

@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
 //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
 $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf';
-
-?>

+ 0 - 1
build/rpm/install.forced.php.generic

@@ -20,4 +20,3 @@ $force_install_lockinstall='444';
 
 // Value to overwrite path to use shared libraries/fonts instead of embedded one
 // We don't force any external lib with generic package
-?>

+ 0 - 2
build/rpm/install.forced.php.mandriva

@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
 //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
 $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/TTF/dejavu/DejaVuSans-Bold.ttf';
-
-?>

+ 0 - 2
build/rpm/install.forced.php.opensuse

@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
 //$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
 //$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
 $force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/DejaVuSans-Bold.ttf';
-
-?>

+ 18 - 0
build/travis-ci/apache.conf

@@ -0,0 +1,18 @@
+<VirtualHost *:80>
+  DocumentRoot %TRAVIS_BUILD_DIR%/htdocs
+
+  <Directory "%TRAVIS_BUILD_DIR%/htdocs">
+    Options FollowSymLinks MultiViews ExecCGI
+    AllowOverride All
+    Order deny,allow
+    Allow from all
+  </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
+  </IfModule>
+</VirtualHost>

+ 5 - 5
composer.json

@@ -18,12 +18,10 @@
         "ccampbell/chromephp": "^4.1",
         "ckeditor/ckeditor": "dev-full/4.3.x#0b7c3f1",
         "mike42/escpos-php": "dev-master",
-        "mobiledetect/mobiledetectlib": "2.8.3",
+        "mobiledetect/mobiledetectlib": "2.8.17",
         "phpoffice/phpexcel": "1.8.1",
         "restler/framework": "^3.0",
-        "tecnickcom/tcpdf": "6.2.6",
-        "raven/raven": "^0.12.0",
-        "firephp/firephp-core": "^0.4.0"
+        "tecnickcom/tcpdf": "6.2.12"
     },
     "suggest": {
         "ext-mysqlnd": "To use with MySQL or MariaDB",
@@ -38,7 +36,9 @@
         "ext-mbstring": "Handle non UTF-8 databases",
         "ext-soap": "Native SOAP",
         "ext-zip": "ODT and Excel support",
-        "ext-xml": "Excel support"
+        "ext-xml": "Excel support",
+        "firephp/firephp-core": "Logging to Firebug console support",
+        "raven/raven": "Sentry logging server support"
     },
     "config": {
         "vendor-dir": "htdocs/includes"

+ 19 - 106
composer.lock

@@ -4,7 +4,8 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
         "This file is @generated automatically"
     ],
-    "hash": "335eb7bd5c2eb116fd2da80b4f48e857",
+    "hash": "d8229cbb9aea945c9ca803bbe54d7aa7",
+    "content-hash": "47929ed42fb67e5159ccec6a3a5a45eb",
     "packages": [
         {
             "name": "ccampbell/chromephp",
@@ -90,54 +91,18 @@
             ],
             "time": "2014-02-26 15:43:10"
         },
-        {
-            "name": "firephp/firephp-core",
-            "version": "v0.4.0",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/firephp/firephp-core.git",
-                "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/firephp/firephp-core/zipball/fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf",
-                "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf",
-                "shasum": ""
-            },
-            "type": "library",
-            "autoload": {
-                "classmap": [
-                    "lib/FirePHPCore/FirePHP.class.php",
-                    "lib/FirePHPCore/fb.php"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Christoph Dorn",
-                    "email": "christoph@christophdorn.com",
-                    "homepage": "http://christophdorn.com"
-                }
-            ],
-            "description": "Traditional FirePHPCore library for sending PHP variables to the browser.",
-            "homepage": "https://github.com/firephp/firephp-core",
-            "time": "2013-04-23 15:28:20"
-        },
         {
             "name": "mike42/escpos-php",
             "version": "dev-master",
             "source": {
                 "type": "git",
                 "url": "https://github.com/mike42/escpos-php.git",
-                "reference": "0564ff94de45564221eca99c4cd5ab24492894c2"
+                "reference": "63648d03d47b81e8f6c1020ac92f051a3f3b5793"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/mike42/escpos-php/zipball/0564ff94de45564221eca99c4cd5ab24492894c2",
-                "reference": "0564ff94de45564221eca99c4cd5ab24492894c2",
+                "url": "https://api.github.com/repos/mike42/escpos-php/zipball/63648d03d47b81e8f6c1020ac92f051a3f3b5793",
+                "reference": "63648d03d47b81e8f6c1020ac92f051a3f3b5793",
                 "shasum": ""
             },
             "require": {
@@ -182,26 +147,28 @@
                 "print",
                 "receipt"
             ],
-            "time": "2015-11-02 10:50:46"
+            "time": "2015-12-04 10:23:55"
         },
         {
             "name": "mobiledetect/mobiledetectlib",
-            "version": "2.8.3",
+            "version": "2.8.17",
             "source": {
                 "type": "git",
                 "url": "https://github.com/serbanghita/Mobile-Detect.git",
-                "reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee"
+                "reference": "b87da5f63a76e9615a0c74fcf168657b1ea7e41d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/f5753e4b90daffe50c902e99df5ce3c58fca3fee",
-                "reference": "f5753e4b90daffe50c902e99df5ce3c58fca3fee",
+                "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/b87da5f63a76e9615a0c74fcf168657b1ea7e41d",
+                "reference": "b87da5f63a76e9615a0c74fcf168657b1ea7e41d",
                 "shasum": ""
             },
             "require": {
                 "php": ">=5.0.0"
             },
             "require-dev": {
+                "codeclimate/php-test-reporter": "dev-master",
+                "johnkary/phpunit-speedtrap": "~1.0@dev",
                 "phpunit/phpunit": "*"
             },
             "type": "library",
@@ -221,7 +188,7 @@
                 {
                     "name": "Serban Ghita",
                     "email": "serbanghita@gmail.com",
-                    "homepage": "http://ghita.org",
+                    "homepage": "http://mobiledetect.net",
                     "role": "Developer"
                 }
             ],
@@ -234,7 +201,7 @@
                 "mobile detector",
                 "php mobile detect"
             ],
-            "time": "2014-07-10 20:00:25"
+            "time": "2015-09-17 14:45:21"
         },
         {
             "name": "phpoffice/phpexcel",
@@ -293,60 +260,6 @@
             ],
             "time": "2015-05-01 07:00:55"
         },
-        {
-            "name": "raven/raven",
-            "version": "0.12.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/getsentry/raven-php.git",
-                "reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/getsentry/raven-php/zipball/b325984c792ff89f985b73da9a3ad8ed8b520bca",
-                "reference": "b325984c792ff89f985b73da9a3ad8ed8b520bca",
-                "shasum": ""
-            },
-            "require": {
-                "ext-curl": "*",
-                "php": ">=5.2.4"
-            },
-            "require-dev": {
-                "fabpot/php-cs-fixer": "^1.8.0",
-                "phpunit/phpunit": "^4.6.6"
-            },
-            "bin": [
-                "bin/raven"
-            ],
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "0.12.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-0": {
-                    "Raven_": "lib/"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "BSD"
-            ],
-            "authors": [
-                {
-                    "name": "David Cramer",
-                    "email": "dcramer@gmail.com"
-                }
-            ],
-            "description": "A PHP client for Sentry (http://getsentry.com)",
-            "homepage": "http://getsentry.com",
-            "keywords": [
-                "log",
-                "logging"
-            ],
-            "time": "2015-08-25 22:38:46"
-        },
         {
             "name": "restler/framework",
             "version": "3.0.0",
@@ -423,16 +336,16 @@
         },
         {
             "name": "tecnickcom/tcpdf",
-            "version": "6.2.6",
+            "version": "6.2.12",
             "source": {
                 "type": "git",
                 "url": "https://github.com/tecnickcom/TCPDF.git",
-                "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb"
+                "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
-                "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
+                "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/2f732eaa91b5665274689b1d40b285a7bacdc37f",
+                "reference": "2f732eaa91b5665274689b1d40b285a7bacdc37f",
                 "shasum": ""
             },
             "require": {
@@ -482,7 +395,7 @@
                 "pdf417",
                 "qrcode"
             ],
-            "time": "2015-01-28 18:51:40"
+            "time": "2015-09-12 10:08:34"
         }
     ],
     "packages-dev": [],

+ 0 - 0
dev/codesniffer/README


+ 0 - 0
dev/codesniffer/php.ini


+ 1 - 0
dev/codesniffer/ruleset.dtd

@@ -3,6 +3,7 @@
 <!ATTLIST ruleset name CDATA "">
 <!ELEMENT description (#PCDATA)>
 <!ELEMENT exclude-pattern (#PCDATA)>
+<!ATTLIST exclude-pattern type CDATA "">
 <!ELEMENT rule (properties*,severity*)>
 <!ATTLIST rule ref CDATA "">
 <!ELEMENT properties (property+)>

+ 6 - 6
dev/codesniffer/ruleset.xml

@@ -3,12 +3,12 @@
 <ruleset name="Dolibarr">
 	<description>Dolibarr coding standard.</description>
 
-	<exclude-pattern>*/conf.php</exclude-pattern>
-	<exclude-pattern>*/includes/*</exclude-pattern>
-	<exclude-pattern>*/documents/*</exclude-pattern>
-	<exclude-pattern>*/dev/vagrant/*</exclude-pattern>
-	<exclude-pattern>*/custom/*</exclude-pattern>
-	<exclude-pattern>*/nltechno*</exclude-pattern>
+	<exclude-pattern type="relative">build/html</exclude-pattern>
+	<exclude-pattern type="relative">documents</exclude-pattern>
+	<exclude-pattern type="relative">htdocs/custom</exclude-pattern>
+	<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
+	<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
+	<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
 
 		<!-- List of all tests -->
 

+ 0 - 0
dev/codetemplates/README


+ 0 - 0
dev/codetemplates/codetemplates.dtd


+ 0 - 0
dev/codetemplates/codetemplates.xml


+ 0 - 0
dev/examples/README


+ 1 - 1
dev/examples/create_invoice.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/examples/create_order.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/examples/create_product.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/examples/create_user.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/examples/get_contracts.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/initdata/generate-invoice.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  *

+ 1 - 1
dev/initdata/generate-order.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2007 Laurent Destailleur  <eldy@users.sourceforge.net>

+ 1 - 1
dev/initdata/generate-product.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2004-2010 Laurent Destailleur  <eldy@users.sourceforge.net>

+ 1 - 1
dev/initdata/generate-proposal.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2007 Laurent Destailleur  <eldy@users.sourceforge.net>

+ 1 - 1
dev/initdata/generate-thirdparty.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
  * Copyright (C) 2006-2013 Laurent Destailleur  <eldy@users.sourceforge.net>

+ 1 - 1
dev/initdata/sftpget_and_loaddump.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2012 Laurent Destailleur	<eldy@users.sourceforge.net>
  *

+ 0 - 0
dev/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF


+ 0 - 0
dev/iso-normes/address_format.txt


+ 0 - 0
dev/iso-normes/banknumber_format.txt


BIN
dev/iso-normes/format_FEC-Lien_outil_de_test_agréé.pdf


BIN
dev/iso-normes/format_FEC.pdf


+ 0 - 0
dev/iso-normes/xmlexport.txt


+ 0 - 0
dev/phpunit/README


+ 0 - 0
dev/phpunit/eclipse_setup_for_pti_phpunit.png


+ 1 - 1
dev/skeletons/build_api_class.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2015   Jean-François Ferry <jfefe@aternatik.fr>
  *

+ 1 - 1
dev/skeletons/build_class_from_table.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2008-2014 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 1 - 1
dev/skeletons/build_webservice_from_class.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 7 - 3
dev/skeletons/modMyModule.class.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2015 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2012 Regis Houssin        <regis.houssin@capnetworks.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -46,7 +46,7 @@ class modMyModule extends DolibarrModules
 
 		// Id for module (must be unique).
 		// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
-		$this->numero = 100000;
+		$this->numero = 500000;		// TODO Go on page http://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module
 		// Key text used to identify module (for permissions, menus, etc...)
 		$this->rights_class = 'mymodule';
 
@@ -166,7 +166,11 @@ class modMyModule extends DolibarrModules
 		// Add here list of php file(s) stored in core/boxes that contains class to show a box.
         $this->boxes = array();			// List of boxes
 		// Example:
-		//$this->boxes=array(array(0=>array('file'=>'myboxa.php','note'=>'','enabledbydefaulton'=>'Home'),1=>array('file'=>'myboxb.php','note'=>''),2=>array('file'=>'myboxc.php','note'=>'')););
+		//$this->boxes=array(
+		//    0=>array('file'=>'myboxa.php@mymodule','note'=>'','enabledbydefaulton'=>'Home'),
+		//    1=>array('file'=>'myboxb.php@mymodule','note'=>''),
+		//    2=>array('file'=>'myboxc.php@mymodule','note'=>'')
+		//);
 
 		// Cronjobs
 		$this->cronjobs = array();			// List of cron jobs entries to add

+ 1 - 1
dev/skeletons/skeleton_card.php

@@ -88,7 +88,7 @@ $extrafields = new ExtraFields($db);
 ********************************************************************/
 
 $parameters=array();
-$reshook=$hookmanager->executeHooks('doActions',$parameters);    // Note that $action and $object may have been modified by some hooks
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
 
 if (empty($reshook))

+ 2 - 2
dev/skeletons/skeleton_list.php

@@ -124,7 +124,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
 ********************************************************************/
 
 $parameters=array();
-$reshook=$hookmanager->executeHooks('doActions',$parameters);    // Note that $action and $object may have been modified by some hooks
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
 
 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
@@ -271,7 +271,7 @@ if ($resql)
     if ($sall)
     {
         foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
-        print $langs->trans("FilterOnInto", $sall, join(', ',$fieldstosearchall));
+        print $langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall);
     }
     
 	if (! empty($moreforfilter))

+ 1 - 1
dev/skeletons/skeleton_script.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2007-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) ---Put here your own copyright and developer email---

+ 1 - 1
dev/translation/autotranslator.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2009-2012 Laurent Destailleur  <eldy@users.sourceforge.net>
  *

+ 184 - 89
dev/translation/sanity_check_en_langfiles.php

@@ -1,82 +1,102 @@
+#!/usr/bin/env php
 <?php
-/* Copyright (c) 2015 Tommaso Basilici <t.basilici@19.coop>
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-echo "<html>";
-echo "<head>";
-
-echo "<STYLE type=\"text/css\">
-
-table {
-	background: #f5f5f5;
-	border-collapse: separate;
-	box-shadow: inset 0 1px 0 #fff;
-	font-size: 12px;
-	line-height: 24px;
-	margin: 30px auto;
-	text-align: left;
-	width: 800px;
-}
-
-th {
-	background-color: #777;
-	border-left: 1px solid #555;
-	border-right: 1px solid #777;
-	border-top: 1px solid #555;
-	border-bottom: 1px solid #333;
-	color: #fff;
-  	font-weight: bold;
-	padding: 10px 15px;
-	position: relative;
-	text-shadow: 0 1px 0 #000;
-}
-
-td {
-	border-right: 1px solid #fff;
-	border-left: 1px solid #e8e8e8;
-	border-top: 1px solid #fff;
-	border-bottom: 1px solid #e8e8e8;
-	padding: 10px 15px;
-	position: relative;
-}
+/* Copyright (c) 2015 Tommaso Basilici    <t.basilici@19.coop>
+ * Copyright (c) 2015 Laurent Destailleur <eldy@destailleur.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
 
+$sapi_type = php_sapi_name();
+$script_file = basename(__FILE__);
+$path=dirname(__FILE__).'/';
 
-tr {
-	background-color: #f1f1f1;
+$web=0;
 
+// Test if batch mode
+if (substr($sapi_type, 0, 3) == 'cgi') 
+{
+    $web=1;
 }
 
-tr:nth-child(odd) td {
-	background-color: #f1f1f1;
-}
 
-</STYLE>";
+if ($web)
+{
+    echo "<html>";
+    echo "<head>";
+    
+    echo "<STYLE type=\"text/css\">
+    
+    table {
+    	background: #f5f5f5;
+    	border-collapse: separate;
+    	box-shadow: inset 0 1px 0 #fff;
+    	font-size: 12px;
+    	line-height: 24px;
+    	margin: 30px auto;
+    	text-align: left;
+    	width: 800px;
+    }
+    
+    th {
+    	background-color: #777;
+    	border-left: 1px solid #555;
+    	border-right: 1px solid #777;
+    	border-top: 1px solid #555;
+    	border-bottom: 1px solid #333;
+    	color: #fff;
+      	font-weight: bold;
+    	padding: 10px 15px;
+    	position: relative;
+    	text-shadow: 0 1px 0 #000;
+    }
+    
+    td {
+    	border-right: 1px solid #fff;
+    	border-left: 1px solid #e8e8e8;
+    	border-top: 1px solid #fff;
+    	border-bottom: 1px solid #e8e8e8;
+    	padding: 10px 15px;
+    	position: relative;
+    }
+    
+    
+    tr {
+    	background-color: #f1f1f1;
+    
+    }
+    
+    tr:nth-child(odd) td {
+    	background-color: #f1f1f1;
+    }
+    
+    </STYLE>";
+    
+    echo "<body>";
+}
 
-echo "<body>";
+echo "If you call this file with the argument \"?unused=true\" it searches for the translation strings that exist in en_US but are never used.\n";
+if ($web) print "<br>";
+echo "IMPORTANT: that can take quite a lot of time (up to 10 minutes), you need to tune the max_execution_time on your php.ini accordingly.\n";
+if ($web) print "<br>";
 
-echo "If you call this file with the argument \"?unused=true\" it searches for the translation strings that exist in en_US but are never used.<br>";
-echo "IMPORTANT: that can take quite a lot of time (up to 10 minutes), you need to tune the max_execution_time on your php.ini accordingly.<br>";
-echo "Happy translating :)<br>";
 
 
 // STEP 1 - Search duplicates keys
 
 
 // directory containing the php and lang files
-$htdocs 	= "../../htdocs/";
+$htdocs 	= $path."/../../htdocs/";
 
 // directory containing the english lang files
 $workdir 	= $htdocs."langs/en_US/";
@@ -114,8 +134,10 @@ foreach ($files AS $file) {
 	}
 }
 
-foreach ($langstrings_3d AS $filename => $file) {
-	foreach ($file AS $linenum => $value) {
+foreach ($langstrings_3d AS $filename => $file) 
+{
+	foreach ($file AS $linenum => $value) 
+	{
 		$keys = array_keys($langstrings_full, $value);
 		if (count($keys)>1)
 		{
@@ -126,30 +148,95 @@ foreach ($langstrings_3d AS $filename => $file) {
 	}
 }
 
-echo "<h2>Duplicate strings in lang files in $workdir - ".count($dups)." found</h2>";
+if ($web) print "<h2>";
+print "Duplicate strings in lang files in $workdir - ".count($dups)." found\n";
+if ($web) print "</h2>";
+
+if ($web)
+{
+    echo '<table border_bottom="1">'."\n";
+    echo "<thead><tr><th align=\"center\">#</th><th>String</th><th>File and lines</th></thead>\n";
+    echo "<tbody>\n";
+}
+
+$sduplicateinsamefile='';
+$sinmainandother='';
+$sininstallandadmin='';
+$sother='';
 
-echo "<table border_bottom=1> ";
-echo "<thead><tr><th align=\"center\">#</th><th>String</th><th>File and lines</th></thead>";
-echo "<tbody>";
 $count = 0;
-foreach ($dups as $string => $pages) {
+foreach ($dups as $string => $pages) 
+{
 	$count++;
-	echo "<tr>";
-	echo "<td align=\"center\">$count</td>";
-	echo "<td>$string</td>";
-	echo "<td>";
-	foreach ($pages AS $page => $lines ) {
-		echo "$page ";
-		foreach ($lines as $line => $translatedvalue) {
-			//echo "($line - ".(substr($translatedvalue,0,20)).") ";
-			echo "($line - ".htmlentities($translatedvalue).") ";
+	$s='';
+	
+	// Keyword $string
+	if ($web) $s.="<tr>";
+	if ($web) $s.="<td align=\"center\">";
+	if ($web) $s.=$count;
+	if ($web) $s.="</td>";
+	if ($web) $s.="<td>";
+	$s.=$string;
+	if ($web) $s.="</td>";
+	if ($web) $s.="<td>";
+	if (! $web) $s.= ' : ';
+	
+	// Loop on each files keyword was found
+    $duplicateinsamefile=0;
+	$inmain=0;
+    $inadmin=0;
+	foreach ($pages AS $file => $lines) 
+	{
+        if ($file == 'main.lang') { $inmain=1; $inadmin=0; }
+        if ($file == 'admin.lang' && ! $inmain) { $inadmin=1; }
+        
+	    $s.=$file." ";
+	    
+	    // Loop on each line keword was found into file.
+	    $listoffilesforthisentry=array();
+	    foreach ($lines as $line => $translatedvalue) 
+		{
+            if (! empty($listoffilesforthisentry[$file])) $duplicateinsamefile=1;
+            $listoffilesforthisentry[$file]=1;
+        
+			$s.= "(".$line." - ".htmlentities($translatedvalue).") ";
 		}
-		echo "<br>";
+		if ($web) $s.="<br>";
 	}
-	echo "</td></tr>\n";
+	if ($web) $s.="</td></tr>";
+	$s.="\n";
+	
+	if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
+	else if ($inmain) $sinmainandother .= $s;
+	else if ($inadmin) $sininstallandadmin .= $s;
+	else $sother .= $s;
+}
+
+if (! $web) print "\n***** Entries duplicated in same file\n";
+print $sduplicateinsamefile;
+if (! $web && empty($sduplicateinsamefile)) print "None\n";
+if (! $web) print "\n";
+
+if (! $web) print "***** Entries in main and another (keep only entry in main)\n";
+print $sinmainandother;
+if (! $web && empty($sinmainandother)) print "None\n";
+if (! $web) print "\n";
+
+if (! $web) print "***** Entries in admin and another\n";
+print $sininstallandadmin;
+if (! $web && empty($sininstallandadmin)) print "None\n";
+if (! $web) print "\n";
+
+if (! $web) print "***** Other\n";
+print $sother;
+if (! $web && empty($sother)) print "None\n";
+if (! $web) print "\n";
+
+if ($web)
+{
+    echo "</tbody>\n";
+    echo "</table>\n";
 }
-echo "</tbody>";
-echo "</table>";
 
 
 // STEP 2 - Search key not used
@@ -168,12 +255,20 @@ if (! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true')
 		}
 	}
 
-	echo "<h2>Strings in en_US that are never used</h2>";
-	echo "<pre>";
+	if ($web) print "<h2>\n";
+	print "Strings in en_US that are never used\n";
+	if ($web) print "</h2>\n";
+	if ($web) echo "<pre>";
 	print_r($unused);
-	echo "</pre>";
+	if ($web) echo "</pre>\n";
 }
 
 echo "\n";
-echo "</body>";
-echo "</html>";
+if ($web)
+{
+    echo "</body>\n";
+    echo "</html>\n";
+}
+
+exit;
+

+ 1 - 1
dev/translation/strip_language_file.php

@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /* Copyright (C) 2014 by FromDual GmbH, licensed under GPL v2
  * Copyright (C) 2014 Laurent Destailleur  <eldy@users.sourceforge.net>

+ 0 - 0
doc/images/appicon_128.png


+ 0 - 0
doc/images/appicon_16.ico


+ 0 - 0
doc/images/appicon_16.png


+ 0 - 0
doc/images/appicon_32.png


+ 0 - 0
doc/images/appicon_48.ico


+ 0 - 0
doc/images/appicon_64.png


+ 0 - 0
doc/images/dolibarr_73x73.png


+ 0 - 0
doc/images/dolibarr_logo.png


+ 2 - 1
htdocs/.gitignore

@@ -19,4 +19,5 @@
 /dolimed*
 /allscreens*
 /ecommerce/
-/cabinetmed*
+/cabinetmed*
+/conf/conf.php

+ 3 - 2
htdocs/accountancy/admin/card.php

@@ -303,6 +303,7 @@ else if ($id)
 		dol_print_error($db);
 	}
 }
-$db->close();
 
-llxFooter();
+llxFooter();
+
+$db->close();

+ 1 - 2
htdocs/accountancy/admin/fiscalyear_info.php

@@ -55,6 +55,5 @@ if ($id)
     print '</div>';
 }
 
-$db->close();
-
 llxFooter();
+$db->close();

+ 42 - 3
htdocs/accountancy/bookkeeping/list.php

@@ -30,6 +30,7 @@ require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
 
 // Langs
 $langs->load("accountancy");
@@ -43,15 +44,17 @@ $search_doc_ref = GETPOST("search_doc_ref");
 $search_account = GETPOST("search_account");
 $search_thirdparty = GETPOST("search_thirdparty");
 $search_journal = GETPOST("search_journal");
+$limit = $conf->liste_limit;
 
 if ($sortorder == "")
 	$sortorder = "ASC";
 if ($sortfield == "")
 	$sortfield = "bk.rowid";
 
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
 
 $formventilation = new FormVentilation($db);
+$formother = new FormOther($db);
 
 if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
 {
@@ -77,7 +80,33 @@ if ($action == 'delbookkeeping') {
 			setEventMessages($object->error, $object->errors, 'errors');
 		}
 	}
-} // Export
+}
+elseif ($action == 'delbookkeepingyear') {
+	
+	$delyear = GETPOST('delyear', 'int');
+	
+	if (! empty($delyear)) {
+		$object = new BookKeeping($db);
+		$result = $object->delete_by_year($delyear);
+		Header("Location: list.php");
+		if ($result < 0) {
+			setEventMessages($object->error, $object->errors, 'errors');
+		}
+	}
+}
+elseif ($action == 'delbookkeepingyear') {
+	
+	$delyear = GETPOST('delyear', 'int');
+	
+	if (! empty($delyear)) {
+		$object = new BookKeeping($db);
+		$result = $object->delete_by_year($delyear);
+		Header("Location: list.php");
+		if ($result < 0) {
+			setEventMessages($object->error, $object->errors, 'errors');
+		}
+	}
+}// Export
 else if ($action == 'export_csv') {
 	
 	header('Content-Type: text/csv');
@@ -147,7 +176,7 @@ else {
 		
 		print_barre_liste($langs->trans("Bookkeeping"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num);
 		
-		print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
+		/*print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
 		print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 		print '<input type="hidden" name="action" value="delbookkeeping">';
 		
@@ -155,6 +184,16 @@ else {
 		
 		print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
 		
+		print '</form>';*/
+		
+		print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
+		print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
+		print '<input type="hidden" name="action" value="delbookkeepingyear">';
+		
+		print $formother->select_year(GETPOST('delyear'),'delyear');
+		
+		print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
+		
 		print '</form>';
 		
 		print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';

+ 2 - 1
htdocs/accountancy/bookkeeping/listbyyear.php

@@ -36,6 +36,7 @@ $langs->load("accountancy");
 $page = GETPOST("page");
 $sortorder = GETPOST("sortorder");
 $sortfield = GETPOST("sortfield");
+$limit = $conf->liste_limit;
 
 // Filter
 $year = GETPOST("year", 'int');
@@ -52,7 +53,7 @@ if ($sortorder == "")
 if ($sortfield == "")
 	$sortfield = "bk.rowid";
 
-$offset = $conf->liste_limit * $page;
+$offset = $limit * $page;
 
 llxHeader('', $langs->trans("Bookkeeping"));
 

+ 30 - 0
htdocs/accountancy/class/bookkeeping.class.php

@@ -372,6 +372,36 @@ class BookKeeping extends CommonObject
 		$this->db->commit();
 		return 1;
 	}
+	
+	/**
+	 * Delete bookkepping by importkey
+	 *
+	 * @param	string 	$delyear		year to delete
+	 * @return	int						Result
+	 */
+	function delete_by_year($delyear) {
+		$this->db->begin();
+	
+		// first check if line not yet in bookkeeping
+		$sql = "DELETE";
+		$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping ";
+		$sql .= " WHERE YEAR(doc_date) = ".$delyear;
+	
+		$resql = $this->db->query($sql);
+	
+		if (! $resql) {
+			$this->errors[] = "Error " . $this->db->lasterror();
+			foreach ( $this->errors as $errmsg ) {
+				dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
+				$this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
+			}
+			$this->db->rollback();
+			return - 1;
+		}
+	
+		$this->db->commit();
+		return 1;
+	}
 
 	/**
 	 *	Create object into database

+ 1 - 1
htdocs/accountancy/class/html.formventilation.class.php

@@ -70,7 +70,7 @@ class FormVentilation extends Form
 					$selected = ' selected ';
 				}
 
-				$out .= '<OPTION value="' . $obj->import_key . '"' . $selected . '>' . $obj->import_key . '</OPTION>';
+				$out .= '<OPTION value="' . $obj->import_key . '"' . $selected . '>' . dol_print_date($obj->import_key,'dayhourtext') . '</OPTION>';
 
 				$i ++;
 			}

+ 11 - 5
htdocs/accountancy/customer/list.php

@@ -87,10 +87,10 @@ if (! $user->rights->accounting->ventilation->dispatch)
 	accessforbidden();
 
 $formventilation = new FormVentilation($db);
-
 $accounting = new AccountingAccount($db);
-$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
-$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
+$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT,1);
+$aarowid_p = $accounting->fetch('',$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT,1);
+
 
 // Purge search criteria
 if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
@@ -278,6 +278,8 @@ if ($result) {
 		
 		$code_sell_p_notset = '';
 		$objp->aarowid_suggest = $objp->aarowid;
+		
+		
 		if (! empty($objp->code_sell)) {
 			$objp->code_sell_p = $objp->code_sell;
 		} else {
@@ -290,12 +292,14 @@ if ($result) {
 		}
 		if ($objp->type_l == 1) {
 			$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
-			if ($objp->aarowid == '')
+			if ($objp->aarowid == '') {
 				$objp->aarowid_suggest = $aarowid_s;
+			}
 		} elseif ($objp->type_l == 0) {
 			$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
-			if ($objp->aarowid == '')
+			if ($objp->aarowid == '') {
 				$objp->aarowid_suggest = $aarowid_p;
+			}
 		}
 		if ($objp->code_sell_l != $objp->code_sell_p)
 			$code_sell_p_l_differ = 'color:red';
@@ -311,10 +315,12 @@ if ($result) {
 		$product_static->id = $objp->product_id;
 		$product_static->type = $objp->type;
 		print '<td>';
+		
 		if ($product_static->id)
 			print $product_static->getNomUrl(1);
 		else
 			print '&nbsp;';
+		
 		print '</td>';
 		
 		print '<td style="' . $code_sell_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>';

+ 41 - 76
htdocs/accountancy/journal/bankjournal.php

@@ -16,7 +16,7 @@
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License fr more details.
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -57,7 +57,7 @@ $langs->load("bank");
 $langs->load('bills');
 $langs->load("accountancy");
 
-$id_accountancy_journal = GETPOST('id_account','int');
+$id_bank_account = GETPOST('id_account','int');
 
 $date_startmonth = GETPOST('date_startmonth');
 $date_startday = GETPOST('date_startday');
@@ -70,17 +70,12 @@ $action = GETPOST('action');
 $now = dol_now();
 
 // Security check
-if ($user->societe_id > 0)
+if ($user->societe_id > 0 && empty($id_bank_account))
 	accessforbidden();
 
 /*
  * View
  */
-if (empty($id_accountancy_journal))
-{
-	accessforbidden();
-}
-
 $year_current = strftime("%Y", dol_now());
 $pastmonth = strftime("%m", dol_now()) - 1;
 $pastmonthyear = $year_current;
@@ -107,7 +102,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
 $sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
 $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
-$sql .= " WHERE ba.rowid=".$id_accountancy_journal;
+$sql .= " WHERE ba.rowid=".$id_bank_account;
 if (! empty($conf->multicompany->enabled)) {
 	$sql .= " AND ba.entity = " . $conf->entity;
 }
@@ -125,7 +120,12 @@ $paymentdonstatic = new PaymentDonation($db);
 $paymentvatstatic = new TVA($db);
 $paymentsalstatic = new PaymentSalary($db);
 
-dol_syslog("accountancy/journal/bankjournal.php:: sql=" . $sql, LOG_DEBUG);
+// Get code of finance journal
+$bank_code_journal = new Account($db);
+$result=$bank_code_journal->fetch($id_bank_account);
+$journal=$bank_code_journal->accountancy_journal;
+
+dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
 $result = $db->query($sql);
 if ($result) {
 
@@ -288,8 +288,10 @@ if ($result) {
  */
 
 // Write bookkeeping
-if ($action == 'writeBookKeeping')
+if ($action == 'writebookkeeping')
 {
+	$now=dol_now();
+	
 	$error = 0;
 	foreach ( $tabpay as $key => $val )
 	{
@@ -309,8 +311,9 @@ if ($action == 'writeBookKeeping')
 			$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
 			$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
 			$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
-			$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
+			$bookkeeping->code_journal = $journal;
 			$bookkeeping->fk_user_author = $user->id;
+			$bookkeeping->date_create=$now;
 
 			if ($tabtype[$key] == 'payment') {
 
@@ -327,7 +330,7 @@ if ($action == 'writeBookKeeping')
 				}
 			} else if ($tabtype[$key] == 'payment_supplier') {
 
-				$sqlmid = 'SELECT facf.facnumber';
+				$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
 				$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
 				$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON  payfacf.fk_facturefourn=facf.rowid";
 				$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON  payfacf.fk_paiementfourn=payf.rowid";
@@ -336,7 +339,7 @@ if ($action == 'writeBookKeeping')
 				$resultmid = $db->query($sqlmid);
 				if ($resultmid) {
 					$objmid = $db->fetch_object($resultmid);
-					$bookkeeping->doc_ref = $objmid->facnumber;
+					$bookkeeping->doc_ref = $objmid->ref_supplier.' ('.$objmid->ref.')';;
 				}
 			}
 
@@ -360,8 +363,9 @@ if ($action == 'writeBookKeeping')
 			$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
 			$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
 			$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
-			$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
+			$bookkeeping->code_journal = $journal;
 			$bookkeeping->fk_user_author = $user->id;
+			$bookkeeping->date_create=$now;
 
 			if ($tabtype[$key] == 'sc') {
 				$bookkeeping->code_tiers = '';
@@ -383,7 +387,7 @@ if ($action == 'writeBookKeeping')
 				$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
 			} else if ($tabtype[$key] == 'payment_supplier') {
 
-				$sqlmid = 'SELECT facf.facnumber';
+				$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
 				$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
 				$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON  payfacf.fk_facturefourn=facf.rowid";
 				$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON  payfacf.fk_paiementfourn=payf.rowid";
@@ -392,7 +396,7 @@ if ($action == 'writeBookKeeping')
 				$resultmid = $db->query($sqlmid);
 				if ($resultmid) {
 					$objmid = $db->fetch_object($resultmid);
-					$bookkeeping->doc_ref = $objmid->facnumber;
+					$bookkeeping->doc_ref = $objmid->ref_supplier.' ('.$objmid->ref.')';
 				}
 				$bookkeeping->code_tiers = $k;
 				$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
@@ -433,7 +437,6 @@ if ($action == 'writeBookKeeping')
 if ($action == 'export_csv')
 {
 	$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
-	$journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
 
 	include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
 
@@ -443,16 +446,20 @@ if ($action == 'export_csv')
 	{
 		$sep = ";";
 
-		foreach ( $tabpay as $key => $val ) {
+		foreach ($tabpay as $key => $val) 
+		{
 			$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
 
 			$companystatic->id = $tabcompany[$key]['id'];
 			$companystatic->name = $tabcompany[$key]['name'];
+			$companystatic->client = $tabcompany[$key]['code_client'];
+			
+			$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
 
 			// Bank
 			foreach ( $tabbq[$key] as $k => $mt ) {
 				print $date . $sep;
-				print $bank_journal . $sep;
+				print $journal . $sep;
 				print length_accountg(html_entity_decode($k)) . $sep;
 				print $sep;
 				print ($mt < 0 ? 'C' : 'D') . $sep;
@@ -557,67 +564,26 @@ if ($action == 'export_csv')
 			}
 		}
 	}
-}
-else
+} 
+else 
 {
-
 	$form = new Form($db);
 
-	llxHeader('', $langs->trans("BankJournal"));
+	llxHeader('', $langs->trans("FinanceJournal"));
 
-	$namereport = $langs->trans("BankJournal");
-	$description = $langs->trans("DescBankJournal");
+	$nom = $langs->trans("FinanceJournal" . ' - ' . $journal);
+	$builddate = time();
+	$description = $langs->trans("DescFinanceJournal") . '<br>';
 	$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
 
-	// Report
-	$h=0;
-	$head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal;
-	$head[$h][1] = $langs->trans("Report");
-	$head[$h][2] = 'card';
-
-	dol_fiche_head($head, 'card', $langs->trans("BankJournal"), 0, 'payment');
-
-	print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal.'">';
-	print '<table width="100%" class="border">';
-
-	// Title
-	print '<tr>';
-	print '<td width="110">'.$langs->trans("ReportName").'</td>';
-	print '<td colspan="3">'.$namereport.'</td>';
-	print '</td>';
-	print '</tr>';
-
-	// Period report
-	print '<tr>';
-	print '<td>'.$langs->trans("ReportPeriod").'</td>';
-	if (! $periodlink) print '<td colspan="3">';
-	else print '<td>';
-	if ($period) print $period;
-	if ($periodlink) print '</td><td colspan="2">'.$periodlink;
-	print '</td>';
-	print '</tr>';
-
-	// Description
-	print '<tr>';
-	print '<td>'.$langs->trans("ReportDescription").'</td>';
-	print '<td colspan="3">'.$description.'</td>';
-	print '</tr>';
-
-	print '<tr>';
-	print '<td colspan="4" align="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></td>';
-	print '</tr>';
-
-	print '</table>';
-
-	print '</form>';
-
-	print '</div>';
-	// End report
+	$varlink = 'id_account='.$id_bank_account;
+	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
 
+	
 	print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
 
-	print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
-
+	print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
+	
 	print '
 	<script type="text/javascript">
 		function launch_export() {
@@ -625,8 +591,8 @@ else
 			$("div.fiche div.tabBar form input[type=\"submit\"]").click();
 		    $("div.fiche div.tabBar form input[name=\"action\"]").val("");
 		}
-		function writeBookKeeping() {
-		    $("div.fiche div.tabBar form input[name=\"action\"]").val("writeBookKeeping");
+		function writebookkeeping() {
+		    $("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
 			$("div.fiche div.tabBar form input[type=\"submit\"]").click();
 		    $("div.fiche div.tabBar form input[name=\"action\"]").val("");
 		}
@@ -709,7 +675,6 @@ else
 
 	print "</table>";
 
-	// End of page
-	llxFooter();
 }
+llxFooter();
 $db->close();

+ 2 - 2
htdocs/accountancy/journal/index.php

@@ -42,5 +42,5 @@ llxHeader('', 'Journaux', '');
 $form = new Form($db);
 
 // End of page
-$db->close();
-llxFooter();
+llxFooter();
+$db->close();

+ 3 - 4
htdocs/accountancy/journal/purchasesjournal.php

@@ -86,7 +86,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
 $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
 $idpays = $p[0];
 
-$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,";
+$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier,";
 $sql .= " fd.rowid as fdid, fd.description, fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,";
 $sql .= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur, s.fournisseur,";
 $sql .= " s.code_compta_fournisseur, p.accountancy_code_buy , ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
@@ -137,7 +137,7 @@ if ($result) {
 		$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
 
 		$tabfac[$obj->rowid]["date"] = $obj->df;
-		$tabfac[$obj->rowid]["ref"] = $obj->ref;
+		$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier.' ('.$obj->ref.')';
 		$tabfac[$obj->rowid]["type"] = $obj->type;
 		$tabfac[$obj->rowid]["description"] = $obj->description;
 		$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
@@ -488,7 +488,6 @@ if ($action == 'export_csv')
 
 	print "</table>";
 
-	// End of page
-	llxFooter();
 }
+llxFooter();
 $db->close();

+ 1 - 3
htdocs/accountancy/journal/sellsjournal.php

@@ -531,8 +531,6 @@ if ($action == 'export_csv')
 
 	print "</table>";
 
-	// End of page
-	llxFooter();
 }
-
+llxFooter();
 $db->close();

+ 2 - 2
htdocs/accountancy/supplier/list.php

@@ -94,8 +94,8 @@ $formventilation = new FormVentilation($db);
 $accounting = new AccountingAccount($db);
 
 // TODO: we should need to check if result is a really exist accountaccount rowid.....
-$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
-$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT,1);
+$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT,1);
 
 // Purge search criteria
 if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers

+ 2 - 1
htdocs/adherents/canvas/actions_adherentcard_common.class.php

@@ -98,7 +98,8 @@ abstract class ActionsAdherentCardCommon
     }
 
     /**
-     *  Load data control
+     *  doActions of a canvas is not the doActions of the hook
+     *  @deprecated Use the doActions of hooks instead of this.
      *
 	 *  @param	string	$action    Type of action
 	 *  @param	int		$id			Id of object

+ 1 - 8
htdocs/adherents/card.php

@@ -936,7 +936,7 @@ else
 
 		// Login Dolibarr
 		print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td class="valeur">';
-		print $form->select_dolusers($object->user_id,'userid',1);
+		print $form->select_dolusers($object->user_id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
 		print '</td></tr>';
 		*/
         print '<tbody>';
@@ -1400,7 +1400,6 @@ else
 		$rowspan=17;
 		if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
 		if (! empty($conf->societe->enabled)) $rowspan++;
-		if (! empty($conf->skype->enabled)) $rowspan++;
 
 		$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
 		
@@ -1445,12 +1444,6 @@ else
 			print '</td></tr>';
 		}
 
-    	// Skype
-		if (! empty($conf->skype->enabled))
-		{
-			print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
-		}
-
         print '</table>';
         
         print '</div>';

+ 0 - 6
htdocs/adherents/card_subscriptions.php

@@ -610,12 +610,6 @@ if ($rowid > 0)
 		print '</td></tr>';
 	}
 
-	// Skype
-	if (! empty($conf->skype->enabled))
-	{
-		print '<tr><td>'.$langs->trans("Skype").'</td><td class="valeur">'.dol_print_skype($object->skype,0,$object->fk_soc,1).'</td></tr>';
-	}
-
     print '</table>';
     
     print '</div>';

+ 1 - 2
htdocs/adherents/info_subscription.php

@@ -77,6 +77,5 @@ print '</td></tr></table>';
 print '</div>';
 
 
-$db->close();
-
 llxFooter();
+$db->close();

+ 1 - 1
htdocs/adherents/stats/index.php

@@ -155,7 +155,7 @@ $filter='s.client in (1,2,3)';
 print $form->select_company($id,'memberid',$filter,1);
 print '</td></tr>';
 print '<tr><td>'.$langs->trans("User").'</td><td>';
-print $form->select_dolusers($userid,'userid',1);
+print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
 print '</td></tr>';
 print '<tr><td align="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
 print '</table>';

+ 2 - 3
htdocs/adherents/type.php

@@ -242,15 +242,14 @@ if ($action == 'create')
 
 	print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
+	print '<input type="hidden" name="action" value="add">';
 
     dol_fiche_head('');
 
 	print '<table class="border" width="100%">';
 	print '<tbody>';
 
-	print '<input type="hidden" name="action" value="add">';
-
-	print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
+	print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
 
 	print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
 	print $form->selectyesno("cotisation",1,1);

+ 1 - 1
htdocs/admin/compta.php

@@ -166,6 +166,6 @@ print "</table>\n";
 
 print '<br /><br /><div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
 print '</form>';
-$db->close();
 
 llxFooter();
+$db->close();

+ 1 - 2
htdocs/admin/confexped.php

@@ -140,6 +140,5 @@ print '</div>';
 
 print info_admin($langs->trans("NoNeedForDeliveryReceipts"));
 
-$db->close();
-
 llxFooter();
+$db->close();

+ 2 - 1
htdocs/admin/const.php

@@ -146,7 +146,8 @@ if ($action == 'delete')
 
 $form = new Form($db);
 
-llxHeader('',$langs->trans("OtherSetup"));
+$wikihelp='EN:Setup_Other|FR:Paramétrage_Divers|ES:Configuración_Varios';
+llxHeader('',$langs->trans("Setup"),$wikihelp);
 
 // Add logic to show/hide buttons
 if ($conf->use_javascript_ajax)

+ 2 - 3
htdocs/admin/external_rss.php

@@ -5,7 +5,7 @@
  * Copyright (C) 2004      Sebastien Di Cintio  <sdicintio@ressource-toi.org>
  * Copyright (C) 2004      Benoit Mortier       <benoit.mortier@opensides.be>
  * Copyright (C) 2005-2011 Regis Houssin        <regis.houssin@capnetworks.com>
- * Copyright (C) 2011 	    Juanjo Menent		<jmenent@2byte.es>
+ * Copyright (C) 2011 	   Juanjo Menent		<jmenent@2byte.es>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -320,6 +320,5 @@ else
 }
 
 
-$db->close();
-
 llxFooter();
+$db->close();

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