Browse Source

Merge branch 'develop' into prod-attr

# Conflicts:
#	htdocs/core/class/html.form.class.php
#	htdocs/core/tpl/objectline_create.tpl.php
#	htdocs/fourn/facture/card.php
#	htdocs/install/mysql/migration/3.9.0-4.0.0.sql
Marcos García de La Fuente 8 years ago
parent
commit
286095f5cd
100 changed files with 569 additions and 550 deletions
  1. 1 1
      .travis.yml
  2. 0 1
      COPYRIGHT
  3. 76 3
      ChangeLog
  4. 1 1
      Dockerfile
  5. 1 1
      README.md
  6. 0 78
      build/README-FR
  7. 16 7
      build/debian/README.howto
  8. 1 1
      build/debian/control
  9. 1 4
      build/debian/copyright
  10. 0 1
      build/debian/dolibarr.postinst
  11. 0 2
      build/debian/install.forced.php.install
  12. 0 1
      build/debian/rules
  13. 24 2
      build/generate_filelist_xml.php
  14. 7 4
      build/launchpad/README
  15. 0 74
      build/live/Howto.txt
  16. 0 7
      build/live/README
  17. 34 18
      build/makepack-dolibarr.pl
  18. 1 1
      build/obs/README
  19. 1 1
      build/rpm/dolibarr_fedora.spec
  20. 1 1
      build/rpm/dolibarr_generic.spec
  21. 1 1
      build/rpm/dolibarr_mandriva.spec
  22. 1 1
      build/rpm/dolibarr_opensuse.spec
  23. 1 1
      composer.json
  24. 2 2
      dev/README
  25. 0 0
      dev/examples/code/README
  26. 0 0
      dev/examples/code/create_invoice.php
  27. 0 0
      dev/examples/code/create_order.php
  28. 0 0
      dev/examples/code/create_product.php
  29. 0 0
      dev/examples/code/create_user.php
  30. 0 0
      dev/examples/code/get_contracts.php
  31. 0 0
      dev/examples/ical/event_recu.txt
  32. 0 0
      dev/examples/ldap/README
  33. 0 0
      dev/examples/ldap/ldapadd_sample1.txt
  34. 0 0
      dev/examples/ldap/ldapadd_sample2.txt
  35. 0 0
      dev/examples/ldap/ldapadd_sample3.txt
  36. 0 0
      dev/examples/ldap/ldapdelete_sample1.txt
  37. 0 0
      dev/examples/ldap/ldapdelete_sample3.txt
  38. 0 0
      dev/examples/ldap/ldapmodify_sample1.txt
  39. 0 0
      dev/examples/ldap/ldapsearch_sample1.txt
  40. 0 0
      dev/examples/ldap/setup_example_activedirectory.jpg
  41. 0 0
      dev/examples/mail/README
  42. 0 0
      dev/examples/mail/dolibarr_mail_attachement.txt
  43. 0 0
      dev/examples/mail/dolibarr_mail_attachementHTML.txt
  44. 0 0
      dev/examples/mail/dolibarr_mail_attachementwithimageHTML.txt
  45. 0 0
      dev/examples/mail/dolibarr_mail_simple.txt
  46. 0 0
      dev/examples/mail/dolibarr_mail_simpleHTML.txt
  47. 0 0
      dev/examples/mail/dolibarr_mail_universal.txt
  48. 0 0
      dev/examples/mail/dolibarr_mail_withimageHTML.txt
  49. 0 0
      dev/examples/mail/source_email_from_thirdparty.txt
  50. 0 0
      dev/initdemo/removeconfdemo.sh
  51. 0 0
      dev/resources/cliparts/commons.svg
  52. 0 0
      dev/resources/dbmodel/dolibarr.uml
  53. 0 0
      dev/resources/dbmodel/dolibarr.umldi
  54. 0 0
      dev/resources/dbmodel/dolibarr_schema.mwb
  55. 0 0
      dev/resources/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF
  56. 0 0
      dev/resources/iso-normes/address_format.txt
  57. 0 0
      dev/resources/iso-normes/banknumber_format.txt
  58. 0 0
      dev/resources/iso-normes/barcode_EAN13.txt
  59. 0 0
      dev/resources/iso-normes/countries_iso-3166_en.txt
  60. 0 0
      dev/resources/iso-normes/countries_iso-3166_fr.txt
  61. 0 0
      dev/resources/iso-normes/currencies_iso-4217.txt
  62. 0 0
      dev/resources/iso-normes/fichier_norme_AFB-CFONB.pdf
  63. 0 0
      dev/resources/iso-normes/format_FEC-Lien_outil_de_test_agréé.pdf
  64. 0 0
      dev/resources/iso-normes/format_FEC.pdf
  65. 0 0
      dev/resources/iso-normes/iban_iso-13616.txt
  66. 0 0
      dev/resources/iso-normes/languages_iso-639.txt
  67. 0 0
      dev/resources/iso-normes/locales.txt
  68. 0 0
      dev/resources/iso-normes/vat_number_names.txt
  69. 0 0
      dev/resources/iso-normes/world_tax_rates.txt
  70. 0 0
      dev/resources/iso-normes/xmlexport.txt
  71. 0 0
      dev/resources/licence/Links on GPL.txt
  72. 0 0
      dev/resources/licence/quick-guide-gplv3-compatibility.png
  73. 0 0
      dev/setup/codesniffer/README
  74. 0 0
      dev/setup/codesniffer/php.ini
  75. 0 0
      dev/setup/codesniffer/ruleset.dtd
  76. 1 0
      dev/setup/codesniffer/ruleset.xml
  77. 0 0
      dev/setup/codetemplates/README
  78. 0 0
      dev/setup/codetemplates/codetemplates.dtd
  79. 0 0
      dev/setup/codetemplates/codetemplates.xml
  80. 0 0
      dev/setup/multitail/.multitailrc
  81. 0 0
      dev/setup/phpunit/README
  82. 0 0
      dev/setup/phpunit/eclipse_setup_for_pti_phpunit.png
  83. 0 0
      dev/setup/security/README
  84. 0 0
      dev/setup/security/htaccess.txt
  85. 0 0
      dev/setup/xdebug/README
  86. 0 0
      dev/setup/xdebug/eclipse_setup_for_xdebug.jpg
  87. 13 5
      dev/skeletons/README
  88. 4 4
      dev/skeletons/modMyModule.class.php
  89. 9 8
      dev/skeletons/skeleton_api_class.class.php
  90. 18 11
      dev/skeletons/skeleton_card.php
  91. 57 18
      dev/skeletons/skeleton_class.class.php
  92. 294 290
      dev/skeletons/skeleton_list.php
  93. 0 0
      dev/tools/detectnotabfiles.sh
  94. 0 0
      dev/tools/fixaltlanguages.sh
  95. 0 0
      dev/tools/fixdosfiles.sh
  96. 1 0
      dev/tools/fixduplicatelangkey.sh
  97. 2 0
      dev/tools/fixduplicatelanglines.sh
  98. 0 0
      dev/tools/fixperms.sh
  99. 0 0
      dev/tools/fixutf8bomfiles.sh
  100. 0 0
      dev/tools/optimize_images.sh

+ 1 - 1
.travis.yml

@@ -257,7 +257,7 @@ script:
   # 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 .
+  phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 .
   set +e
   echo
 

+ 0 - 1
COPYRIGHT

@@ -38,7 +38,6 @@ jQuery UI              1.11.4        GPL and MIT License         Yes
 jQuery select2         3.5.2         GPL and Apache License      Yes             JS library plugin for sexier multiselect
 jQuery blockUI         2.70.0        GPL and MIT License         Yes             JS library plugin blockUI (to use ajax popups)
 jQuery Colorpicker     1.1           MIT License                 Yes             JS library for color picker for a defined list of colors
-jQuery DataTables      1.9.4         BSD                         Yes             JS library for tables output
 jQuery FileUpload      5.0.3         GPL and MIT License         Yes             JS library to upload files
 jQuery Flot            0.8.3         MIT License                 Yes             JS library to build graph
 jQuery JCrop           0.9.8         GPL and MIT License         Yes             JS library plugin Crop (to crop images)

+ 76 - 3
ChangeLog

@@ -22,12 +22,85 @@ WARNING:
 Following changes may create regression for some external modules, but were necessary to make
 Dolibarr better:
 - Function delete of class Facture (invoice) need the object $user as first parameter. Also you must
-check you make a fetch on object before calling the delete.
+  check you make a fetch on object before calling the delete.
 - The old driver of "mysql" has been removed. Dolibarr use the new one (mysqli) by default.
 - Remove not used function calculate_byte(). Use dol_print_size() instead.
 - Function pdf_getTotalQty is now deprecated. Not used by Dolibarr core.
-
-
+- Method expensereport->delete(id, user) has been replaced with ->delete(user)
+  Method warehouse->delete(id) has been replace with ->delete(user)
+  This is to follow good practice to make a fetch on object before deleting it.
+- The form to add a product to a draft proposal/order/invoice from the product card is hidden by default.
+  It was not commonly used and usage generates some problems (cost price for margin calculation not entered, vat setting).  
+  Set constant PRODUCT_ADD_FORM_ADD_TO to retrieve it.
+- The javascript "datatables" library was used to be provided into Dolibarr sources, but it was not used by application.
+  So there is no reason to maintain its compatibility with other dolibarr components. If an external module need this 
+  library, this external module must embed hte library in his own sources/packages.
+- Trigger name SUPPLIER_PROPOSAL_CREATE has been renamed into PROPOSAL_SUPPLIER_CREATE
+- A new paramater sqlfilters was introduced to allow filter on any fields int the REST API. Few old parameters
+  no more required were also removed. Use this new one if you ware using one of them.
+- Method commande->deleteline($lindeid) has been replaced with commande->deleteline($user, $lineid).
+
+
+
+***** ChangeLog for 4.0.2 compared to 4.0.1 *****
+FIX: #5340
+FIX: #5779
+FIX: #5849
+FIX: #5866
+FIX: #5907
+FIX: Addline if $txlocaltax1 is empty
+FIX: Avoid error 500 if phpexcel is disabled
+FIX: Avoid errors on debian
+FIX: Can edit the customer ref even if order is not draft.
+FIX: Documents not moved in new directory if we change reference of the task.
+FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is child of an already linked to object
+FIX: Extra fields of task not copied on project cloning
+FIX: Hidden option PRODUCT_MAX_VISIBLE_PHOTO
+FIX: Link on supplier invoice in widget was not clickable
+FIX: margin tab on customer card must filter on current entity invoices
+FIX: missing column into SQL on thirdparty list
+FIX: Nber of attached files were not reported in event report of email sent
+FIX: only show projects of related third if external user
+FIX: Search provider by price
+FIX: Solve backup when using mysqldump that return warning
+FIX: Sql error in widget of product for stock alerts
+FIX: updateligne if $txlocaltax1 is null
+
+***** ChangeLog for 4.0.1 compared to 4.0.0 *****
+FIX: #2853
+FIX: #2991
+FIX: #3128
+FIX: #5699
+FIX: #5734
+FIX: #5742 error on project list if an extra field separator is added.
+FIX: #5746 chrome php Try a fix. Not sure it solved all problems reported
+FIX: #5748 Bug: Error updating to 4.0.1 with Postgresql. Field must be varchar.
+FIX: #5750 Bug: CmailFile::server_parse enters an infinite loop if $server_response is false
+FIX: #5752 Bug VAT NPR not propagated during proposal cloning
+FIX: #5763 Bug: Cannot Create Supplier Price Request
+FIX: #5770 Dolibarr doesn't modify correctly the hour of a task
+FIX: #5776
+FIX: #5802 Incoterms not set
+FIX: #5813 Bug: Incoterms not being read correctly
+FIX: #5818
+FIX: alignement of intervention status
+FIX: Clean of search fields
+FIX: Creation of donation should go back on card after creation
+FIX: Date visible on project overview
+FIX: Execute a dedicated job from its id may results of launching other jobs too.
+FIX: Failed to export contact categories with contact extra fields
+FIX: inversion customer/supplier price
+FIX: link "back to list" was not visible.
+FIX: Lost filter on opportunities
+FIX: Mandatory field payment term was not css highlighted.
+FIX: Menu users not visible on dolidroid.
+FIX: SEC for HTB23302
+FIX: The email test sender in email setup was broken
+FIX: Translation of "Name" is not a good choice for floow-up.
+FIX: Update of maxnbrun on job list failed.
+FIX: Value of payment term and project are not set on correct default value when invoice generated from template.
+FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
+FIX: Vat not visible in dictionnary
 
 ***** ChangeLog for 4.0.0 compared to 3.9.* *****
 For users:

+ 1 - 1
Dockerfile

@@ -3,7 +3,7 @@ FROM php:5.6-apache
 RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libldap2-dev \
 	&& rm -rf /var/lib/apt/lists/* \
 	&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
-	&& docker-php-ext-install gd
+	&& docker-php-ext-install gd \
 	&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
         && docker-php-ext-install ldap \
         && docker-php-ext-install mysqli \

+ 1 - 1
README.md

@@ -147,7 +147,7 @@ These are features that Dolibarr does **not** yet fully support:
 
 ## DOCUMENTATION
 
-Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](http://wiki.dolibarr.org).
+Administrator, user, developer and translator's documentations are available along with other community resources on the [Wiki](https://wiki.dolibarr.org).
 
 ## CONTRIBUTING
 

+ 0 - 78
build/README-FR

@@ -1,78 +0,0 @@
-README (French)
-################################
-Building packages
-################################
-
-Les sous repertoires du repertoire "build" contiennent tous les fichiers
-requis pour packager Dolibarr de maniere automatisee.
-On trouve plusieurs outils:
-
-- Pour construire un package Dolibarr complet, il suffit de
-> Editer la version dans le fichier makepack-dolibarr.pl  
-> Lancer la commande perl makepack-dolibarr.pl
-
-- Pour construire un package d'une traduction, il suffit de lancer le script
-> perl makepack-dolibarrlang.pl
-
-- Pour construire un package d'un theme, il suffit de lancer le script
-> perl makepack-dolibarrtheme.pl
-
-- Pour construire un package d'un module, il suffit de lancer le script
-> perl makepack-dolibarrmodule.pl
-
-- Pour construire un package DoliWamp autoexe:
-> Installer InnoSetup (http://www.jrsoftware.org)
-> Installer WampServer dans "C:\Program Files\Wamp" (http://www.wampserver.com)
-> Installer les addon WampServer afin d'y mettre les versions:
-   Apache2.2.6, Mysql5.0.45, Php5.2.5
-> Modifier dans le fichier build/exe/doliwamp.iss la variable SourceDir
-  afin d'y mettre le repository Dolibarr.
-> Modifier AppVerName et OutputBaseFilename.
-> Lancer innosetup, ouvrir le fichier build/exe/doliwamp.iss et cliquer sur
-  le bouton "Compile". Le fichier .exe sera fabrique dans le repertoire build.
-
-- Pour generer la documentation developpeur, lancer le script
-> perl dolybarr-doxygen-build.pl
-
-
-Note: 
-
-Le repertoire build et tout ce qu'il contient n'est absolument pas requis
-pour faire fonctionner Dolibarr. Ils ne servent qu'a la generation des
-packages. Certains packages, une fois construit, n'incluent par le repertoire
-"build".
-
-On trouve dans le repertoire "build", les sous-repertoires utilises par
-l'outil makepack-dolibarr.pl:
-
-* deb:
-Fichier de config pour construire un package Debian.
-
-* rpm:
-Fichier de config pour construire un package Redhat ou Mandrake.
-
-* tgz:
-Fichier de config pour construire un package tgz.
-
-* exe:
-Fichier de config pour construire un package exe pour Windows des sources 
-ou pour construire l'assistant d'installation complet DoliWamp.
-
-* zip:
-Fichier de config pour construire un package zip.
-
-* live:
-Fichier pour fabriquer un live CD de demo de Dolibarr.
-
-* patch:
-Fichier exemple de generation de fichier patch pour diffusion d'une
-modification de Dolibarr.
-
-* doap:
-Fichier descriptif DOAP pour promouvoir/decrire la version de Dolibarr.
-
-* pad:
-Fichier descriptif PAD pour promouvoir/decrire la version de Dolibarr.
-
-* dmg:
-Fichier de config pour construire un package dmg DoliMamp pour Mac OS X

+ 16 - 7
build/debian/README.howto

@@ -154,8 +154,10 @@ tag 729538 -moreinfo
 ##### Testing a package into unstable env
 
 Check you have a mysql server available from another interface than "localhost".
-Comment line in /etc/mysql/my.cnf if required and restart mysql
-#bind-address = 127.0.0.1
+Set line in /etc/mysql/my.cnf if required and restart mysql
+
+[mysqld]
+bind-address           = *
 
 Create a chroot called "unstable-amd64-sbuild".
 Chroot env is stored into /srv/chroot directory.
@@ -170,6 +172,8 @@ Puis pour se connecter et préparer l'environnement
 > schroot -c name_of_chroot
 > cat /etc/debian_chroot       to check which debian branch we are into
 > vi /usr/sbin/policy-rc.d     and replace return code 101 (not allowed) into 0 (ok)
+> apt-get update
+> apt-get upgrade
 > apt-get install links mysql-client
 
 To test a package
@@ -185,7 +189,7 @@ To test a package
 If there is a problem launching apache, because port is already used, change it into your chroot install with
 > vi /etc/apache2/ports.conf
 Then restart.
-Then you can call/test dolibarr with http://localhost:port/dolibarr/ (It can be also called from host).
+Then you can call/test dolibarr with http://localhost:port/dolibarr/ . It can be also called FROM HOST (port must be a not used port on host).
 
 
 
@@ -291,13 +295,18 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
 * Edit orig.tar.gz file to remove 
 - debian
 - htdocs/includes/ckeditor
+- htdocs/includes/jszip
+- htdocs/includes/jquery/plugins/datatables
+- htdocs/includes/mike42
 - htdocs/includes/phpexcel or htdocs/includes/phpoffice
-- htdocs/includes/tcpdf or htdocs/includes/tecnickom
+- htdocs/includes/swiftmailer
+- htdocs/includes/restler/framework/Luracast/Restler/explorer
+- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
 And rename file into 
 dolibarr-x.y.z+dfsgw.tgz
 (x.y.z = version, w start from 1 and is increased for each new git-import-orig already done)
 
-* Staying into git root directory, run
+* Staying into projet gitted root directory, run
 > git-import-orig -vv ../dolibarr-x.y.z+dfsgw.tgz --debian-branch=[master|jessie] --upstream-branch=[upstream|upstream-3.5.x]
 and enter version when requested with format
 x.y.z+dfsgw
@@ -324,7 +333,7 @@ To update dolibarr debian package when only files into debian has changed:
 To update dolibarr debian package when only files not into debian has changed:
 
 * Manually, add patches into debian/patches and update file debian/series, or do the 2 steps with "quilt import filepatch.patch"
-* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revien a l'état du upstream sans les patch.
+* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch.
 
 Once files has been prepared, it's time to test:
 
@@ -341,7 +350,7 @@ Note: Package is built into directory ../build-area
 Note: To compare 2 packages: debdiff package1.dsc package2.dsc
 
 * Test package (see dedicated chapter to test it with debian unstable env)
-> cp ../build-area/* /srv/chroot/unstable/tmp
+> sudo rm /srv/chroot/unstable/tmp/* >/dev/null 2>&1; cp ../build-area/* /srv/chroot/unstable/tmp
 See rest of process into dedicated chapter "To test a package" to test it with debian unstable env
 
 * If package .deb is ok:

+ 1 - 1
build/debian/control

@@ -16,7 +16,7 @@ Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm |
     php5-mysql | php5-mysqli, php5-curl, php5-gd, php5-ldap,
 # Required PHP libraries
     php-pear, php-mail-mime, 
-#    php-tcpdf, libfpdi-php,
+#    php-tcpdf,
 #    libfpdf-tpl-php, php-fpdf,
 #    libphp-adodb,
 #    libnusoap-php,

+ 1 - 4
build/debian/copyright

@@ -1,7 +1,7 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: Dolibarr
 Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
-Source: http://www.dolibarr.org/files/stable/standard/
+Source: https://www.dolibarr.org/files/stable/standard/
 
 Files: *
 Copyright: 2002-2009, Rodolphe Quiedeville   <rodolphe@quiedeville.org>
@@ -197,9 +197,6 @@ License: GPL-2+
  On Debian systems, the full text of the GNU General Public
  License version 2 can be found in the file
  `/usr/share/common-licenses/GPL-2'.
-Comment:
- Those files are not shipped in the binary package as we
- configure Dolibarr to use the library packaged in "libfpdi-php".
 
 Files: htdocs/includes/geoip/*
 Copyright: 2007 MaxMind LLC

+ 0 - 1
build/debian/dolibarr.postinst

@@ -147,7 +147,6 @@ case "$1" in
 			# File already exist. We add params not found.
 			#echo Add new params to overwrite path to use shared libraries/fonts
 			#grep -q -c "dolibarr_lib_ADODB_PATH" $config    || [ ! -d "/usr/share/php/adodb" ]  || echo "<?php \$dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; ?>" >> $config
-			#grep -q -c "dolibarr_lib_FPDI_PATH" $config     || [ ! -d "/usr/share/php/fpdi" ]   || echo "<?php \$dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; ?>" >> $config
 			##grep -q -c "dolibarr_lib_GEOIP_PATH" $config    || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
 			#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config   || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
 			#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ]  || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config

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

@@ -30,8 +30,6 @@ $force_install_lockinstall='444';
 // - not removed from package (see rm in rules file),
 // - declared into dependencies (see Depends in control file)
 //$force_dolibarr_lib_TCPDF_PATH='';
-//$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf';
-//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi';
 //$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
 //$force_dolibarr_lib_GEOIP_PATH='';
 //$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';

+ 0 - 1
build/debian/rules

@@ -79,7 +79,6 @@ override_dh_install:
 	
 	# clean from all PHP embedded libraries (we use package dependencies instead)
 #	rm -fr htdocs/includes/adodbtime
-#	rm -fr htdocs/includes/fpdfi
 #	rm -fr htdocs/includes/geoip
 #	rm -fr htdocs/includes/nusoap
 #	rm -fr htdocs/includes/odtphp/zip/pclzip

+ 24 - 2
build/generate_filecheck_xml.php → build/generate_filelist_xml.php

@@ -32,11 +32,33 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
     exit;
 }
 
+require_once($path."../htdocs/master.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
 
-// Main
+
+/*
+ * Main
+ */
+
+if (empty($argv[1])) 
+{
+    print "Usage: ".$script_file." release=x.y.z\n";
+    exit -1;
+}
 parse_str($argv[1]);
+
+if ($release != DOL_VERSION)
+{
+    print 'Error: release is not version declared into filefunc.in.php.'."\n";
+    exit -1;
+}
+
 //$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
-$outputfile=dirname(__FILE__).'/../htdocs/install/filelist.xml';
+$outputdir=dirname(__FILE__).'/../htdocs/install';
+print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
+dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
+
+$outputfile=$outputdir.'/filelist-'.$release.'.xml';
 $fp = fopen($outputfile,'w');
 fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
 fputs($fp, '<checksum_list version="'.$release.'">'."\n");

+ 7 - 4
build/launchpad/README

@@ -73,6 +73,8 @@ If you want to build/test package locally:
     bzr commit -m "Upstream version x.y"
     bzr push
 
+
+
 # Init debian dir repository into launchpad (when repository for sources does not exist)
 #----------------------------------
 -  Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|stable]
@@ -104,12 +106,13 @@ If you want to build/test package locally:
     bzr push lp:~yourlogin/+junk/debian-[dev|stable]
 
 
+
 # Define a recipe into launchpad (a rule to build packages into a PPA)
 #----------------------------------
-- Create a file dolibarr.recipe with content
+- Create a file dolibarr-[beta|stable].recipe with content
     cd bzr
-    vi dolibarr.recipe
-    	For dev:
+    vi dolibarr-[beta|stable].recipe
+    	For beta/dev:
 	    # bzr-builder format 0.3 deb-version {debupstream}-0~{revno}
 		lp:dolibarr
 		merge packaging lp:~yourlogin/+junk/debian-dev
@@ -119,7 +122,7 @@ If you want to build/test package locally:
 		merge packaging lp:~yourlogin/+junk/debian-stable
 - Run command
     cd bzr
-    bzr dailydeb dolibarr.recipe working-dir
+    bzr dailydeb dolibarr-[beta|stable].recipe working-dir
   This will create a directory "working-dir" with dolibarr sources and will add sources from ~yourlogin/+junk/debian-[dev|stable]
 - Test package sources
     sudo pbuilder build <working-dir>/<project>_<version>.dsc

+ 0 - 74
build/live/Howto.txt

@@ -1,74 +0,0 @@
-Howto (English)
-##################################################
-Building a live CD/USB
-##################################################
-
-This is all steps to follow to build a live CD/USB demo of Dolibarr using
-SLAX distribution.
-
-1) Download SLAX (www.slax.org) as a zip file.
-
-2) Unzip file on a directory on any USB key with at least 512Mo free (even
-if you want to build a CD live).
-
-3) Download following modules from SLAX web sites and put files
-into the /slax/modules directory:
-apr-1.2.12-i486-1.lzm
-apr-util-1.2.12-i486-1.lzm
-cairomm-1.4.8-i686.lzm
-cli-ftp-pack.lzm
-codecs-essential-20071007.lzm
-firefox-2.0.0.14.lzm
-ghostscript-8.62-i486-5.lzm
-gimp-2.4.5-i486-1sl.lzm
-gparted-0.3.7-i486-1as.lzm
-grsync.lzm
-httpd-2.2.8-i486-1.lzm
-libsigc++-2.0.18-i686.lzm
-mysql-5.0.51b-i486-1.lzm
-php-5.2.6-i486-1.lzm
-printmodule-s6.lzm
-Save_by_Pastrugno-0.1.lzm
-telnet-1.5.lzm
-
-4) Copy dolibarr files into path
-\slax\changes\var\www\htdocs\dolibarr
-
-5) Run the script 
-> /boot/bootinst.bat
-or
-> /boot/bootinst.sh
-and answer yes to overwrite the MBR of the disk of your USB key.
-
-6) Boot on USB key (Change your BIOS setup if required).
-
-7) After boot, run the script 
-> mysql_install_db --user=mysql
-This will create mysql empty system database.
-
-8) Edit the file /etc/httpd/httpd.conf to uncomment the line
-with PHP activation.
-Include /etc/httpd/mod_php.conf
-
-9) Edit \slax\changes\etc\httpd\php.ini file to disabled features where librairies does not
-exists. You can comment lines:
-;extension=gd.so
-;extension=mhash.so
-;extension=snmp.so
-
-10) Personalized your desktop.
-Add a link to application
-"firefox http://localhost/dolibarr/htdocs/index.php"
-Add a link to application
-"/var/www/htdocs/dolibarr/dev/initdemo/initdemo.sh"
-Add a link to application
-"/var/www/htdocs/dolibarr/dev/initdemo/removedemo.sh"
-
-11) Reboot again on your USB key.
-
-12) Now you can run Dolibarr install process
-http://localhost/dolibarr/htdocs/install/index.php
-or copy USB key content to build another one quickly.
-or build a CD with command (TODO).
-
-

+ 0 - 7
build/live/README

@@ -1,7 +0,0 @@
-README (English)
-##################################################
-Building a live CD/USB
-##################################################
-
-This directory contains files and docs used to build
-a live CD or USB demo of Dolibarr.

+ 34 - 18
build/makepack-dolibarr.pl

@@ -159,6 +159,7 @@ $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
 if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
 $FILENAMETGZ2="$PROJECT-$MAJOR.$MINOR.$REL1";
 $FILENAMERPM=$FILENAMETGZ2."-".$RPMSUBVERSION.".".$ARCH.".rpm";
+$FILENAMERPMSRC=$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm";
 # For Deb
 $newbuild = $BUILD;
 $newbuild =~ s/(dev|alpha)/1/gi;                # dev
@@ -317,8 +318,13 @@ print "\n";
 if ($CHOOSEDTARGET{'-CHKSUM'})
 {
    	print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
-  	$ret=`php $SOURCE/build/generate_filecheck_xml.php release=$MAJOR.$MINOR.$BUILD`;
+  	$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
   	print $ret."\n";
+  	# Copy to final dir
+  	$NEWDESTI=$DESTI;
+	print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n";
+    use File::Copy qw(copy);
+    copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml";
 }
 
 
@@ -363,20 +369,23 @@ if ($nboftargetok) {
 		if (! $ret)
 		{
 			print "Error: The ChangeLogFile was not updated. Run the following command before building package for $MAJOR.$MINOR.$BUILD:\n";
-			if (! $BUILD || $BUILD eq '0-rc')	# For a major version
-			{
-				print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..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';
-			}
-			else			# For a maintenance release
-			{
-				print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-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';
-			}
-			print "\n";
-			exit;
 		}
 		else
 		{
-			print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n";
+			print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with commande:'\n";
+		}
+		if (! $BUILD || $BUILD eq '0-rc')	# For a major version
+		{
+			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..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';
+		}
+		else			# For a maintenance release
+		{
+			print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-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';
+		}
+		print "\n";
+		if (! $ret)
+		{
+			exit;
 		}
 			
 		print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
@@ -725,8 +734,8 @@ if ($nboftargetok) {
 
 			print "Remove target ".$FILENAMERPM."...\n";
 			unlink("$NEWDESTI/".$FILENAMERPM);
-			print "Remove target ".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm...\n";
-			unlink("$NEWDESTI/".$FILENAMETGZ2."-".$RPMSUBVERSION.".src.rpm");
+			print "Remove target ".$FILENAMERPMSRC."...\n";
+			unlink("$NEWDESTI/".$FILENAMERPMSRC);
 
 			print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
 			$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
@@ -1132,15 +1141,19 @@ if ($nboftargetok) {
 	
 		print "\nList of files to publish (BUILD=$BUILD)\n";
 		%filestoscansf=(
+			"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none',				# none means it won't be published on SF
 			"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
+			"$DESTI/package_rpm_generic/$FILENAMERPMSRC"=>'none',						# none means it won't be published on SF
 			"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
-			"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none',
+			"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none',		# none means it won't be published on SF
 			"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
 			"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
 			"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
 		);
 		%filestoscanstableasso=(
+			"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'signatures',
 			"$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic',
+			"$DESTI/package_rpm_generic/$FILENAMERPMSRC"=>'package_rpm_generic',
 			"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
 			"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
 			"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
@@ -1202,9 +1215,10 @@ if ($nboftargetok) {
 				my $filesize = -s $file;
 				if (! $filesize) { next; }
 
-				print "\n";
-	    		
-	    		if ($target eq 'SF' && $filestoscan{$file} ne 'none') { 
+	    		if ($target eq 'SF') {
+	    			if ($filestoscan{$file} eq 'none') {
+	    				next;
+	    			} 
 	    			$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
 	    		}
 	    		elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
@@ -1221,6 +1235,8 @@ if ($nboftargetok) {
 	    			$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;  
 	    			$destFolder="$NEWPUBLISH/$dirnameonly";
 	    		}
+
+				print "\n";
 	    		print "Publish file ".$file." to ".$destFolder."\n";
 
 				# mkdir	   

+ 1 - 1
build/obs/README

@@ -36,7 +36,7 @@ Go into project you want to update. It mught be:
 
 Once logged, click on "Add file" in section "Source Files", then select mode "Upload From: Remote URL"
 Keep empty for "Filename", choose "Remote URL" and enter into last field, URL that should looks like this:
-http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-0.3.src.rpm
+http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-x.y.v-0.4.src.rpm
 
 Then add into Advanded - Attributes
 OBS:Screenshots http://www.dolibarr.org/images/dolibarr_screenshot1.png

+ 1 - 1
build/rpm/dolibarr_fedora.spec

@@ -34,7 +34,7 @@ AutoReqProv: no
 
 
 %description
-An easy to use CRM & ERP open source/free software for small  
+An easy to use CRM & ERP open source/free software package for small  
 and medium companies, foundations or freelances. It includes different 
 features for Enterprise Resource Planning (ERP) and Customer Relationship 
 Management (CRM) but also for different other activities.

+ 1 - 1
build/rpm/dolibarr_generic.spec

@@ -75,7 +75,7 @@ AutoReqProv: no
 
 
 %description
-An easy to use CRM & ERP open source/free software for small  
+An easy to use CRM & ERP open source/free software package for small  
 and medium companies, foundations or freelances. It includes different 
 features for Enterprise Resource Planning (ERP) and Customer Relationship 
 Management (CRM) but also for different other activities.

+ 1 - 1
build/rpm/dolibarr_mandriva.spec

@@ -33,7 +33,7 @@ AutoReqProv: no
 
 
 %description
-An easy to use CRM & ERP open source/free software for small  
+An easy to use CRM & ERP open source/free software package for small  
 and medium companies, foundations or freelances. It includes different 
 features for Enterprise Resource Planning (ERP) and Customer Relationship 
 Management (CRM) but also for different other activities.

+ 1 - 1
build/rpm/dolibarr_opensuse.spec

@@ -36,7 +36,7 @@ AutoReqProv: no
 
 
 %description
-An easy to use CRM & ERP open source/free software for small  
+An easy to use CRM & ERP open source/free software package for small  
 and medium companies, foundations or freelances. It includes different 
 features for Enterprise Resource Planning (ERP) and Customer Relationship 
 Management (CRM) but also for different other activities.

+ 1 - 1
composer.json

@@ -55,6 +55,6 @@
         "ext-soap": "Native SOAP",
         "ext-zip": "ODT and Excel support",
         "ext-xml": "Excel support",
-        "firephp/firephp-core": "Logging to Firebug console support",
+        "firephp/firephp-core": "Logging to Firebug console support"
     }
 }

+ 2 - 2
dev/README

@@ -7,7 +7,7 @@ provided with a standard release.
 
 
 There is also some documentation on Dolibarr Wiki:
-http://wiki.dolibarr.org/
+https://wiki.dolibarr.org/
 and
-http://www.dolibarr.org/html_doxygen/index.html
+https://doxygen.dolibarr.org/
 

+ 0 - 0
dev/examples/README → dev/examples/code/README


+ 0 - 0
dev/examples/create_invoice.php → dev/examples/code/create_invoice.php


+ 0 - 0
dev/examples/create_order.php → dev/examples/code/create_order.php


+ 0 - 0
dev/examples/create_product.php → dev/examples/code/create_product.php


+ 0 - 0
dev/examples/create_user.php → dev/examples/code/create_user.php


+ 0 - 0
dev/examples/get_contracts.php → dev/examples/code/get_contracts.php


+ 0 - 0
dev/ical/event_recu.txt → dev/examples/ical/event_recu.txt


+ 0 - 0
dev/ldap/README → dev/examples/ldap/README


+ 0 - 0
dev/ldap/ldapadd_sample1.txt → dev/examples/ldap/ldapadd_sample1.txt


+ 0 - 0
dev/ldap/ldapadd_sample2.txt → dev/examples/ldap/ldapadd_sample2.txt


+ 0 - 0
dev/ldap/ldapadd_sample3.txt → dev/examples/ldap/ldapadd_sample3.txt


+ 0 - 0
dev/ldap/ldapdelete_sample1.txt → dev/examples/ldap/ldapdelete_sample1.txt


+ 0 - 0
dev/ldap/ldapdelete_sample3.txt → dev/examples/ldap/ldapdelete_sample3.txt


+ 0 - 0
dev/ldap/ldapmodify_sample1.txt → dev/examples/ldap/ldapmodify_sample1.txt


+ 0 - 0
dev/ldap/ldapsearch_sample1.txt → dev/examples/ldap/ldapsearch_sample1.txt


+ 0 - 0
dev/ldap/setup_example_activedirectory.jpg → dev/examples/ldap/setup_example_activedirectory.jpg


+ 0 - 0
dev/mail/README → dev/examples/mail/README


+ 0 - 0
dev/mail/dolibarr_mail_attachement.txt → dev/examples/mail/dolibarr_mail_attachement.txt


+ 0 - 0
dev/mail/dolibarr_mail_attachementHTML.txt → dev/examples/mail/dolibarr_mail_attachementHTML.txt


+ 0 - 0
dev/mail/dolibarr_mail_attachementwithimageHTML.txt → dev/examples/mail/dolibarr_mail_attachementwithimageHTML.txt


+ 0 - 0
dev/mail/dolibarr_mail_simple.txt → dev/examples/mail/dolibarr_mail_simple.txt


+ 0 - 0
dev/mail/dolibarr_mail_simpleHTML.txt → dev/examples/mail/dolibarr_mail_simpleHTML.txt


+ 0 - 0
dev/mail/dolibarr_mail_universal.txt → dev/examples/mail/dolibarr_mail_universal.txt


+ 0 - 0
dev/mail/dolibarr_mail_withimageHTML.txt → dev/examples/mail/dolibarr_mail_withimageHTML.txt


+ 0 - 0
dev/mail/source_email_from_thirdparty.txt → dev/examples/mail/source_email_from_thirdparty.txt


+ 0 - 0
dev/initdemo/removedemo.sh → dev/initdemo/removeconfdemo.sh


+ 0 - 0
dev/cliparts/commons.svg → dev/resources/cliparts/commons.svg


+ 0 - 0
dev/dbmodel/dolibarr.uml → dev/resources/dbmodel/dolibarr.uml


+ 0 - 0
dev/dbmodel/dolibarr.umldi → dev/resources/dbmodel/dolibarr.umldi


+ 0 - 0
dev/dbmodel/dolibarr_schema.mwb → dev/resources/dbmodel/dolibarr_schema.mwb


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


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


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


+ 0 - 0
dev/iso-normes/barcode_EAN13.txt → dev/resources/iso-normes/barcode_EAN13.txt


+ 0 - 0
dev/iso-normes/countries_iso-3166_en.txt → dev/resources/iso-normes/countries_iso-3166_en.txt


+ 0 - 0
dev/iso-normes/countries_iso-3166_fr.txt → dev/resources/iso-normes/countries_iso-3166_fr.txt


+ 0 - 0
dev/iso-normes/currencies_iso-4217.txt → dev/resources/iso-normes/currencies_iso-4217.txt


+ 0 - 0
dev/iso-normes/fichier_norme_AFB-CFONB.pdf → dev/resources/iso-normes/fichier_norme_AFB-CFONB.pdf


+ 0 - 0
dev/iso-normes/format_FEC-Lien_outil_de_test_agréé.pdf → dev/resources/iso-normes/format_FEC-Lien_outil_de_test_agréé.pdf


+ 0 - 0
dev/iso-normes/format_FEC.pdf → dev/resources/iso-normes/format_FEC.pdf


+ 0 - 0
dev/iso-normes/iban_iso-13616.txt → dev/resources/iso-normes/iban_iso-13616.txt


+ 0 - 0
dev/iso-normes/languages_iso-639.txt → dev/resources/iso-normes/languages_iso-639.txt


+ 0 - 0
dev/iso-normes/locales.txt → dev/resources/iso-normes/locales.txt


+ 0 - 0
dev/iso-normes/vat_number_names.txt → dev/resources/iso-normes/vat_number_names.txt


+ 0 - 0
dev/iso-normes/world_tax_rates.txt → dev/resources/iso-normes/world_tax_rates.txt


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


+ 0 - 0
dev/licence/Links on GPL.txt → dev/resources/licence/Links on GPL.txt


+ 0 - 0
dev/licence/quick-guide-gplv3-compatibility.png → dev/resources/licence/quick-guide-gplv3-compatibility.png


+ 0 - 0
dev/codesniffer/README → dev/setup/codesniffer/README


+ 0 - 0
dev/codesniffer/php.ini → dev/setup/codesniffer/php.ini


+ 0 - 0
dev/codesniffer/ruleset.dtd → dev/setup/codesniffer/ruleset.dtd


+ 1 - 0
dev/codesniffer/ruleset.xml → dev/setup/codesniffer/ruleset.xml

@@ -9,6 +9,7 @@
 	<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
 	<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
 	<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
+	<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
 
 		<!-- List of all tests -->
 

+ 0 - 0
dev/codetemplates/README → dev/setup/codetemplates/README


+ 0 - 0
dev/codetemplates/codetemplates.dtd → dev/setup/codetemplates/codetemplates.dtd


+ 0 - 0
dev/codetemplates/codetemplates.xml → dev/setup/codetemplates/codetemplates.xml


+ 0 - 0
dev/multitail/.multitailrc → dev/setup/multitail/.multitailrc


+ 0 - 0
dev/phpunit/README → dev/setup/phpunit/README


+ 0 - 0
dev/phpunit/eclipse_setup_for_pti_phpunit.png → dev/setup/phpunit/eclipse_setup_for_pti_phpunit.png


+ 0 - 0
dev/security/README → dev/setup/security/README


+ 0 - 0
dev/security/htaccess.txt → dev/setup/security/htaccess.txt


+ 0 - 0
dev/xdebug/README → dev/setup/xdebug/README


+ 0 - 0
dev/xdebug/eclipse_setup_for_xdebug.jpg → dev/setup/xdebug/eclipse_setup_for_xdebug.jpg


+ 13 - 5
dev/skeletons/README

@@ -2,24 +2,32 @@ README (English)
 --------------------------------
 This directory contains PHP script samples that can be used to start a development on Dolibarr.
 
-build_class_from_table.php:
+
+*** build_class_from_table.php:
+
 This is the script to use to generate PHP code of a PHP POJO class
 object, a PHP script that use this POJO. This script use the files
 skeleton_*.php to build its generated code. 
 
 
-modMyModule.class.php:
+*** modMyModule.class.php:
+
 Is a sample of module descriptor that you can use if you want to build a new module/plugin for
 Dolibarr.
 
 
-skeleton_script.php:
+*** skeleton_script.php:
+
 Is a sample you can use as an example if you need to build a script to run on command line
 
-skeleton_page.php:
+
+*** skeleton_page.php:
+
 Is a sample you can use as an example if you need to build an HTML page to include in Dolibarr GUI.
 
-skeleton_class.class.php:
+
+*** skeleton_class.class.php:
+
 Is a sample you can use as an example if you need to build a class file to access a new table required by a Dolibarr development.
 However it is better to run the build_class_from_table.php script that accepts a table name as a parameter and will uses the description table within database and the skeleton_class.class.php file to generate full code for your class file.
 After running this script, the class to access your table (insert a record, update, delete and select) is directly finished and can be used by your module's code. 

+ 4 - 4
dev/skeletons/modMyModule.class.php

@@ -62,7 +62,7 @@ class modMyModule extends DolibarrModules
 		$this->name = preg_replace('/^mod/i','',get_class($this));
 		// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
 		$this->description = "Description of module MyModule";
-		$this->descriptionlong = "A very lon description. Can be a full HTML content";
+		$this->descriptionlong = "A very long description. Can be a full HTML content";
 		$this->editor_name = 'Editor name';
 		$this->editor_url = 'http://www.dolibarr.org';
 		
@@ -105,9 +105,9 @@ class modMyModule extends DolibarrModules
 
 		// Dependencies
 		$this->hidden = false;			// A condition to hide module
-		$this->depends = array();		// List of modules id that must be enabled if this module is enabled
-		$this->requiredby = array();	// List of modules id to disable if this one is disabled
-		$this->conflictwith = array();	// List of modules id this module is in conflict with
+		$this->depends = array();		// List of module class names as string that must be enabled if this module is enabled
+		$this->requiredby = array();	// List of module ids to disable if this one is disabled
+		$this->conflictwith = array();	// List of module class names as string this module is in conflict with
 		$this->phpmin = array(5,0);					// Minimum version of PHP required by module
 		$this->need_dolibarr_version = array(3,0);	// Minimum version of Dolibarr required by module
 		$this->langfiles = array("mylangfile@mymodule");

+ 9 - 8
dev/skeletons/skeleton_api_class.class.php

@@ -93,12 +93,12 @@ class SkeletonApi extends DolibarrApi
      * @param string	$sortorder	Sort order
      * @param int		$limit		Limit for list
      * @param int		$page		Page number
-     *
+     * @param string    $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101') or (t.import_key:=:'20160101')"
      * @return array Array of skeleton objects
      *
      * @url	GET /skeletons/
      */
-    function getList($mode, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0) {
+    function index($mode, $sortfield = "t.rowid", $sortorder = 'ASC', $limit = 0, $page = 0, $sqlfilters = '') {
         global $db, $conf;
         
         $obj_ret = array();
@@ -124,18 +124,19 @@ class SkeletonApi extends DolibarrApi
         if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
         if ($socid) $sql.= " AND s.fk_soc = ".$socid;
         if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";		// Join for the needed table to filter by sale
-        
         // Insert sale filter
         if ($search_sale > 0)
         {
             $sql .= " AND sc.fk_user = ".$search_sale;
         }
-        
-        $nbtotalofrecords = 0;
-        if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+        if ($sqlfilters)
         {
-            $result = $db->query($sql);
-            $nbtotalofrecords = $db->num_rows($result);
+            if (! DolibarrApi::_checkFilters($sqlfilters))
+            {
+                throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters);
+            }
+	        $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
+            $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
         }
 
         $sql.= $db->order($sortfield, $sortorder);

+ 18 - 11
dev/skeletons/skeleton_card.php

@@ -59,25 +59,27 @@ $myparam	= GETPOST('myparam','alpha');
 $search_field1=GETPOST("search_field1");
 $search_field2=GETPOST("search_field2");
 
+if (empty($action) && empty($id) && empty($ref)) $action='view';
+
 // Protection if external user
 if ($user->societe_id > 0)
 {
 	//accessforbidden();
 }
+//$result = restrictedArea($user, 'mymodule', $id);
 
-if (empty($action) && empty($id) && empty($ref)) $action='list';
 
-// Load object if id or ref is provided as parameter
-$object=new Skeleton_Class($db);
-if (($id > 0 || ! empty($ref)) && $action != 'add')
-{
-	$result=$object->fetch($id,$ref);
-	if ($result < 0) dol_print_error($db);
-}
+$object = new Skeleton_Class($db);
+$extrafields = new ExtraFields($db);
+
+// fetch optionals attributes and labels
+$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';  // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
 
 // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
 $hookmanager->initHooks(array('skeleton'));
-$extrafields = new ExtraFields($db);
 
 
 
@@ -281,8 +283,13 @@ if (($id || $ref) && $action == 'edit')
 
 
 // Part to show record
-if ($id && (empty($action) || $action == 'view' || $action == 'delete'))
+if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
 {
+    $res = $object->fetch_optionals($object->id, $extralabels);
+
+	$head = commande_prepare_head($object);
+	dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
+		
 	print load_fiche_titre($langs->trans("MyModule"));
     
 	dol_fiche_head();
@@ -293,7 +300,7 @@ if ($id && (empty($action) || $action == 'view' || $action == 'delete'))
 	}
 	
 	print '<table class="border centpercent">'."\n";
-	// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
+	// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
 	// LIST_OF_TD_LABEL_FIELDS_VIEW
 	print '</table>';
 	

+ 57 - 18
dev/skeletons/skeleton_class.class.php

@@ -164,10 +164,14 @@ class Skeleton_Class extends CommonObject
 		$sql .= ' t.field2';
 		//...
 		$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t';
+		$sql.= ' WHERE 1 = 1';
+		if (! empty($conf->multicompany->enabled)) {
+		    $sql .= " AND entity IN (" . getEntity("skeleton", 1) . ")";
+		}
 		if (null !== $ref) {
-			$sql .= ' WHERE t.ref = ' . '\'' . $ref . '\'';
+			$sql .= ' AND t.ref = ' . '\'' . $ref . '\'';
 		} else {
-			$sql .= ' WHERE t.rowid = ' . $id;
+			$sql .= ' AND t.rowid = ' . $id;
 		}
 
 		$resql = $this->db->query($sql);
@@ -181,6 +185,16 @@ class Skeleton_Class extends CommonObject
 				$this->prop2 = $obj->field2;
 				//...
 			}
+			
+			// Retrieve all extrafields for invoice
+			// fetch optionals attributes and labels
+			require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+			$extrafields=new ExtraFields($this->db);
+			$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
+			$this->fetch_optionals($this->id,$extralabels);
+
+			// $this->fetch_lines();
+			
 			$this->db->free($resql);
 
 			if ($numrows) {
@@ -226,16 +240,20 @@ class Skeleton_Class extends CommonObject
 				$sqlwhere [] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
 			}
 		}
+		$sql.= ' WHERE 1 = 1';
+		if (! empty($conf->multicompany->enabled)) {
+		    $sql .= " AND entity IN (" . getEntity("skeleton", 1) . ")";
+		}
 		if (count($sqlwhere) > 0) {
-			$sql .= ' WHERE ' . implode(' '.$filtermode.' ', $sqlwhere);
+			$sql .= ' AND ' . implode(' '.$filtermode.' ', $sqlwhere);
 		}
-
 		if (!empty($sortfield)) {
 			$sql .= $this->db->order($sortfield,$sortorder);
 		}
 		if (!empty($limit)) {
 		 $sql .=  ' ' . $this->db->plimit($limit + 1, $offset);
 		}
+
 		$this->lines = array();
 
 		$resql = $this->db->query($sql);
@@ -355,6 +373,8 @@ class Skeleton_Class extends CommonObject
 			}
 		}
 
+		// If you need to delete child tables to, you can insert them here
+		
 		if (!$error) {
 			$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element;
 			$sql .= ' WHERE rowid=' . $this->id;
@@ -427,41 +447,55 @@ class Skeleton_Class extends CommonObject
 	}
 
 	/**
-	 *  Return a link to the user card (with optionaly the picto)
-	 * 	Use this->id,this->lastname, this->firstname
+	 *  Return a link to the object card (with optionaly the picto)
 	 *
 	 *	@param	int		$withpicto			Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
 	 *	@param	string	$option				On what the link point to
-     *  @param	integer	$notooltip			1=Disable tooltip
+     *  @param	int  	$notooltip			1=Disable tooltip
      *  @param	int		$maxlen				Max length of visible user name
      *  @param  string  $morecss            Add more css on link
 	 *	@return	string						String with URL
 	 */
 	function getNomUrl($withpicto=0, $option='', $notooltip=0, $maxlen=24, $morecss='')
 	{
-		global $langs, $conf, $db;
+		global $db, $conf, $langs;
         global $dolibarr_main_authentication, $dolibarr_main_demo;
         global $menumanager;
 
-
+        if (! empty($conf->dol_no_mouse_hover)) $notooltip=1;   // Force disable tooltips
+        
         $result = '';
         $companylink = '';
 
         $label = '<u>' . $langs->trans("MyModule") . '</u>';
-        $label.= '<div width="100%">';
+        $label.= '<br>';
         $label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
 
-        $link = '<a href="'.DOL_URL_ROOT.'/mymodule/card.php?id='.$this->id.'"';
-        $link.= ($notooltip?'':' title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip'.($morecss?' '.$morecss:'').'"');
-        $link.= '>';
+        $url = DOL_URL_ROOT.'/mymodule/'.$this->table_name.'_card.php?id='.$this->id;
+        
+        $linkclose='';
+        if (empty($notooltip))
+        {
+            if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
+            {
+                $label=$langs->trans("ShowProject");
+                $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
+            }
+            $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
+            $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
+        }
+        else $linkclose = ($morecss?' class="'.$morecss.'"':'');
+        
+		$linkstart = '<a href="'.$url.'"';
+		$linkstart.=$linkclose.'>';
 		$linkend='</a>';
 
         if ($withpicto)
         {
-            $result.=($link.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
+            $result.=($linkstart.img_object(($notooltip?'':$label), 'label', ($notooltip?'':'class="classfortooltip"')).$linkend);
             if ($withpicto != 2) $result.=' ';
 		}
-		$result.= $link . $this->ref . $linkend;
+		$result.= $linkstart . $this->ref . $linkend;
 		return $result;
 	}
 
@@ -477,13 +511,13 @@ class Skeleton_Class extends CommonObject
 	}
 
 	/**
-	 *  Renvoi le libelle d'un status donne
+	 *  Return the status
 	 *
 	 *  @param	int		$status        	Id status
-	 *  @param  int		$mode          	0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
+	 *  @param  int		$mode          	0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto
 	 *  @return string 			       	Label of status
 	 */
-	function LibStatut($status,$mode=0)
+	static function LibStatut($status,$mode=0)
 	{
 		global $langs;
 
@@ -518,6 +552,11 @@ class Skeleton_Class extends CommonObject
 			if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
 			if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
 		}
+		if ($mode == 6)
+		{
+			if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
+			if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
+		}
 	}
 
 

+ 294 - 290
dev/skeletons/skeleton_list.php

@@ -58,6 +58,7 @@ $action		= GETPOST('action','alpha');
 $backtopage = GETPOST('backtopage');
 $myparam	= GETPOST('myparam','alpha');
 
+$search_all=trim(GETPOST("sall"));
 $search_field1=GETPOST("search_field1");
 $search_field2=GETPOST("search_field2");
 $search_myfield=GETPOST('search_myfield');
@@ -141,22 +142,23 @@ $parameters=array();
 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
 
-include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
-
-// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (empty($reshook))
 {
-	$search_field1='';
-	$search_field2='';
-	$search_date_creation='';
-	$search_date_update='';
-    $toselect='';
-    $search_array_options=array();
-}
+    // Selection of new fields
+    include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
 
+    // Purge search criteria
+    if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+    {
+    	$search_field1='';
+    	$search_field2='';
+    	$search_date_creation='';
+    	$search_date_update='';
+        $toselect='';
+        $search_array_options=array();
+    }
 
-if (empty($reshook))
-{
+    // Mass actions
     $objectclass='Skeleton';
     $objectlabel='Skeleton';
     $permtoread = $user->rights->skeleton->read;
@@ -180,7 +182,6 @@ $form=new Form($db);
 //$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
 $help_url='';
 $title = $langs->trans('MyModuleListTitle');
-llxHeader('', $title, $help_url);
 
 // Put here content of your page
 
@@ -247,305 +248,308 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
 
 $sql.= $db->plimit($limit+1, $offset);
 
-
 dol_syslog($script_file, LOG_DEBUG);
 $resql=$db->query($sql);
-if ($resql)
+if (! $resql)
 {
-    $num = $db->num_rows($resql);
-    
-    $arrayofselected=is_array($toselect)?$toselect:array();
-    
-    $params='';
-    if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
-    if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
-    if ($search_field1 != '') $params.= '&amp;search_field1='.urlencode($search_field1);
-	if ($search_field2 != '') $params.= '&amp;search_field2='.urlencode($search_field2);
-    if ($optioncss != '') $param.='&optioncss='.$optioncss;
-    // Add $param from extra fields
-    foreach ($search_array_options as $key => $val)
-    {
-        $crit=$val;
-        $tmpkey=preg_replace('/search_options_/','',$key);
-        if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
-    } 
-
-    $arrayofmassactions =  array(
-        'presend'=>$langs->trans("SendByMail"),
-        'builddoc'=>$langs->trans("PDFMerge"),
-    );
-    if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
-    if ($massaction == 'presend') $arrayofmassactions=array();
-    $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
-    
-	print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
-    if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
-	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
-	print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
-    print '<input type="hidden" name="action" value="list">';
-	print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
-	print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
-	
-    print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
-	
-	if ($sall)
+    dol_print_error($db);
+    exit;
+}
+
+$num = $db->num_rows($resql);
+
+// Direct jump if only one record found
+if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all)
+{
+    $obj = $db->fetch_object($resql);
+    $id = $obj->rowid;
+    header("Location: ".DOL_URL_ROOT.'/skeleton/card.php?id='.$id);
+    exit;
+}
+
+llxHeader('', $title, $help_url);
+
+$arrayofselected=is_array($toselect)?$toselect:array();
+
+$param='';
+if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+if ($search_field1 != '') $param.= '&amp;search_field1='.urlencode($search_field1);
+if ($search_field2 != '') $param.= '&amp;search_field2='.urlencode($search_field2);
+if ($optioncss != '') $param.='&optioncss='.$optioncss;
+// Add $param from extra fields
+foreach ($search_array_options as $key => $val)
+{
+    $crit=$val;
+    $tmpkey=preg_replace('/search_options_/','',$key);
+    if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
+} 
+
+$arrayofmassactions =  array(
+    'presend'=>$langs->trans("SendByMail"),
+    'builddoc'=>$langs->trans("PDFMerge"),
+);
+if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
+if ($massaction == 'presend') $arrayofmassactions=array();
+$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
+
+print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
+if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
+print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
+print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
+print '<input type="hidden" name="action" value="list">';
+print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
+print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
+
+print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies', 0, '', '', $limit);
+
+if ($sall)
+{
+    foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
+    print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+}
+
+$moreforfilter = '';
+$moreforfilter.='<div class="divsearchfield">';
+$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
+$moreforfilter.= '</div>';
+
+$parameters=array();
+$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters);    // Note that $action and $object may have been modified by hook
+if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
+else $moreforfilter = $hookmanager->resPrint;
+
+if (! empty($moreforfilter))
+{
+	print '<div class="liste_titre liste_titre_bydiv centpercent">';
+	print $moreforfilter;
+    print '</div>';
+}
+
+$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
+$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);	// This also change content of $arrayfields
+
+print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
+
+// Fields title
+print '<tr class="liste_titre">';
+// LIST_OF_TD_TITLE_FIELDS
+//if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
+//if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+   foreach($extrafields->attribute_label as $key => $val) 
+   {
+       if (! empty($arrayfields["ef.".$key]['checked'])) 
+       {
+			$align=$extrafields->getAlignFlag($key);
+			print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
+       }
+   }
+}
+// Hook fields
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters);    // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+if (! empty($arrayfields['t.datec']['checked']))  print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+if (! empty($arrayfields['t.tms']['checked']))    print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
+//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
+print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
+print '</tr>'."\n";
+
+// Fields title search
+print '<tr class="liste_titre">';
+// LIST_OF_TD_TITLE_SEARCH
+//if (! empty($arrayfields['t.field1']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
+//if (! empty($arrayfields['t.field2']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
+// Extra fields
+if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+{
+    foreach($extrafields->attribute_label as $key => $val) 
     {
-        foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
-        print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
+        if (! empty($arrayfields["ef.".$key]['checked']))
+        {
+            $align=$extrafields->getAlignFlag($key);
+            $typeofextrafield=$extrafields->attribute_type[$key];
+            print '<td class="liste_titre'.($align?' '.$align:'').'">';
+        	if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')))
+			{
+			    $crit=$val;
+				$tmpkey=preg_replace('/search_options_/','',$key);
+				$searchclass='';
+				if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
+				if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
+				print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
+			}
+            print '</td>';
+        }
     }
+}
+// Fields from hook
+$parameters=array('arrayfields'=>$arrayfields);
+$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters);    // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
+if (! empty($arrayfields['t.datec']['checked']))
+{
+    // Date creation
+    print '<td class="liste_titre">';
+    print '</td>';
+}
+if (! empty($arrayfields['t.tms']['checked']))
+{
+    // Date modification
+    print '<td class="liste_titre">';
+    print '</td>';
+}
+/*if (! empty($arrayfields['u.statut']['checked']))
+{
+    // Status
+    print '<td class="liste_titre" align="center">';
+    print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
+    print '</td>';
+}*/
+// Action column
+print '<td class="liste_titre" align="right">';
+$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
+print $searchpitco;
+print '</td>';
+print '</tr>'."\n";
     
-    $moreforfilter = '';
-    $moreforfilter.='<div class="divsearchfield">';
-    $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escpae_htmltag($search_myfield).'">';
-    $moreforfilter.= '</div>';
-    
-    $parameters=array();
-    $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters);    // Note that $action and $object may have been modified by hook
-    if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
-    else $moreforfilter = $hookmanager->resPrint;
-    
-	if (! empty($moreforfilter))
-	{
-		print '<div class="liste_titre liste_titre_bydiv centpercent">';
-		print $moreforfilter;
-	    print '</div>';
-	}
 
-    $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
-    $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);	// This also change content of $arrayfields
-	
-	print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
-
-    // Fields title
-    print '<tr class="liste_titre">';
-    // LIST_OF_TD_TITLE_FIELDS
-    //if (! empty($arrayfields['t.field1']['checked'])) print_liste_field_titre($arrayfields['t.field1']['label'],$_SERVER['PHP_SELF'],'t.field1','',$params,'',$sortfield,$sortorder);
-    //if (! empty($arrayfields['t.field2']['checked'])) print_liste_field_titre($arrayfields['t.field2']['label'],$_SERVER['PHP_SELF'],'t.field2','',$params,'',$sortfield,$sortorder);
-	// Extra fields
-	if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
-	{
-	   foreach($extrafields->attribute_label as $key => $val) 
-	   {
-           if (! empty($arrayfields["ef.".$key]['checked'])) 
-           {
-				$align=$extrafields->getAlignFlag($key);
-				print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder);
-           }
-	   }
-	}
-    // Hook fields
-	$parameters=array('arrayfields'=>$arrayfields);
-    $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters);    // Note that $action and $object may have been modified by hook
-    print $hookmanager->resPrint;
-	if (! empty($arrayfields['t.datec']['checked']))  print_liste_field_titre($arrayfields['t.datec']['label'],$_SERVER["PHP_SELF"],"t.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
-	if (! empty($arrayfields['t.tms']['checked']))    print_liste_field_titre($arrayfields['t.tms']['label'],$_SERVER["PHP_SELF"],"t.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
-	//if (! empty($arrayfields['t.status']['checked'])) print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
-	print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch ');
-    print '</tr>'."\n";
-
-    // Fields title search
-	print '<tr class="liste_titre">';
-	// LIST_OF_TD_TITLE_SEARCH
-	//if (! empty($arrayfields['t.field1']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10"></td>';
-	//if (! empty($arrayfields['t.field2']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10"></td>';
-	// Extra fields
-	if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
-	{
-        foreach($extrafields->attribute_label as $key => $val) 
+$i=0;
+$var=true;
+$totalarray=array();
+while ($i < min($num, $limit))
+{
+    $obj = $db->fetch_object($resql);
+    if ($obj)
+    {
+        $var = !$var;
+        
+        // Show here line of result
+        print '<tr '.$bc[$var].'>';
+        // LIST_OF_TD_FIELDS_LIST
+        /*
+        if (! empty($arrayfields['t.field1']['checked'])) 
+        {
+            print '<td>'.$obj->field1.'</td>';
+		    if (! $i) $totalarray['nbfield']++;
+        }
+        if (! empty($arrayfields['t.field2']['checked'])) 
         {
-            if (! empty($arrayfields["ef.".$key]['checked']))
-            {
-                $align=$extrafields->getAlignFlag($key);
-                $typeofextrafield=$extrafields->attribute_type[$key];
-                print '<td class="liste_titre'.($align?' '.$align:'').'">';
-            	if (in_array($typeofextrafield, array('varchar', 'int', 'double', 'select')))
+            print '<td>'.$obj->field2.'</td>';
+		    if (! $i) $totalarray['nbfield']++;
+        }*/
+    	// Extra fields
+		if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+		{
+		   foreach($extrafields->attribute_label as $key => $val) 
+		   {
+				if (! empty($arrayfields["ef.".$key]['checked'])) 
 				{
-				    $crit=$val;
-    				$tmpkey=preg_replace('/search_options_/','',$key);
-    				$searchclass='';
-    				if (in_array($typeofextrafield, array('varchar', 'select'))) $searchclass='searchstring';
-    				if (in_array($typeofextrafield, array('int', 'double'))) $searchclass='searchnum';
-    				print '<input class="flat'.($searchclass?' '.$searchclass:'').'" size="4" type="text" name="search_options_'.$tmpkey.'" value="'.dol_escape_htmltag($search_array_options['search_options_'.$tmpkey]).'">';
+					print '<td';
+					$align=$extrafields->getAlignFlag($key);
+					if ($align) print ' align="'.$align.'"';
+					print '>';
+					$tmpkey='options_'.$key;
+					print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
+					print '</td>';
+		            if (! $i) $totalarray['nbfield']++;
 				}
-                print '</td>';
-            }
+		   }
+		}
+        // Fields from hook
+	    $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
+		$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters);    // Note that $action and $object may have been modified by hook
+        print $hookmanager->resPrint;
+    	// Date creation
+        if (! empty($arrayfields['t.datec']['checked']))
+        {
+            print '<td align="center">';
+            print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
+            print '</td>';
+		    if (! $i) $totalarray['nbfield']++;
         }
-	}
-    // Fields from hook
-	$parameters=array('arrayfields'=>$arrayfields);
-    $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters);    // Note that $action and $object may have been modified by hook
-    print $hookmanager->resPrint;
-    if (! empty($arrayfields['t.datec']['checked']))
-    {
-        // Date creation
-        print '<td class="liste_titre">';
-        print '</td>';
-    }
-    if (! empty($arrayfields['t.tms']['checked']))
-    {
         // Date modification
-        print '<td class="liste_titre">';
-        print '</td>';
-    }
-    /*if (! empty($arrayfields['u.statut']['checked']))
-    {
+        if (! empty($arrayfields['t.tms']['checked']))
+        {
+            print '<td align="center">';
+            print dol_print_date($db->jdate($obj->date_update), 'dayhour');
+            print '</td>';
+		    if (! $i) $totalarray['nbfield']++;
+        }
         // Status
-        print '<td class="liste_titre" align="center">';
-        print $form->selectarray('search_statut', array('-1'=>'','0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
-        print '</td>';
-    }*/
-    // Action column
-	print '<td class="liste_titre" align="right">';
-	$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
-    print $searchpitco;
-    print '</td>';
-	print '</tr>'."\n";
-        
-    
-	$i=0;
-	$var=true;
-	$totalarray=array();
-    while ($i < min($num, $limit))
-    {
-        $obj = $db->fetch_object($resql);
-        if ($obj)
+        /*
+        if (! empty($arrayfields['u.statut']['checked']))
+        {
+		  $userstatic->statut=$obj->statut;
+          print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
+        }*/
+
+        // Action column
+        print '<td class="nowrap" align="center">';
+	    if ($massactionbutton || $massaction)   // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
         {
-            $var = !$var;
-            
-            // Show here line of result
-            print '<tr '.$bc[$var].'>';
-            // LIST_OF_TD_FIELDS_LIST
-            /*
-            if (! empty($arrayfields['t.field1']['checked'])) 
-            {
-                print '<td>'.$obj->field1.'</td>';
-    		    if (! $i) $totalarray['nbfield']++;
-            }
-            if (! empty($arrayfields['t.field2']['checked'])) 
-            {
-                print '<td>'.$obj->field2.'</td>';
-    		    if (! $i) $totalarray['nbfield']++;
-            }*/
-        	// Extra fields
-    		if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
-    		{
-    		   foreach($extrafields->attribute_label as $key => $val) 
-    		   {
-    				if (! empty($arrayfields["ef.".$key]['checked'])) 
-    				{
-    					print '<td';
-    					$align=$extrafields->getAlignFlag($key);
-    					if ($align) print ' align="'.$align.'"';
-    					print '>';
-    					$tmpkey='options_'.$key;
-    					print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
-    					print '</td>';
-    		            if (! $i) $totalarray['nbfield']++;
-    				}
-    		   }
-    		}
-            // Fields from hook
-    	    $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
-    		$reshook=$hookmanager->executeHooks('printFieldListValue',$parameters);    // Note that $action and $object may have been modified by hook
-            print $hookmanager->resPrint;
-        	// Date creation
-            if (! empty($arrayfields['t.datec']['checked']))
-            {
-                print '<td align="center">';
-                print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
-                print '</td>';
-    		    if (! $i) $totalarray['nbfield']++;
-            }
-            // Date modification
-            if (! empty($arrayfields['t.tms']['checked']))
-            {
-                print '<td align="center">';
-                print dol_print_date($db->jdate($obj->date_update), 'dayhour');
-                print '</td>';
-    		    if (! $i) $totalarray['nbfield']++;
-            }
-            // Status
-            /*
-            if (! empty($arrayfields['u.statut']['checked']))
-            {
-    		  $userstatic->statut=$obj->statut;
-              print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
-            }*/
-
-            // Action column
-	        print '<td class="nowrap" align="center">';
-    	    if ($massactionbutton || $massaction)   // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
-	        {
-    	        $selected=0;
-    			if (in_array($obj->rowid, $arrayofselected)) $selected=1;
-    			print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
-	        }
-    	    print '</td>';
-            if (! $i) $totalarray['nbfield']++;
-
-            print '</tr>';
+	        $selected=0;
+			if (in_array($obj->rowid, $arrayofselected)) $selected=1;
+			print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
         }
+	    print '</td>';
+        if (! $i) $totalarray['nbfield']++;
+
+        print '</tr>';
+    }
+    $i++;
+}
+
+// Show total line
+if (isset($totalarray['totalhtfield']))
+{
+    print '<tr class="liste_total">';
+    $i=0;
+    while ($i < $totalarray['nbfield'])
+    {
         $i++;
+        if ($i == 1)
+        {
+            if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
+            else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
+        }
+        elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
+        elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
+        elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
+        else print '<td></td>';
     }
-    
-	// Show total line
-	if (isset($totalarray['totalhtfield']))
-	{
-	    print '<tr class="liste_total">';
-	    $i=0;
-	    while ($i < $totalarray['nbfield'])
-	    {
-	        $i++;
-	        if ($i == 1)
-	        {
-	            if ($num < $limit) print '<td align="left">'.$langs->trans("Total").'</td>';
-	            else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
-	        }
-	        elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
-	        elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
-	        elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
-	        else print '<td></td>';
-	    }
-	    print '</tr>';
-	}
-    
-	$db->free($resql);
+    print '</tr>';
+}
 
-	$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
-	$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters);    // Note that $action and $object may have been modified by hook
-	print $hookmanager->resPrint;
+$db->free($resql);
 
-	print '</table>'."\n";
+$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
+$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters);    // Note that $action and $object may have been modified by hook
+print $hookmanager->resPrint;
 
-	print '</form>'."\n";
-	
-	
-	if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
-	{
-	    // Show list of available documents
-	    $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
-	    $urlsource.=str_replace('&amp;','&',$param);
-	
-	    $filedir=$diroutputmassaction;
-	    $genallowed=$user->rights->facture->lire;
-	    $delallowed=$user->rights->facture->lire;
-	
-	    print '<br><a name="show_files"></a>';
-	    $paramwithoutshowfiles=preg_replace('/show_files=1&?/','',$param);
-	    $title=$langs->trans("MassFilesArea").' <a href="'.$_SERVER["PHP_SELF"].'?'.$paramwithoutshowfiles.'">('.$langs->trans("Hide").')</a>';
-	
-	    print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
-	}
-	else
-	{
-	    print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
-	}
-	
+print '</table>'."\n";
+
+print '</form>'."\n";
+
+
+if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
+{
+    // Show list of available documents
+    $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
+    $urlsource.=str_replace('&amp;','&',$param);
+
+    $filedir=$diroutputmassaction;
+    $genallowed=$user->rights->facture->lire;
+    $delallowed=$user->rights->facture->lire;
+
+    print $formfile->showdocuments('massfilesarea_mymodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
 }
 else
 {
-    $error++;
-    dol_print_error($db);
+    print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
 }
 
 

+ 0 - 0
dev/detectnotabfiles.sh → dev/tools/detectnotabfiles.sh


+ 0 - 0
dev/fixaltlanguages.sh → dev/tools/fixaltlanguages.sh


+ 0 - 0
dev/fixdosfiles.sh → dev/tools/fixdosfiles.sh


+ 1 - 0
dev/fixduplicatelangkey.sh → dev/tools/fixduplicatelangkey.sh

@@ -14,6 +14,7 @@ fi
 
 if [ "x$1" = "xlist" ]
 then
+	echo "Search duplicate keys into en_US lang files (there is no cross file check)"
 	for file in `find htdocs/langs/en_US -name *.lang -type f`
 	do
 	    dupes=$(

+ 2 - 0
dev/fixduplicatelines.sh → dev/tools/fixduplicatelanglines.sh

@@ -16,6 +16,7 @@ fi
 # To detect
 if [ "x$1" = "xlist" ]
 then
+	echo "Search duplicate line for lang en_US"
     for file in `find htdocs/langs/en_US -type f -name *.lang`
     do
         if [ `sort "$file" | grep -v '^$' | uniq -d | wc -l` -gt 0 ]
@@ -29,6 +30,7 @@ fi
 # To fix
 if [ "x$1" = "xfix" ]
 then
+	echo "Fix duplicate line for lang en_US"
     for file in `find htdocs/langs/en_US -type f -name *.lang`
     do
     	awk -i inplace ' !x[$0]++' "$file"

+ 0 - 0
dev/fixperms.sh → dev/tools/fixperms.sh


+ 0 - 0
dev/fixutf8bomfiles.sh → dev/tools/fixutf8bomfiles.sh


+ 0 - 0
dev/optimize_images.sh → dev/tools/optimize_images.sh


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