diff --git a/.travis.yml b/.travis.yml
index 17c25da09b8..96a238e6ad4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,7 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
-# We use dist: trusty to have php 5.4+ available
+# We use dist: trusty to have php 5.4+ available
dist: trusty
sudo: required
@@ -20,7 +20,7 @@ addons:
# To use the last version of pgloader, we add repo of postgresql
- postgresql
- sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main'
- - key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
+ - key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
packages:
# We need a webserver to test the webservices
# Let's install Apache with.
@@ -105,7 +105,7 @@ before_install:
pgloader --version
echo
fi
-
+
install:
- |
echo "Updating Composer"
@@ -137,7 +137,7 @@ install:
- |
echo "Installing PHP CodeSniffer"
- composer -n require squizlabs/php_codesniffer ^2
+ composer -n require squizlabs/php_codesniffer ^3
echo
- |
@@ -199,7 +199,7 @@ before_script:
mysql --version | head -
mysql -e "SELECT VERSION();" | head -
echo
-
+
- |
echo "Setting up database"
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ] || [ "$DB" = 'postgresql' ]; then
@@ -207,12 +207,11 @@ before_script:
mysql -e 'DROP DATABASE IF EXISTS travis;'
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
mysql -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
- mysql -e 'FLUSH PRIVILEGES;'
+ mysql -e 'FLUSH PRIVILEGES;'
mysql -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
fi
if [ "$DB" = 'postgresql' ]; then
- #pgsql travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
- #pgloader mysql://root:pass@127.0.0.1/base postgresql://dolibarrowner@127.0.0.1/dolibarr
+ #pgloader mysql://root:pass@127.0.0.1/dolibarr_35 postgresql://dolibarrowner:dolibarrownerpass@127.0.0.1/dolibarr_dev
pgloader mysql://root@127.0.0.1/travis postgresql:///travis
fi
# TODO: SQLite
@@ -221,7 +220,7 @@ before_script:
- |
export CONF_FILE=htdocs/conf/conf.php
echo "Setting up Dolibarr $CONF_FILE"
- echo ' $CONF_FILE
+ echo ' $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
@@ -242,8 +241,9 @@ before_script:
- |
echo "Create documents directory and set permissions"
# and admin/temp subdirectory needed for unit tests
- mkdir -p documents/admin/temp
- echo "first line" > documents/dolibarr.log
+ mkdir -p $TRAVIS_BUILD_DIR/documents/admin/temp
+ sudo chmod -R a+rwx $TRAVIS_BUILD_DIR/documents
+ echo "***** First line of dolibarr.log" > $TRAVIS_BUILD_DIR/documents/dolibarr.log
echo
@@ -338,33 +338,28 @@ script:
php upgrade.php 7.0.0 8.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade700800.log
php upgrade2.php 7.0.0 8.0.0 MAIN_MODULE_TICKETSUP > $TRAVIS_BUILD_DIR/upgrade700800-2.log
php step5.php 7.0.0 8.0.0 > $TRAVIS_BUILD_DIR/upgrade700800-3.log
+ php upgrade.php 8.0.0 9.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade800900.log
+ php upgrade2.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-2.log
+ php step5.php 8.0.0 9.0.0 > $TRAVIS_BUILD_DIR/upgrade800900-3.log
cd -
set +e
echo
- #cat $TRAVIS_BUILD_DIR/upgrade400500-2.log
- #cat $TRAVIS_BUILD_DIR/upgrade500600.log
- #cat $TRAVIS_BUILD_DIR/upgrade500600-2.log
- #cat $TRAVIS_BUILD_DIR/upgrade500600-3.log
- #cat $TRAVIS_BUILD_DIR/upgrade600700-2.log
- cat /tmp/dolibarr_install.log
-
+ #cat /tmp/dolibarr_install.log
+
- |
echo "Unit testing"
# Ensure we catch errors. Set this to +e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
+ phpunitresult=$?
+ echo "Phpunit return code = $phpunitresult"
set +e
-- |
- #echo "Output dolibarr.log"
- #cat documents/dolibarr.log
-
after_script:
- |
- # Dolibarr log file
- #echo "After script"
- #cat documents/dolibarr.log
-
+ echo "After script - Output 50 latest lines of dolibarr.log"
+ ls $TRAVIS_BUILD_DIR/documents
+ tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
after_success:
- |
@@ -372,20 +367,24 @@ after_success:
after_failure:
- |
- echo Failure
- # This part of code seems to be never executed, error or not ???
- echo "Debugging informations"
+ echo Failure detected, so we show samples of log to help diagnose
+ # This part of code is executed only if previous commande that fails are enclosed with set +e
# Upgrade log files
- cat *.log
- echo "Debugging informations"
+ for ficlog in `ls $TRAVIS_BUILD_DIR/*.log`
+ do
+ echo "Debugging informations for file $ficlog"
+ #cat $ficlog
+ done
# Apache log file
+ echo "Debugging informations for file apache error.log"
sudo cat /var/log/apache2/error.log
- # Dolibarr log file
- cat documents/dolibarr.log
if [ "$DEBUG" = true ]; then
+ # Dolibarr log file
+ echo "Debugging informations for file dolibarr.log (latest 50 lines)"
+ tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
# MariaDB log file
- sudo cat /var/log/mysql/error.log
+ echo "Debugging informations for file mysql error.log"
+ sudo tail -n 50 /var/log/mysql/error.log
# TODO: PostgreSQL log file
echo
fi
-
diff --git a/COPYRIGHT b/COPYRIGHT
index bd3565c3bd1..83f72bb558b 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -53,6 +53,10 @@ JsTimezoneDetect 1.0.6 MIT License Yes
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer
Ace 1.2.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
+Image libraries
+Octicons 8.1 MIT Yes
+
+
For licenses compatibility informations:
http://www.gnu.org/licenses/licenses.en.html
diff --git a/ChangeLog b/ChangeLog
index a31b7e0ddfd..f61d3a4820d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,31 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
+***** ChangeLog for 9.0.0 compared to 8.0.0 *****
+For Users:
+NEW: Stable module: Website
+NEW: Stable module: WebDAV
+NEW: Stable module: Module Builder
+NEW: Stable module "Skype" has been replaced with module "Social Networks" to support more tools.
+NEW: Experimental module "TakePos"
+NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
+ Android application like DoliDroid able to provide native features for multicompany module.
+NEW: Compatibility with PHP 7.3
+
+
+For developers:
+* Code changes to be more compatible with PSR2
+* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
+
+WARNING:
+
+Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
+ replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
+ modulepart=mycompany that now works like others).
+
+
+
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
FIX: #8452
FIX: #9043
@@ -70,18 +95,17 @@ FIX: Table llx_facture_rec_extrafields missing after migration
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
-
For Users:
NEW: Experimental module: Ticket
NEW: Experimental module: WebDAV
-NEW: Accept anonmymous events (no user assigned)
+NEW: Accept anonymous events (no user assigned)
NEW: Accountancy - Add import on general ledger
NEW: Accountancy - Show journal name on journal page and hide button draft export (Add an option in admin)
-NEW: Can create event from record card of a company and member
-NEW: Add a button to create Stripe customer from the Payment mode tab
+NEW: Can create event from record card of a company and/or member
+NEW: Add a button to create Stripe customer from the customer Payment mode tab
NEW: Add accounting account number on product tooltip
-NEW: add any predefined mail content
-NEW: Add arrows to navigate into containers in website module
+NEW: Add any predefined mail content
+NEW: Add arrows to navigate into containers in experimental website module
NEW: Add a tab to specify accountant/auditor of the company
NEW: Add Date delivery and Availability on Propals List
NEW: Add date in goods reception supplier order table
@@ -168,7 +192,7 @@ NEW: Filter export model is now by user
NEW: Finish implementation of option PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES
NEW: generalize use of button to create new element from list
NEW: hidden conf AGENDA_NB_WEEKS_IN_VIEW_PER_USER to set nb weeks to show into per user view
-NEW: hidden conf to assign category to thirparty that are not customer nor prospect nor supplier
+NEW: hidden conf to assign category to thirparty that are neither customer nor prospect or supplier
NEW: hidden conf to set nb weeks to show into user view
NEW: hidden option MAIN_DISABLE_FREE_LINES
NEW: improve way of adding users/sales representative to thirdparty
diff --git a/README-FR.md b/README-FR.md
index a9745bb8dbb..19d4ae25df9 100644
--- a/README-FR.md
+++ b/README-FR.md
@@ -16,8 +16,8 @@ Dolibarr est distribué sous les termes de la licence GNU General Public License
## INSTALLER DOLIBARR
Si vous n'avez pas de connaissances techniques, et que vous recherchez
-un programme d'installation qui install Dolibarr ERP/CRM en quelques clics,
-vous devez vous réorienter vers DoliWamp (la version tout-en-un
+un programme d'installation qui installe Dolibarr ERP/CRM en quelques clics,
+vous devez vous ré-orienter vers DoliWamp (la version tout-en-un
de Dolibarr pour Windows), DoliDeb (la version tout-en-un pour Debian ou
Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
OpenSuse, Mandriva ou Mageia).
@@ -25,39 +25,39 @@ OpenSuse, Mandriva ou Mageia).
Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
https://www.dolibarr.org/
-Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (MariaDb/MySql/PostgreSql),
+Si vous avez déjà installé un serveur Web avec PHP et une base de données (MariaDb/MySql/PostgreSql),
vous pouvez installer Dolibarr avec cette version de la manière suivante:
-- Copier le répertoire "dolibarr" et son contenu dans la racine de votre serveur
- web, ou bien copier le répertoire sur le serveur et configurer ce serveur pour
+- Copiez le répertoire "dolibarr" et son contenu dans la racine de votre serveur
+ web, ou bien copiez le répertoire sur le serveur et configurez ce serveur pour
utiliser "dolibarr/htdocs" comme racine d'un nouveau virtual host (ce second
choix requiert des compétences et habilitations en administration du serveur
web).
-- Créer un fichier vide "htdocs/conf/conf.php" et attribuer les permissions
+- Créez un fichier vide "htdocs/conf/conf.php" et attribuez les permissions
en lecture et écriture pour le user du serveur web (les permissions en
écriture seront supprimées une fois l'installation terminée).
-- Depuis votre navigateur, appeler la page "install/" de dolibarr. L'url dépend
- du choix fait à la première etape:
+- Depuis votre navigateur, appelez la page "install/" de dolibarr. L'url dépend
+ du choix fait à la première étape:
http://localhost/dolibarr/htdocs/install/
ou
http://yourdolibarrvirtualhost/install/
-- Suivez les instructions fournies par l'installeur...
+- Suivez les instructions fournies par l'installateur...
## METTRE A JOUR DOLIBARR
-Pour mettre a jour Dolibarr depuis une vieille version vers celle ci:
-- Ecraser les vieux fichiers dans le vieux repertoire 'dolibarr' par les fichiers
+Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
+- Ecrasez les vieux fichiers dans le vieux répertoire 'dolibarr' par les fichiers
fournis dans ce nouveau package.
-- Au prochain accès, Dolibarr proposera la page de "mise a jour" des données (si necessaire).
- Si un fichier install.lock existe pour vérouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transféré sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
-
-*Note: Le processus de migration peut etre lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
+- Au prochain accès, Dolibarr proposera la page de "mise à jour" des données (si nécessaire).
+ Si un fichier install.lock existe pour verrouiller le processus de mise à jour, il sera demandé de le supprimer manuellement (vous devriez trouver le fichier install.lock dans le répertoire utilisé pour stocker les documents générés ou transférés sur le serveur. Dans la plupart des cas, c'est le répertoire appelé "documents")
+
+*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
## CE QUI EST NOUVEAU
@@ -94,14 +94,15 @@ Voir fichier ChangeLog.
- Gestion de marque-pages
- Gestion des promesses de dons
-- Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
- Rapports
- Imports/Exports des données
+- Support des codes barres
+- Calcul des marges
- Connectivité LDAP
- Intégratn de ClickToDial
- Intégration RSS
- Intégation Skype
-- Intégration de système de paiements (Paypal, Strip, Paybox...)
+- Intégration de système de paiements (Paypal, Stripe, Paybox...)
- …
### Divers:
@@ -114,9 +115,18 @@ Voir fichier ChangeLog.
- Application simple à utiliser.
- Requiert PHP et MariaDb, Mysql ou Postgresql (Voir versions exactes sur https://wiki.dolibarr.org/index.php/Prérequis).
- Compatible avec toutes les offres Cloud du marché respectant les prérequis de base de données et PHP.
-- Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers).
- APIs.
- Génération PDF et ODT des éléments (factures, propositions commerciales, commandes, bons expéditions, etc...)
+- Code simple et facilement personnalisable (pas de framework lourd; mécanisme de hook et triggers).
+- Support natif de nombreuses fonctions spécifiques aux pays comme:
+ - La tax espagnole TE et ISPF
+ - Gestion de la TVA NPR (non perçue récupérable - pour les utilisateurs français des DOM-TOM)
+ - La loi française Finance 2016 et logiciels de caisse
+ - La double taxe canadienne
+ - Le timbre fiscal tunisien
+ - Numérotation de facture de l'argentines (avec type A,B,C...)
+ - Compatible avec vos processus RGPD
+ - ...
- …
### Extension
@@ -126,7 +136,7 @@ Dolibarr peut aussi être étendu à volonté avec l'ajout de module/application
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
-Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
+Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
- Dolibarr ne contient pas de module de Gestion de la paie.
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
- Dolibarr n'embarque pas de Webmail intégré nativement.
@@ -135,7 +145,7 @@ Voici un liste de fonctionnalites pas encore gérées par Dolibarr:
## DOCUMENTATION
-Les documentations utilisateur, développeur et traducteur sont disponible sous forme de ressources de la communautés via la site [Wiki](https://wiki.dolibarr.org).
+La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
## CONTRIBUER
diff --git a/README.md b/README.md
index 5feec47e56f..c38d0ca7dd1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,11 @@
# DOLIBARR ERP & CRM
- 
+
+[](https://houndci.com)
+
+|6|7|8|develop|
+|----------|----------|----------|----------|
+|||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
@@ -125,7 +130,6 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Donations management
- Reporting
- Data export/import
-- Thirdparties and/or products categories
- Barcodes support
- Margin calculations
- LDAP connectivity
@@ -147,13 +151,15 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with all Cloud solutions that match MySQL, PHP or PostgreSQL prerequisites.
- APIs.
- An easy to understand, maintain and develop code (PHP with no heavy framework; trigger and hook architecture)
-- Support for country specific features:
+- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
- Canadian double taxes (federal/province) and other countries using cumulative VAT
- Tunisian tax stamp
- Argentina invoice numbering using A,B,C...
- Compatible with [European directives](http://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
+ - Compatible with European GDPR rules
+ - ...
- PDF or ODT generation for invoice, proposals, orders...
- …
diff --git a/build/aps/APP-META-1.1.xml b/build/aps/APP-META-1.1.xml
deleted file mode 100644
index 1394da4d4be..00000000000
--- a/build/aps/APP-META-1.1.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
This document is addressed to independent software -vendors who plan to distribute web applications among the Panel users. -The aim of the document is to help vendors find out whether they can -package their applications to APS to make them available through the -Panel.
-The document does not contain information about -Application Packaging Standard itself or give application packaging -instructions. It focuses on how the Panel implements APS and what APS -packages are not supported by this implementation.
- -Application Packaging Standard (APS) - is a set of rules that defines a web application packaging format. This - standard is designed to ease the integration of applications in a -service provider's infrastructure. It covers provisioning, management, -and integration of cloud-based services and applications.
-The Panel uses APS to offer third-party applications to hosting customers. These applications are presented in APS catalog, where the customers can buy or download them.
-Currently, the Panel does not support all aspects of - APS. Therefore, customers may have problems trying to install certain -applications. To find out whether your application is compatible with -the Panel, see section Plesk Panel Restrictions.
-You can find more information about APS at http://www.apsstandard.org/.
-APS specification and supporting documents are available at http://www.apsstandard.org/isv/documentation/.
- -The current Panel version has restrictions on APS -applications processing. If an application requires performing -restricted actions, the Panel will not install it. Particularly, these -actions are the following:
-See Mail aspect of APS in APS Format Specification v1.2, section 8.8. Mail at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.mail
-See DNS aspect in APS Format Specification v1.2, section 8.10. DNS Zone at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.dns
-See DLL aspect in APS Format Specification v1.2, section 8.11. DLL Content Processing Method at http://www.apsstandard.org/r/doc/package-format-specification-1.2/index.html#s.aspects.dll
-If - you need you application to perform these actions, consider other ways -of integration with the Panel: API RPC, modules or Panel Notifications.
-Also, the Panel does not support the following actions defined in the application package:
-Parallels Holdings, Ltd.
-c/o Parallels International GmbH
-Vordergasse 59
-CH-Schaffhausen
-Switzerland
-Phone: +41-526320-411
-Fax: +41-52672-2010
--
Copyright © 1999-2011 Parallels Holdings, Ltd. and its affiliates. All rights reserved.
--
This product is protected by United States and -international copyright laws. The product's underlying technology, -patents, and trademarks are listed at -http://www.parallels.com/trademarks.
--
Microsoft, Windows, Windows Server, Windows NT, Windows Vista, and MS-DOS are registered trademarks of Microsoft Corporation.
-Linux is a registered trademark of Linus Torvalds.
-Mac is a registered trademark of Apple, Inc.
-All other marks and names mentioned herein may be trademarks of their respective owners.
- - - - - - - - -- * Usage:
} and {@code } tags in your source with
- * {@code class=prettyprint.}
- * You can also use the (html deprecated) {@code } tag, but the pretty
- * printer needs to do more substantial DOM manipulations to support that, so
- * some css styles may not be preserved.
- * } or {@code } element to specify the
- * language, as in {@code }. Any class that
- * starts with "lang-" followed by a file extension, specifies the file type.
- * See the "lang-*.js" files in this directory for code that implements
- * per-language file handlers.
- *
- * Change log:
- * cbeust, 2006/08/22
- *
- * Java annotations (start with "@") are now captured as literals ("lit")
- *
- * @requires console
- */
-
-// JSLint declarations
-/*global console, document, navigator, setTimeout, window */
-
-/**
- * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
- * UI events.
- * If set to {@code false}, {@code prettyPrint()} is synchronous.
- */
-window['PR_SHOULD_USE_CONTINUATION'] = true;
-
-/** the number of characters between tab columns */
-window['PR_TAB_WIDTH'] = 8;
-
-/** Walks the DOM returning a properly escaped version of innerHTML.
- * @param {Node} node
- * @param {Array.} out output buffer that receives chunks of HTML.
- */
-window['PR_normalizedHtml']
-
-/** Contains functions for creating and registering new language handlers.
- * @type {Object}
- */
- = window['PR']
-
-/** Pretty print a chunk of code.
- *
- * @param {string} sourceCodeHtml code as html
- * @return {string} code as html, but prettier
- */
- = window['prettyPrintOne']
-/** Find all the {@code } and {@code } tags in the DOM with
- * {@code class=prettyprint} and prettify them.
- * @param {Function?} opt_whenDone if specified, called when the last entry
- * has been finished.
- */
- = window['prettyPrint'] = void 0;
-
-/** browser detection. @extern @returns false if not IE, otherwise the major version. */
-window['_pr_isIE6'] = function () {
- var ieVersion = navigator && navigator.userAgent &&
- navigator.userAgent.match(/\bMSIE ([678])\./);
- ieVersion = ieVersion ? +ieVersion[1] : false;
- window['_pr_isIE6'] = function () { return ieVersion; };
- return ieVersion;
-};
-
-
-(function () {
- // Keyword lists for various languages.
- var FLOW_CONTROL_KEYWORDS =
- "break continue do else for if return while ";
- var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +
- "double enum extern float goto int long register short signed sizeof " +
- "static struct switch typedef union unsigned void volatile ";
- var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +
- "new operator private protected public this throw true try typeof ";
- var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +
- "concept concept_map const_cast constexpr decltype " +
- "dynamic_cast explicit export friend inline late_check " +
- "mutable namespace nullptr reinterpret_cast static_assert static_cast " +
- "template typeid typename using virtual wchar_t where ";
- var JAVA_KEYWORDS = COMMON_KEYWORDS +
- "abstract boolean byte extends final finally implements import " +
- "instanceof null native package strictfp super synchronized throws " +
- "transient ";
- var CSHARP_KEYWORDS = JAVA_KEYWORDS +
- "as base by checked decimal delegate descending event " +
- "fixed foreach from group implicit in interface internal into is lock " +
- "object out override orderby params partial readonly ref sbyte sealed " +
- "stackalloc string select uint ulong unchecked unsafe ushort var ";
- var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +
- "debugger eval export function get null set undefined var with " +
- "Infinity NaN ";
- var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +
- "goto if import last local my next no our print package redo require " +
- "sub undef unless until use wantarray while BEGIN END ";
- var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +
- "elif except exec finally from global import in is lambda " +
- "nonlocal not or pass print raise try with yield " +
- "False True None ";
- var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +
- " defined elsif end ensure false in module next nil not or redo rescue " +
- "retry self super then true undef unless until when yield BEGIN END ";
- var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +
- "function in local set then until ";
- var ALL_KEYWORDS = (
- CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +
- PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);
-
- // token style names. correspond to css classes
- /** token style for PHP variables */
- var PR_VAR = 'vr';
- /** token style for a string literal */
- var PR_STRING = 'str';
- /** token style for a keyword */
- var PR_KEYWORD = 'kwd';
- /** token style for a comment */
- var PR_COMMENT = 'com';
- /** token style for a type */
- var PR_TYPE = 'typ';
- /** token style for a literal value. e.g. 1, null, true. */
- var PR_LITERAL = 'lit';
- /** token style for a punctuation string. */
- var PR_PUNCTUATION = 'pun';
- /** token style for a punctuation string. */
- var PR_PLAIN = 'pln';
-
- /** token style for an sgml tag. */
- var PR_TAG = 'tag';
- /** token style for a markup declaration such as a DOCTYPE. */
- var PR_DECLARATION = 'dec';
- /** token style for embedded source. */
- var PR_SOURCE = 'src';
- /** token style for an sgml attribute name. */
- var PR_ATTRIB_NAME = 'atn';
- /** token style for an sgml attribute value. */
- var PR_ATTRIB_VALUE = 'atv';
-
- /**
- * A class that indicates a section of markup that is not code, e.g. to allow
- * embedding of line numbers within code listings.
- */
- var PR_NOCODE = 'nocode';
-
- /** A set of tokens that can precede a regular expression literal in
- * javascript.
- * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full
- * list, but I've removed ones that might be problematic when seen in
- * languages that don't support regular expression literals.
- *
- * Specifically, I've removed any keywords that can't precede a regexp
- * literal in a syntactically legal javascript program, and I've removed the
- * "in" keyword since it's not a keyword in many languages, and might be used
- * as a count of inches.
- *
- *
The link a above does not accurately describe EcmaScript rules since
- * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
- * very well in practice.
- *
- * @private
- */
- var REGEXP_PRECEDER_PATTERN = function () {
- var preceders = [
- "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=",
- "&=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",
- "->", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",
- "<", "<<", "<<=", "<=", "=", "==", "===", ">",
- ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[",
- "^", "^=", "^^", "^^=", "{", "|", "|=", "||",
- "||=", "~" /* handles =~ and !~ */,
- "break", "case", "continue", "delete",
- "do", "else", "finally", "instanceof",
- "return", "throw", "try", "typeof"
- ];
- var pattern = '(?:^^|[+-]';
- for (var i = 0; i < preceders.length; ++i) {
- pattern += '|' + preceders[i].replace(/([^=<>:&a-z])/g, '\\$1');
- }
- pattern += ')\\s*'; // matches at end, and matches empty string
- return pattern;
- // CAVEAT: this does not properly handle the case where a regular
- // expression immediately follows another since a regular expression may
- // have flags for case-sensitivity and the like. Having regexp tokens
- // adjacent is not valid in any language I'm aware of, so I'm punting.
- // TODO: maybe style special characters inside a regexp as punctuation.
- }();
-
- // Define regexps here so that the interpreter doesn't have to create an
- // object each time the function containing them is called.
- // The language spec requires a new object created even if you don't access
- // the $1 members.
- var pr_amp = /&/g;
- var pr_lt = //g;
- var pr_quot = /\"/g;
- /** like textToHtml but escapes double quotes to be attribute safe. */
- function attribToHtml(str) {
- return str.replace(pr_amp, '&')
- .replace(pr_lt, '<')
- .replace(pr_gt, '>')
- .replace(pr_quot, '"');
- }
-
- /** escapest html special characters to html. */
- function textToHtml(str) {
- return str.replace(pr_amp, '&')
- .replace(pr_lt, '<')
- .replace(pr_gt, '>');
- }
-
-
- var pr_ltEnt = /</g;
- var pr_gtEnt = />/g;
- var pr_aposEnt = /'/g;
- var pr_quotEnt = /"/g;
- var pr_ampEnt = /&/g;
- var pr_nbspEnt = / /g;
- /** unescapes html to plain text. */
- function htmlToText(html) {
- var pos = html.indexOf('&');
- if (pos < 0) { return html; }
- // Handle numeric entities specially. We can't use functional substitution
- // since that doesn't work in older versions of Safari.
- // These should be rare since most browsers convert them to normal chars.
- for (--pos; (pos = html.indexOf('', pos + 1)) >= 0;) {
- var end = html.indexOf(';', pos);
- if (end >= 0) {
- var num = html.substring(pos + 3, end);
- var radix = 10;
- if (num && num.charAt(0) === 'x') {
- num = num.substring(1);
- radix = 16;
- }
- var codePoint = parseInt(num, radix);
- if (!isNaN(codePoint)) {
- html = (html.substring(0, pos) + String.fromCharCode(codePoint) +
- html.substring(end + 1));
- }
- }
- }
-
- return html.replace(pr_ltEnt, '<')
- .replace(pr_gtEnt, '>')
- .replace(pr_aposEnt, "'")
- .replace(pr_quotEnt, '"')
- .replace(pr_nbspEnt, ' ')
- .replace(pr_ampEnt, '&');
- }
-
- /** is the given node's innerHTML normally unescaped? */
- function isRawContent(node) {
- return 'XMP' === node.tagName;
- }
-
- var newlineRe = /[\r\n]/g;
- /**
- * Are newlines and adjacent spaces significant in the given node's innerHTML?
- */
- function isPreformatted(node, content) {
- // PRE means preformatted, and is a very common case, so don't create
- // unnecessary computed style objects.
- if ('PRE' === node.tagName) { return true; }
- if (!newlineRe.test(content)) { return true; } // Don't care
- var whitespace = '';
- // For disconnected nodes, IE has no currentStyle.
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- // Firefox makes a best guess if node is disconnected whereas Safari
- // returns the empty string.
- whitespace = window.getComputedStyle(node, null).whiteSpace;
- }
- return !whitespace || whitespace === 'pre';
- }
-
- function normalizedHtml(node, out, opt_sortAttrs) {
- switch (node.nodeType) {
- case 1: // an element
- var name = node.tagName.toLowerCase();
-
- out.push('<', name);
- var attrs = node.attributes;
- var n = attrs.length;
- if (n) {
- if (opt_sortAttrs) {
- var sortedAttrs = [];
- for (var i = n; --i >= 0;) { sortedAttrs[i] = attrs[i]; }
- sortedAttrs.sort(function (a, b) {
- return (a.name < b.name) ? -1 : a.name === b.name ? 0 : 1;
- });
- attrs = sortedAttrs;
- }
- for (var i = 0; i < n; ++i) {
- var attr = attrs[i];
- if (!attr.specified) { continue; }
- out.push(' ', attr.name.toLowerCase(),
- '="', attribToHtml(attr.value), '"');
- }
- }
- out.push('>');
- for (var child = node.firstChild; child; child = child.nextSibling) {
- normalizedHtml(child, out, opt_sortAttrs);
- }
- if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {
- out.push('<\/', name, '>');
- }
- break;
- case 3: case 4: // text
- out.push(textToHtml(node.nodeValue));
- break;
- }
- }
-
- /**
- * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
- * matches the union o the sets o strings matched d by the input RegExp.
- * Since it matches globally, if the input strings have a start-of-input
- * anchor (/^.../), it is ignored for the purposes of unioning.
- * @param {Array.} regexs non multiline, non-global regexs.
- * @return {RegExp} a global regex.
- */
- function combinePrefixPatterns(regexs) {
- var capturedGroupIndex = 0;
-
- var needToFoldCase = false;
- var ignoreCase = false;
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.ignoreCase) {
- ignoreCase = true;
- } else if (/[a-z]/i.test(regex.source.replace(
- /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
- needToFoldCase = true;
- ignoreCase = false;
- break;
- }
- }
-
- function decodeEscape(charsetPart) {
- if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }
- switch (charsetPart.charAt(1)) {
- case 'b': return 8;
- case 't': return 9;
- case 'n': return 0xa;
- case 'v': return 0xb;
- case 'f': return 0xc;
- case 'r': return 0xd;
- case 'u': case 'x':
- return parseInt(charsetPart.substring(2), 16)
- || charsetPart.charCodeAt(1);
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7':
- return parseInt(charsetPart.substring(1), 8);
- default: return charsetPart.charCodeAt(1);
- }
- }
-
- function encodeEscape(charCode) {
- if (charCode < 0x20) {
- return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
- }
- var ch = String.fromCharCode(charCode);
- if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
- ch = '\\' + ch;
- }
- return ch;
- }
-
- function caseFoldCharset(charSet) {
- var charsetParts = charSet.substring(1, charSet.length - 1).match(
- new RegExp(
- '\\\\u[0-9A-Fa-f]{4}'
- + '|\\\\x[0-9A-Fa-f]{2}'
- + '|\\\\[0-3][0-7]{0,2}'
- + '|\\\\[0-7]{1,2}'
- + '|\\\\[\\s\\S]'
- + '|-'
- + '|[^-\\\\]',
- 'g'));
- var groups = [];
- var ranges = [];
- var inverse = charsetParts[0] === '^';
- for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
- var p = charsetParts[i];
- switch (p) {
- case '\\B': case '\\b':
- case '\\D': case '\\d':
- case '\\S': case '\\s':
- case '\\W': case '\\w':
- groups.push(p);
- continue;
- }
- var start = decodeEscape(p);
- var end;
- if (i + 2 < n && '-' === charsetParts[i + 1]) {
- end = decodeEscape(charsetParts[i + 2]);
- i += 2;
- } else {
- end = start;
- }
- ranges.push([start, end]);
- // If the range might intersect letters, then expand it.
- if (!(end < 65 || start > 122)) {
- if (!(end < 65 || start > 90)) {
- ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
- }
- if (!(end < 97 || start > 122)) {
- ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
- }
- }
- }
-
- // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
- // -> [[1, 12], [14, 14], [16, 17]]
- ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
- var consolidatedRanges = [];
- var lastRange = [NaN, NaN];
- for (var i = 0; i < ranges.length; ++i) {
- var range = ranges[i];
- if (range[0] <= lastRange[1] + 1) {
- lastRange[1] = Math.max(lastRange[1], range[1]);
- } else {
- consolidatedRanges.push(lastRange = range);
- }
- }
-
- var out = ['['];
- if (inverse) { out.push('^'); }
- out.push.apply(out, groups);
- for (var i = 0; i < consolidatedRanges.length; ++i) {
- var range = consolidatedRanges[i];
- out.push(encodeEscape(range[0]));
- if (range[1] > range[0]) {
- if (range[1] + 1 > range[0]) { out.push('-'); }
- out.push(encodeEscape(range[1]));
- }
- }
- out.push(']');
- return out.join('');
- }
-
- function allowAnywhereFoldCaseAndRenumberGroups(regex) {
- // Split into character sets, escape sequences, punctuation strings
- // like ('(', '(?:', ')', '^'), and runs of characters that do not
- // include any of the above.
- var parts = regex.source.match(
- new RegExp(
- '(?:'
- + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
- + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
- + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
- + '|\\\\[0-9]+' // a back-reference or octal escape
- + '|\\\\[^ux0-9]' // other escape sequence
- + '|\\(\\?[:!=]' // start of a non-capturing group
- + '|[\\(\\)\\^]' // start/emd of a group, or line start
- + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
- + ')',
- 'g'));
- var n = parts.length;
-
- // Maps captured group numbers to the number they will occupy in
- // the output or to -1 if that has not been determined, or to
- // undefined if they need not be capturing in the output.
- var capturedGroups = [];
-
- // Walk over and identify back references to build the capturedGroups
- // mapping.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- // groups are 1-indexed, so max group index is count of '('
- ++groupIndex;
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- capturedGroups[decimalValue] = -1;
- }
- }
- }
-
- // Renumber groups and reduce capturing groups to non-capturing groups
- // where possible.
- for (var i = 1; i < capturedGroups.length; ++i) {
- if (-1 === capturedGroups[i]) {
- capturedGroups[i] = ++capturedGroupIndex;
- }
- }
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- ++groupIndex;
- if (capturedGroups[groupIndex] === undefined) {
- parts[i] = '(?:';
- }
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- parts[i] = '\\' + capturedGroups[groupIndex];
- }
- }
- }
-
- // Remove any prefix anchors so that the output will match anywhere.
- // ^^ really does mean an anchored match though.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
- }
-
- // Expand letters to groupts to handle mixing of case-sensitive and
- // case-insensitive patterns if necessary.
- if (regex.ignoreCase && needToFoldCase) {
- for (var i = 0; i < n; ++i) {
- var p = parts[i];
- var ch0 = p.charAt(0);
- if (p.length >= 2 && ch0 === '[') {
- parts[i] = caseFoldCharset(p);
- } else if (ch0 !== '\\') {
- // TODO: handle letters in numeric escapes.
- parts[i] = p.replace(
- /[a-zA-Z]/g,
- function (ch) {
- var cc = ch.charCodeAt(0);
- return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
- });
- }
- }
- }
-
- return parts.join('');
- }
-
- var rewritten = [];
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.global || regex.multiline) { throw new Error('' + regex); }
- rewritten.push(
- '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
- }
-
- return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
- }
-
- var PR_innerHtmlWorks = null;
- function getInnerHtml(node) {
- // inner html is hopelessly broken in Safari 2.0.4 when the content is
- // an html description of well formed XML and the containing tag is a PRE
- // tag, so we detect that case and emulate innerHTML.
- if (null === PR_innerHtmlWorks) {
- var testNode = document.createElement('PRE');
- testNode.appendChild(
- document.createTextNode('\n '));
- PR_innerHtmlWorks = !/)[\r\n]+/g, '$1')
- .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');
- }
- return content;
- }
-
- var out = [];
- for (var child = node.firstChild; child; child = child.nextSibling) {
- normalizedHtml(child, out);
- }
- return out.join('');
- }
-
- /** returns a function that expand tabs to spaces. This function can be fed
- * successive chunks of text, and will maintain its own internal state to
- * keep track of how tabs are expanded.
- * @return {function (string) : string} a function that takes
- * plain text and return the text with tabs expanded.
- * @private
- */
- function makeTabExpander(tabWidth) {
- var SPACES = ' ';
- var charInLine = 0;
-
- return function (plainText) {
- // walk over each character looking for tabs and newlines.
- // On tabs, expand them. On newlines, reset charInLine.
- // Otherwise increment charInLine
- var out = null;
- var pos = 0;
- for (var i = 0, n = plainText.length; i < n; ++i) {
- var ch = plainText.charAt(i);
-
- switch (ch) {
- case '\t':
- if (!out) { out = []; }
- out.push(plainText.substring(pos, i));
- // calculate how much space we need in front of this part
- // nSpaces is the amount of padding -- the number of spaces needed
- // to move us to the next column, where columns occur at factors of
- // tabWidth.
- var nSpaces = tabWidth - (charInLine % tabWidth);
- charInLine += nSpaces;
- for (; nSpaces >= 0; nSpaces -= SPACES.length) {
- out.push(SPACES.substring(0, nSpaces));
- }
- pos = i + 1;
- break;
- case '\n':
- charInLine = 0;
- break;
- default:
- ++charInLine;
- }
- }
- if (!out) { return plainText; }
- out.push(plainText.substring(pos));
- return out.join('');
- };
- }
-
- var pr_chunkPattern = new RegExp(
- '[^<]+' // A run of characters other than '<'
- + '|<\!--[\\s\\S]*?--\>' // an HTML comment
- + '|' // a CDATA section
- // a probable tag that should not be highlighted
- + '|<\/?[a-zA-Z](?:[^>\"\']|\'[^\']*\'|\"[^\"]*\")*>'
- + '|<', // A '<' that does not begin a larger chunk
- 'g');
- var pr_commentPrefix = /^<\!--/;
- var pr_cdataPrefix = /^) into their textual equivalent.
- *
- * @param {string} s html where whitespace is considered significant.
- * @return {Object} source code and extracted tags.
- * @private
- */
- function extractTags(s) {
- // since the pattern has the 'g' modifier and defines no capturing groups,
- // this will return a list of all chunks which we then classify and wrap as
- // PR_Tokens
- var matches = s.match(pr_chunkPattern);
- var sourceBuf = [];
- var sourceBufLen = 0;
- var extractedTags = [];
- if (matches) {
- for (var i = 0, n = matches.length; i < n; ++i) {
- var match = matches[i];
- if (match.length > 1 && match.charAt(0) === '<') {
- if (pr_commentPrefix.test(match)) { continue; }
- if (pr_cdataPrefix.test(match)) {
- // strip CDATA prefix and suffix. Don't unescape since it's CDATA
- sourceBuf.push(match.substring(9, match.length - 3));
- sourceBufLen += match.length - 12;
- } else if (pr_brPrefix.test(match)) {
- //
tags are lexically significant so convert them to text.
- // This is undone later.
- sourceBuf.push('\n');
- ++sourceBufLen;
- } else {
- if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) {
- // A will start a section that should be
- // ignored. Continue walking the list until we see a matching end
- // tag.
- var name = match.match(pr_tagNameRe)[2];
- var depth = 1;
- var j;
- end_tag_loop:
- for (j = i + 1; j < n; ++j) {
- var name2 = matches[j].match(pr_tagNameRe);
- if (name2 && name2[2] === name) {
- if (name2[1] === '/') {
- if (--depth === 0) { break end_tag_loop; }
- } else {
- ++depth;
- }
- }
- }
- if (j < n) {
- extractedTags.push(
- sourceBufLen, matches.slice(i, j + 1).join(''));
- i = j;
- } else { // Ignore unclosed sections.
- extractedTags.push(sourceBufLen, match);
- }
- } else {
- extractedTags.push(sourceBufLen, match);
- }
- }
- } else {
- var literalText = htmlToText(match);
- sourceBuf.push(literalText);
- sourceBufLen += literalText.length;
- }
- }
- }
- return { source: sourceBuf.join(''), tags: extractedTags };
- }
-
- /** True if the given tag contains a class attribute with the nocode class. */
- function isNoCodeTag(tag) {
- return !!tag
- // First canonicalize the representation of attributes
- .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,
- ' $1="$2$3$4"')
- // Then look for the attribute we want.
- .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);
- }
-
- /**
- * Apply the given language handler to sourceCode and add the resulting
- * decorations to out.
- * @param {number} basePos the index of sourceCode within the chunk of source
- * whose decorations are already present on out.
- */
- function appendDecorations(basePos, sourceCode, langHandler, out) {
- if (!sourceCode) { return; }
- var job = {
- source: sourceCode,
- basePos: basePos
- };
- langHandler(job);
- out.push.apply(out, job.decorations);
- }
-
- /** Given triples of [style, pattern, context] returns a lexing function,
- * The lexing function interprets the patterns to find token boundaries and
- * returns a decoration list of the form
- * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
- * where index_n is an index into the sourceCode, and style_n is a style
- * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
- * all characters in sourceCode[index_n-1:index_n].
- *
- * The stylePatterns is a list whose elements have the form
- * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
- *
- * Style is a style constant like PR_PLAIN, or can be a string of the
- * form 'lang-FOO', where FOO is a language extension describing the
- * language of the portion of the token in $1 after pattern executes.
- * E.g., if style is 'lang-lisp', and group 1 contains the text
- * '(hello (world))', then that portion of the token will be passed to the
- * registered lisp handler for formatting.
- * The text before and after group 1 will be restyled using this decorator
- * so decorators should take care that this doesn't result in infinite
- * recursion. For example, the HTML lexer rule for SCRIPT elements looks
- * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
- * '
-
-
-Generated on $datetime
-for $projectname by Doxygen $doxygenversion
+Generated on $datetime for $projectname by Doxygen $doxygenversion
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/build/exe/doliwamp/Languages/MyEnglish.isl b/build/exe/doliwamp/Languages/MyEnglish.isl
index 11d2e4456bd..b7c5ecb6230 100644
--- a/build/exe/doliwamp/Languages/MyEnglish.isl
+++ b/build/exe/doliwamp/Languages/MyEnglish.isl
@@ -13,8 +13,8 @@ AssocingFileExtension=Associating %1 with the %2 file extension...
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (Apache+Mysql+PHP+Dolibarr) on your computer.
ThisAssistantInstallOrUpgrade=This assistant installs or upgrades Dolibarr ERP-CRM and all required third party softwares (Apache, Mysql and PHP) optimized for a Dolibarr usage.
-IfYouHaveTechnicalKnowledge=If you have technical knowledge and plan to share your Apache, Mysql and PHP with other projects than Dolibarr, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation.
-ButIfYouLook=But if you look for an automatic setup, you''re on the good way...
+IfYouHaveTechnicalKnowledge=If you are looking for a hosted version in the Cloud, you should look at https://saas.dolibarr.org. If you have technical knowledge and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation.
+ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way...
DoYouWantToStart=Do you want to start installation/upgrade process ?
TechnicalParameters=Technical parameters
diff --git a/build/exe/doliwamp/Languages/MyFrench.isl b/build/exe/doliwamp/Languages/MyFrench.isl
index 1daf4425e68..8c7cff0bb42 100644
--- a/build/exe/doliwamp/Languages/MyFrench.isl
+++ b/build/exe/doliwamp/Languages/MyFrench.isl
@@ -13,8 +13,8 @@ AssocingFileExtension=Associe %1 avec l'extension de fichier %2...
YouWillInstallDoliWamp=Vous allez installer ou mettre jour DoliWamp (Apache+Mysql+PHP+Dolibarr) sur votre ordinateur.
ThisAssistantInstallOrUpgrade=Cet assistant installe ou met jour Dolibarr ERP-CRM et tous ses composants prrequis (Apache, Mysql et PHP) optimiss pour une utilisation de Dolibarr.
-IfYouHaveTechnicalKnowledge=Si vous avez des comptences techniques et envisagez de partager votre Apache, Mysql et PHP avec d'autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutt une installation manuelle de Dolibarr sur un socle Apache, Mysql et PHP existant.
-ButIfYouLook=Mais si vous recherchez une installation cl en main automatise, vous tes sur la bonne voie...
+IfYouHaveTechnicalKnowledge=Si vous cherchez un hbergement dans le Cloud, aller voir sur https://saas.dolibarr.org. Si vous avez des comptences techniques et voulez grer vous mme Apache, Mysql et PHP, vous ne devriez pas utiliser cet assistant mais faire plutt une installation manuelle de Dolibarr sur votre socle Apache, Mysql et PHP existant.
+ButIfYouLook=Mais si vous recherchez une installation automatise locale sur votre ordinateur, cl en main, vous tes sur la bonne voie...
DoYouWantToStart=Voulez-vous dmarrer le processus d'installation/mise jour ?
TechnicalParameters=Paramtres techniques
diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss
index 2d4668b447c..cc6a39a62a4 100644
--- a/build/exe/doliwamp/doliwamp.iss
+++ b/build/exe/doliwamp/doliwamp.iss
@@ -32,7 +32,7 @@ AppPublisherURL=https://www.nltechno.com
AppSupportURL=https://www.dolibarr.org
AppUpdatesURL=https://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
-AppCopyright=Copyright (C) 2008-2017 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
+AppCopyright=Copyright (C) 2008-2018 Laurent Destailleur (NLTechno), Fabian Rodriguez (Le Goût du Libre)
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
diff --git a/build/flatpack/org.flatpak.Dolibarr.json b/build/flatpack/org.flatpak.Dolibarr.json
new file mode 100644
index 00000000000..9e2135cf0a3
--- /dev/null
+++ b/build/flatpack/org.flatpak.Dolibarr.json
@@ -0,0 +1 @@
+Help wanted...
\ No newline at end of file
diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php
index 0764d64b491..ec9ded557ff 100755
--- a/build/generate_filelist_xml.php
+++ b/build/generate_filelist_xml.php
@@ -34,8 +34,8 @@ 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");
+require_once $path."../htdocs/master.inc.php";
+require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
/*
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 1ab3269d0de..01e282aa492 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -22,7 +22,7 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
-#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
+#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
%REQUIREMENTPUBLISH=(
"SF"=>"git ssh rsync",
@@ -37,7 +37,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpd
"RPM_MANDRIVA"=>"rpmbuild",
"RPM_OPENSUSE"=>"rpmbuild",
"DEB"=>"dpkg",
-"APS"=>"zip",
+"FLATPACK"=>"flatpack",
"EXEDOLIWAMP"=>"ISCC.exe",
"SNAPSHOT"=>"tar"
);
@@ -142,7 +142,6 @@ $FILENAMETGZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEZIP = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEXZ = "$PROJECT-$MAJOR.$MINOR.$BUILD";
$FILENAMEDEB = "see later";
-$FILENAMEAPS = "$PROJECT-$MAJOR.$MINOR.$BUILD.app";
$FILENAMEEXEDOLIWAMP = "DoliWamp-$MAJOR.$MINOR.$BUILD";
# For RPM
$ARCH='noarch';
@@ -692,7 +691,7 @@ if ($nboftargetok) {
print "Go to directory $BUILDROOT\n";
$olddir=getcwd();
chdir("$BUILDROOT");
- $cmd= "xz -9 -r $BUILDROOT/$FILENAMEAPS.xz \*";
+ $cmd= "xz -9 -r $BUILDROOT/$FILENAMEXZ.xz \*";
print $cmd."\n";
$ret= `$cmd`;
chdir("$olddir");
@@ -1033,92 +1032,6 @@ if ($nboftargetok) {
next;
}
- if ($target eq 'APS')
- {
- $NEWDESTI=$DESTI;
- if ($NEWDESTI =~ /stable/)
- {
- mkdir($DESTI.'/package_aps');
- if (-d $DESTI.'/package_aps') { $NEWDESTI=$DESTI.'/package_aps'; }
- }
-
- $newbuild = $BUILD;
- $newbuild =~ s/(dev|alpha)/0/gi; # dev
- $newbuild =~ s/beta/1/gi; # beta
- $newbuild =~ s/rc./2/gi; # rc
- if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
- # now newbuild is 0-0 or 0-3 for example
- $REL1 = $newbuild; $REL1 =~ s/-.*$//gi;
- if ($RPMSUBVERSION eq 'auto') { $RPMSUBVERSION = $newbuild; $RPMSUBVERSION =~ s/^.*-//gi; }
- print "Version is $MAJOR.$MINOR.$REL1-$RPMSUBVERSION\n";
-
- print "Remove target $FILENAMEAPS.zip...\n";
- unlink "$NEWDESTI/$FILENAMEAPS.zip";
-
- #rmdir "$BUILDROOT/$PROJECT.tmp";
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp`;
- print "Create directory $BUILDROOT/$PROJECT.tmp\n";
- $ret=`mkdir -p "$BUILDROOT/$PROJECT.tmp"`;
- print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$PROJECT.tmp\n";
- $cmd="cp -pr \"$BUILDROOT/$PROJECT\" \"$BUILDROOT/$PROJECT.tmp\"";
- $ret=`$cmd`;
-
- print "Remove other files\n";
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/deb`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/dmg`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/doap`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/exe`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/live`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/patch`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/rpm`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/zip`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/build/perl`;
-
- $APSVERSION="1.2";
- print "Create APS files $BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml\n";
- open (SPECFROM,"<$BUILDROOT/$PROJECT/build/aps/APP-META-$APSVERSION.xml") || die "Error";
- open (SPECTO,">$BUILDROOT/$PROJECT.tmp/$PROJECT/APP-META.xml") || die "Error";
- while () {
- $newbuild = $BUILD;
- $newbuild =~ s/(dev|alpha)/0/gi; # dev
- $newbuild =~ s/beta/1/gi; # beta
- $newbuild =~ s/rc./2/gi; # rc
- if ($newbuild !~ /-/) { $newbuild.='-3'; } # finale
- # now newbuild is 0-0 or 0-3 for example
- $_ =~ s/__VERSION__/$MAJOR.$MINOR.$REL1/;
- $_ =~ s/__RELEASE__/$RPMSUBVERSION/;
- print SPECTO $_;
- }
- close SPECFROM;
- close SPECTO;
- print "Version set to $MAJOR.$MINOR.$newbuild\n";
- $cmd="cp -pr \"$BUILDROOT/$PROJECT/build/aps/configure.php\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/scripts/configure.php\"";
- $ret=`$cmd`;
- $cmd="cp -pr \"$BUILDROOT/$PROJECT/doc/images\" \"$BUILDROOT/$PROJECT.tmp/$PROJECT/images\"";
- $ret=`$cmd`;
-
- print "Remove other files\n";
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/dev`;
- $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/$PROJECT/doc`;
-
- print "Build APP-LIST.xml files\n";
-
- print "Compress $BUILDROOT/$PROJECT.tmp/$PROJECT into $FILENAMEAPS.zip...\n";
-
- print "Go to directory $BUILDROOT/$PROJECT.tmp\/$PROJECT\n";
- $olddir=getcwd();
- chdir("$BUILDROOT\/$PROJECT.tmp\/$PROJECT");
- $cmd= "zip -9 -r $BUILDROOT/$FILENAMEAPS.zip \*";
- print $cmd."\n";
- $ret= `$cmd`;
- chdir("$olddir");
-
- # Move to final dir
- print "Move $BUILDROOT/$FILENAMEAPS.zip to $NEWDESTI/$FILENAMEAPS.zip\n";
- $ret=`mv "$BUILDROOT/$FILENAMEAPS.zip" "$NEWDESTI/$FILENAMEAPS.zip"`;
- next;
- }
-
if ($target eq 'EXEDOLIWAMP')
{
$NEWDESTI=$DESTI;
diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec
index d5a9189229e..b6d526bf8e1 100755
--- a/build/rpm/dolibarr_fedora.spec
+++ b/build/rpm/dolibarr_fedora.spec
@@ -177,9 +177,11 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/custom
+%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
+%_datadir/dolibarr/htdocs/emailcollector
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
@@ -212,6 +214,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
+%_datadir/dolibarr/htdocs/takepos
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec
index 673d5919d1a..32c6e50018e 100755
--- a/build/rpm/dolibarr_generic.spec
+++ b/build/rpm/dolibarr_generic.spec
@@ -54,7 +54,7 @@ BuildRequires: desktop-file-utils
Group: Applications/Productivity
Requires: apache-base, apache-mod_php, php-cgi, php-cli, php-bz2, php-gd, php-ldap, php-imap, php-mysqli, php-openssl, fonts-ttf-dejavu
Requires: mysql, mysql-client
-%else
+%else%_datadir/dolibarr/htdocs/datapolicy
%if 0%{?suse_version}
# Voir http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
Group: Productivity/Office/Management
@@ -124,7 +124,7 @@ cui hai bisogno ed essere facile da usare.
%if 0%{?sles_version}
%{__rm} -rf $RPM_BUILD_ROOT
-%{__mkdir} $RPM_BUILD_ROOT
+%{__mkdir} $RPM_BUILD_ROOT%_datadir/dolibarr/htdocs/datapolicy
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}
%{__mkdir} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
%else
@@ -257,9 +257,11 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/custom
+%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
+%_datadir/dolibarr/htdocs/emailcollector
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
@@ -292,6 +294,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
+%_datadir/dolibarr/htdocs/takepos
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec
index e3d2a849db2..dbb8e0d1310 100755
--- a/build/rpm/dolibarr_mandriva.spec
+++ b/build/rpm/dolibarr_mandriva.spec
@@ -174,9 +174,11 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/custom
+%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
+%_datadir/dolibarr/htdocs/emailcollector
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
@@ -209,6 +211,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
+%_datadir/dolibarr/htdocs/takepos
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec
index 5a64bec2e78..aa810a737b9 100755
--- a/build/rpm/dolibarr_opensuse.spec
+++ b/build/rpm/dolibarr_opensuse.spec
@@ -185,9 +185,11 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/core
%_datadir/dolibarr/htdocs/cron
%_datadir/dolibarr/htdocs/custom
+%_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm
+%_datadir/dolibarr/htdocs/emailcollector
%_datadir/dolibarr/htdocs/expedition
%_datadir/dolibarr/htdocs/expensereport
%_datadir/dolibarr/htdocs/exports
@@ -220,6 +222,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/supplier_proposal
%_datadir/dolibarr/htdocs/support
%_datadir/dolibarr/htdocs/theme
+%_datadir/dolibarr/htdocs/takepos
%_datadir/dolibarr/htdocs/ticket
%_datadir/dolibarr/htdocs/user
%_datadir/dolibarr/htdocs/variants
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index cdbc2e2bb40..37aef014e63 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -1,5 +1,5 @@
-This file describe changes made on external library after beeing included
+This file describes changes made on external libraries after being included
in Dolibarr root.
@@ -48,6 +48,23 @@ into
// initialize subsetchars
$subsetchars = array_fill(0, 256, true);
+* Replace the continue into switch with a break:
+
+case 're': {
+ // justify block
+ if (!TCPDF_STATIC::empty_string($this->lispacer)) {
+ $this->lispacer = '';
+ continue;
+ }
+
+into
+case 're': {
+ // justify block
+ if (!TCPDF_STATIC::empty_string($this->lispacer)) {
+ $this->lispacer = '';
+ break;
+ }
+
* Optionnaly, removed all fonts except
dejavusans* (used by greek, arab, persan, romanian, turkish),
freemono* (russian),
@@ -61,17 +78,24 @@ In htdocs/includes/tcpdf/tcpdf.php
+ protected $default_monospaced_font = 'freemono';
+
TCPDI:
------
Add fpdf_tpl.php 1.2
Add tcpdi.php
+
Add tcpdi_parser.php and replace:
require_once(dirname(__FILE__).'/include/tcpdf_filters.php');
with:
require_once(dirname(__FILE__).'/../tecnickcom/tcpdf/include/tcpdf_filters.php');
+* Fix by replacing
+ } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1] >= 2))) {
+with
+ } elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
+
JSGANTT:
diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php
index bd82d38d306..e519c62a436 100755
--- a/dev/examples/code/create_invoice.php
+++ b/dev/examples/code/create_invoice.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
// Create invoice object
$obj = new Facture($db);
diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php
index 4575e9e28f3..95b047705fa 100755
--- a/dev/examples/code/create_order.php
+++ b/dev/examples/code/create_order.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
// Create order object
$com = new Commande($db);
diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php
index 61598ff59d9..8cbc07a1b63 100755
--- a/dev/examples/code/create_product.php
+++ b/dev/examples/code/create_product.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -59,7 +59,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
+require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php";
// Create instance of object
$myproduct=new Product($db);
diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php
index 20173eb914a..f8e0ba23011 100755
--- a/dev/examples/code/create_user.php
+++ b/dev/examples/code/create_user.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -58,7 +58,7 @@ print "***** ".$script_file." (".$version.") *****\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php");
+require_once DOL_DOCUMENT_ROOT."/user/class/user.class.php";
// Create user object
$obj = new User($db);
diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php
index fbe512300e8..daff0e43e6f 100755
--- a/dev/examples/code/get_contracts.php
+++ b/dev/examples/code/get_contracts.php
@@ -40,7 +40,7 @@ $error=0;
// -------------------- START OF YOUR CODE HERE --------------------
// Include Dolibarr environment
-require_once($path."../../htdocs/master.inc.php");
+require_once $path."../../htdocs/master.inc.php";
// After this $db, $mysoc, $langs and $conf->entity are defined. Opened handler to database will be closed at end of file.
//$langs->setDefaultLang('en_US'); // To change default language of $langs
@@ -65,7 +65,7 @@ print 'Argument id_thirdparty='.$argv[1]."\n";
// Start of transaction
$db->begin();
-require_once(DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php");
+require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php";
// Create contract object
$obj = new Contrat($db);
diff --git a/dev/examples/mail/dolibarr_mail_simpleHTML.txt b/dev/examples/mail/dolibarr_mail_simpleHTML.txt
index 5c552221ca6..391800f5095 100644
--- a/dev/examples/mail/dolibarr_mail_simpleHTML.txt
+++ b/dev/examples/mail/dolibarr_mail_simpleHTML.txt
@@ -4,4 +4,4 @@ X-Mailer: Dolibarr version 2.7.0-beta (using php mail)
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Testé
fdsfsdf
fsdfsfds
fssdfsd
+ Testé
fdsfsdf
fsdfsfds
fssdfsd
diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php
index e313aa44d1f..280518bd4e3 100755
--- a/dev/initdata/generate-invoice.php
+++ b/dev/initdata/generate-invoice.php
@@ -32,9 +32,9 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+require __DIR__. '/../../htdocs/master.inc.php';
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*
@@ -185,7 +185,4 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0)
{
dol_print_error($db,$object->error);
}
-
}
-
-
diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php
index c73b15b620d..5e53fa752a2 100755
--- a/dev/initdata/generate-order.php
+++ b/dev/initdata/generate-order.php
@@ -33,14 +33,14 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
/*
diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php
index 3ae44b00b3a..393d5c5ce3d 100755
--- a/dev/initdata/generate-product.php
+++ b/dev/initdata/generate-product.php
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php
index 6f1dc293a68..eb2bfe15a00 100755
--- a/dev/initdata/generate-proposal.php
+++ b/dev/initdata/generate-proposal.php
@@ -33,11 +33,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
-require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
-require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
-require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
-require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
+require __DIR__. '/../../htdocs/master.inc.php';
+require_once DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php";
+require_once DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php";
+require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php";
+require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php";
/*
* Parameters
@@ -157,7 +157,7 @@ $user->rights->propal->propal_advance->validate=1;
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
- require_once(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php");
+ require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php";
}
$i=0;
@@ -218,6 +218,4 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
{
dol_print_error($db,$object->error);
}
-
}
-
diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php
index 992ab61f4ef..7f2c3e2055d 100755
--- a/dev/initdata/generate-thirdparty.php
+++ b/dev/initdata/generate-thirdparty.php
@@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
-require (__DIR__. '/../../htdocs/master.inc.php');
+require __DIR__. '/../../htdocs/master.inc.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php
index a08e3b6066e..0f4856aefb2 100755
--- a/dev/initdata/import-products.php
+++ b/dev/initdata/import-products.php
@@ -21,7 +21,7 @@
/**
* \file dev/initdata/import-product.php
- * \brief Script example to insert products from a csv file.
+ * \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -118,22 +118,22 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
{
$i++;
$errorrecord=0;
-
+
if ($startlinenb && $i < $startlinenb) continue;
if ($endlinenb && $i > $endlinenb) continue;
-
+
$nboflines++;
-
+
$produit = new Product($db);
$produit->type = 0;
$produit->status = 1;
$produit->ref = trim($fields[0]);
-
+
print "Process line nb ".$i.", ref ".$produit->ref;
$produit->label = trim($fields[2]);
$produit->description = trim($fields[4]."\n".($fields[5] ? $fields[5].' x '.$fields[6].' x '.$fields[7] : ''));
$produit->volume = price2num($fields[8]);
- $produit->volume_unit = 0;
+ $produit->volume_unit = 0;
$produit->weight = price2num($fields[9]);
$produit->weight_units = 0; // -3 = g
@@ -142,9 +142,9 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
$produit->status = 1;
$produit->status_buy = 1;
-
+
$produit->finished = 1;
-
+
$produit->price_min = null;
$produit->price_min_ttc = null;
$produit->price = price2num($fields[11]);
@@ -152,25 +152,25 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
$produit->price_base_type = 'TTC';
$produit->tva_tx = price2num($fields[13]);
$produit->tva_npr = 0;
-
+
$produit->cost_price = price2num($fields[16]);
-
+
// Extrafields
$produit->array_options['options_ecotaxdeee']=price2num($fields[17]);
-
+
$ret=$produit->create($user);
if ($ret < 0)
{
print " - Error in create result code = ".$ret." - ".$produit->errorsToString();
$errorrecord++;
}
- else
+ else
{
print " - Creation OK with ref ".$produit->ref." - id = ".$ret;
}
dol_syslog("Add prices");
-
+
// If we use price level, insert price for each level
if (! $errorrecord && 1)
{
@@ -181,14 +181,14 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
print " - Error in updatePrice result code = ".$ret1." ".$ret2." - ".$produit->errorsToString();
$errorrecord++;
}
- else
+ else
{
print " - updatePrice OK";
}
}
-
+
dol_syslog("Add multilangs");
-
+
// Add alternative languages
if (! $errorrecord && 1)
{
@@ -201,15 +201,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
print " - Error in setMultiLangs result code = ".$ret." - ".$produit->errorsToString();
$errorrecord++;
}
- else
+ else
{
print " - setMultiLangs OK";
}
}
-
+
print "\n";
-
- if ($errorrecord)
+
+ if ($errorrecord)
{
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$produit->errorsToString()."\n");
$error++; // $errorrecord will be reset
diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php
index 0c32c7ea6a3..63c6856e5ec 100755
--- a/dev/initdata/import-thirdparties.php
+++ b/dev/initdata/import-thirdparties.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php
index 3aaa9c11a4a..c94f74341f6 100755
--- a/dev/initdata/import-users.php
+++ b/dev/initdata/import-users.php
@@ -21,7 +21,7 @@
/**
* \file dev/initdata/import-thirdparties.php
- * \brief Script example to insert thirdparties from a csv file.
+ * \brief Script example to insert thirdparties from a csv file.
* To purge data, you can have a look at purge-data.php
*/
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -118,15 +118,15 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
{
$i++;
$errorrecord=0;
-
+
if ($startlinenb && $i < $startlinenb) continue;
if ($endlinenb && $i > $endlinenb) continue;
-
+
$nboflines++;
-
+
$object = new User($db);
$object->statut = 1;
-
+
$tmp=explode(' ',$fields[3],2);
$object->firstname = trim($tmp[0]);
$object->lastname = trim($tmp[1]);
@@ -134,23 +134,23 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape))
else $object->login=strtolower($object->firstname);
$object->login=preg_replace('/ /','',$object->login);
$object->password = 'init';
-
+
print "Process line nb ".$i.", login ".$object->login;
-
+
$ret=$object->create($user);
if ($ret < 0)
{
print " - Error in create result code = ".$ret." - ".$object->errorsToString();
$errorrecord++;
}
- else
+ else
{
print " - Creation OK with login ".$object->login." - id = ".$ret;
}
print "\n";
-
- if ($errorrecord)
+
+ if ($errorrecord)
{
fwrite($fhandleerr, 'Error on record nb '.$i." - ".$object->errorsToString()."\n");
$error++; // $errorrecord will be reset
diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php
index f992dcb2dc6..2bdf200225b 100755
--- a/dev/initdata/purge-data.php
+++ b/dev/initdata/purge-data.php
@@ -36,7 +36,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
// Recupere root dolibarr
$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]);
-require ($path."../../htdocs/master.inc.php");
+require $path."../../htdocs/master.inc.php";
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
@@ -44,8 +44,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-$langs->load("main");
-$langs->load("errors");
+$langs->loadLangs(array("main", "errors"));
// Global variables
$version=DOL_VERSION;
diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php
index 981ff964b8e..98cb6189935 100755
--- a/dev/initdemo/sftpget_and_loaddump.php
+++ b/dev/initdemo/sftpget_and_loaddump.php
@@ -41,15 +41,15 @@ $passwordbase=isset($argv[6])?$argv[6]:'';
// Include Dolibarr environment
$res=0;
-if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
-if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
-if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
-if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
-if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
+if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
+if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
+if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
+if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
+if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
-include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*
diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php
index 9c453096904..53717314d5f 100755
--- a/dev/initdemo/updatedemo.php
+++ b/dev/initdemo/updatedemo.php
@@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
* or see http://www.gnu.org/
- *
+ *
* Get a distant dump file and load it into a mysql database
*/
@@ -36,15 +36,15 @@ $confirm=isset($argv[1])?$argv[1]:'';
// Include Dolibarr environment
$res=0;
-if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
-if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include($path."../../htdocs/master.inc.php");
-if (! $res && file_exists("../master.inc.php")) $res=@include("../master.inc.php");
-if (! $res && file_exists("../../master.inc.php")) $res=@include("../../master.inc.php");
-if (! $res && file_exists("../../../master.inc.php")) $res=@include("../../../master.inc.php");
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include($path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
-if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include("../../../dolibarr".$reg[1]."/htdocs/master.inc.php"); // Used on dev env only
+if (! $res && file_exists($path."../../master.inc.php")) $res=@include $path."../../master.inc.php";
+if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $path."../../htdocs/master.inc.php";
+if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php";
+if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php";
+if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php";
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
+if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only
if (! $res) die ("Failed to include master.inc.php file\n");
-include_once(DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php');
+include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
/*
@@ -74,7 +74,7 @@ $tables=array(
$year=2010;
$currentyear=$tmp['year'];
-while ($year <= $currentyear)
+while ($year <= $currentyear)
{
//$year=2021;
$delta=($currentyear - $year);
@@ -84,7 +84,7 @@ while ($year <= $currentyear)
{
foreach($tables as $tablekey => $tableval)
{
- print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
+ print "\nCorrect ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
$resql = $db->query($sql);
@@ -110,14 +110,14 @@ while ($year <= $currentyear)
//print $sql2."\n";
$resql2 = $db->query($sql2);
if (! $resql2) dol_print_error($db);
- }
+ }
$i++;
}
}
else dol_print_error($db);
}
}
-
+
$year++;
}
diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index a43e4dde82b..67bf58e51ed 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -4,6 +4,7 @@
Dolibarr coding standard.
build/html
+ build/aps
documents
htdocs/custom
htdocs/includes
@@ -11,43 +12,29 @@
*/nltechno*
*/htdocs/includes
*.min.css
+ *.js
-
+
-
+
0
-
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
- 0
-
-
- 0
-
+
+
+
+
+
+
+
+
+
+
+
@@ -147,7 +134,7 @@
0
-
+
@@ -163,7 +150,7 @@
0
-
+
@@ -171,7 +158,24 @@
+
+
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
@@ -186,7 +190,7 @@
0
-
+
0
@@ -206,14 +210,14 @@
0
-
+
0
-
-
-
-
+
5
-
-
+
+
+
+
@@ -254,11 +258,11 @@
0
-
+
0
-
+
0
@@ -285,7 +289,20 @@
-
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
@@ -315,14 +332,14 @@
0
-
+
0
-
+
0
@@ -330,7 +347,7 @@
0
-
+
@@ -347,31 +364,37 @@
0
-
+
+
0
+
+
+
0
-
+
-
+
diff --git a/dev/tools/test/testtcpdf.php b/dev/tools/test/testtcpdf.php
index e14dae9c2a3..ce962dce3d9 100755
--- a/dev/tools/test/testtcpdf.php
+++ b/dev/tools/test/testtcpdf.php
@@ -27,8 +27,8 @@
* @since 2008-03-04
*/
-require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
-require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
+require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
+require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
diff --git a/dev/tools/test/testutf.php b/dev/tools/test/testutf.php
index c626a92a57d..ffa746bcab5 100644
--- a/dev/tools/test/testutf.php
+++ b/dev/tools/test/testutf.php
@@ -47,8 +47,8 @@ print 'Files has been created. Check its name from your explorer'."\n";
* @since 2008-09-15
*/
-require_once('../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php');
-require_once('../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php');
+require_once '../../htdocs/includes/tecnickcom/tcpdf/config/tcpdf_config.php';
+require_once '../../htdocs/includes/tecnickcom/tcpdf/tcpdf.php';
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php
index 47d6a25ec15..123b7f6157d 100644
--- a/dev/translation/autotranslator.class.php
+++ b/dev/translation/autotranslator.class.php
@@ -64,8 +64,7 @@ class autoTranslator
// Translate
//ini_set('default_charset','UTF-8');
ini_set('default_charset',$this->_outputpagecode);
- $this->parse_refLangTranslationFiles();
-
+ $this->parseRefLangTranslationFiles();
}
/**
@@ -73,7 +72,7 @@ class autoTranslator
*
* @return void
*/
- private function parse_refLangTranslationFiles()
+ private function parseRefLangTranslationFiles()
{
$files = $this->getTranslationFilesArray($this->_refLang);
@@ -346,5 +345,4 @@ class autoTranslator
return $rep;
}
-
}
diff --git a/dev/translation/autotranslator.php b/dev/translation/autotranslator.php
index 58314a23b9e..c7897810a72 100755
--- a/dev/translation/autotranslator.php
+++ b/dev/translation/autotranslator.php
@@ -37,8 +37,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
}
// Include Dolibarr environment
-require_once($path.'../../htdocs/master.inc.php');
-require_once($path.'../../htdocs/core/lib/files.lib.php');
+require_once $path.'../../htdocs/master.inc.php';
+require_once $path.'../../htdocs/core/lib/files.lib.php';
// After this $db is an opened handler to database. We close it at end of file.
// Load main language strings
@@ -88,7 +88,7 @@ if ($argv[2] != 'all')
}
}
-require_once(DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php");
+require_once DOL_DOCUMENT_ROOT."/../dev/translation/autotranslator.class.php";
$langParser = new autoTranslator($argv[2],$argv[1],$dir,$file,$argv[3]);
diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php
index 2eedcda8760..0e3b2c7513f 100755
--- a/dev/translation/sanity_check_en_langfiles.php
+++ b/dev/translation/sanity_check_en_langfiles.php
@@ -295,6 +295,7 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
if (preg_match('/^DescADHERENT_/', $value)) $qualifiedforclean=0;
if (preg_match('/^SubmitTranslation/', $value)) $qualifiedforclean=0;
if (preg_match('/^ModuleCompanyCode/', $value)) $qualifiedforclean=0;
+ if (preg_match('/InDolibarr$/', $value)) $qualifiedforclean=0;
// admin.lang
if (preg_match('/^DAV_ALLOW_PUBLIC_DIR/i', $value)) $qualifiedforclean=0;
if (preg_match('/^DAV_ALLOW_ECM_DIR/i', $value)) $qualifiedforclean=0;
diff --git a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg
index 5f7d8a5b573..0b5c749cb5c 100644
Binary files a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg and b/doc/images/dolibarr_screenshot5_1920x1080_b.jpg differ
diff --git a/doc/index.html b/doc/index.html
index b888b13d9a6..5c655136e3e 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -11,15 +11,15 @@ informations on Dolibarr.
But if you are looking for other resources (downloads, documentation, addons, ...), you can find this
on Internet on web following sites:
-* Dolibarr wiki (documentation)
+* Dolibarr wiki (documentation)
-* Dolibarr portal (official website)
+* Dolibarr portal (official website)
-* Dolibarr demo (online)
+* Dolibarr demo (online)
-* DoliWamp, the Dolibarr for Windows
+* DoliWamp, the Dolibarr for Windows
-* DoliStore (official addons/plugins market place)
+* DoliStore (official addons/plugins market place)