diff --git a/README-FR.md b/README-FR.md
index 19d4ae25df9..4feb27893e0 100644
--- a/README-FR.md
+++ b/README-FR.md
@@ -15,37 +15,43 @@ 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 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).
+### Configuration simple
-Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
-https://www.dolibarr.org/
+Si vous avez peu de compétences techniques et que vous souhaitez installer Dolibarr ERP/CRM en quelques clics, vous pouvez utiliser l'une des versions pré-packagées avec les prérequis:
-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:
+- DoliWamp pour Windows
+- DoliDeb pour Debian ou Ubuntu
+- DoliRpm pour Redhat, Fedora, OpenSuse, Mandriva ou Mageia
-- 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é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).
+Les packages peuvent être téléchargés à partir de [site web officiel] (https://www.dolibarr.org/).
-- 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'installateur...
+### Configuration avancée
+Vous pouvez aussi utiliser un serveur Web et une base de données prise en charge (MariaDB, MySQL ou PostgreSQL) pour installer la version standard.
+
+- Décompressez l'archive .zip téléchargée pour copier le répertoire "dolibarr/htdocs" et tous ses fichiers à la racine du serveur Web ou récupérez-les directement à partir de GitHub (recommandé si vous connaissez git):
+
+ git clone https://github.com/dolibarr/dolibarr -b x.y (où x.y est la version principale comme 3.6, 9.0, ...)
+
+- Configurez votre serveur Web pour qu'il utilise "*dolibarr/htdocs*" en tant que racine si votre serveur Web ne possède pas déjà de répertoire défini vers lequel pointer.
+
+- Créez un fichier `htdocs/conf/conf.php` vide et définissez les autorisations d'*écrire* pour l'utilisateur de votre serveur Web (l'autorisation *écrire* sera supprimée une fois l'installation terminée)
+
+- Depuis votre navigateur, allez à la page "install/" de dolibarr
+
+ L’URL dépendra de la façon dont votre configuration Web a été configurée pour pointer vers votre installation de dolibarr. Cela peut ressembler à:
+
+ http://localhost/dolibarr/htdocs/install/
+
+ ou
+
+ http://localhost/dolibarr/install/
+
+ ou
+
+ http://yourdolibarrvirtualhost/install/
+
+- Suivez les instructions de l'installateur
## METTRE A JOUR DOLIBARR
diff --git a/README.md b/README.md
index bcff409035f..9dfd1a8a750 100644
--- a/README.md
+++ b/README.md
@@ -29,27 +29,6 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
## INSTALLING
-### Download
-
-Releases can be downloaded from [official website](https://www.dolibarr.org/).
-
-### Install from composer
-
-If you do not already have Composer installed, you may do so by following the instructions at [getcomposer.org](https://getcomposer.org/). On Linux and macOS, you may run the following commands:
-
-```bash
-curl -sS https://getcomposer.org/installer | php
-mv composer.phar /usr/local/bin/composer
-```
-
-On Windows, you can download and run https://getcomposer.org/Composer-Setup.exe
-
-You can then create a new project
-
-```bash
-composer create-project dolibarr/dolibarr erp
-```
-
### Simple setup
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions:
@@ -58,16 +37,23 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM
- DoliDeb for Debian or Ubuntu
- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
+Releases can be downloaded from [official website](https://www.dolibarr.org/).
+
### Advanced setup
You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) to install the standard version.
-- Uncompress the downloaded archive
-- Copy the "dolibarr" directory and all its files inside your web server root or anywhere you'd like and set up your web server to use "*dolibarr/htdocs*" as root for a new web server virtual host (second choice need to be server administrator)
-- Create an empty `htdocs/conf/conf.php` file and set permissions for your web server user (*write* permissions will be removed once install is finished)
+- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you known git):
+
+ git clone https://github.com/dolibarr/dolibarr -b x.y (where x.y is main version like 3.6, 9.0, ...)
+
+- Set up your web server to use "*dolibarr/htdocs*" as root if you'r web server does not have directory to point to already defined.
+
+- Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished)
+
- From your browser, go to the dolibarr "install/" page
- The URL will depends on choices made in the first step:
+ The URL will depends on how you web setup was setup to point to your dolibarr installation. It may looks like:
http://localhost/dolibarr/htdocs/install/
@@ -81,6 +67,11 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL)
- Follow the installer instructions
+### Saas/Cloud setup
+
+If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
+
+
## UPGRADING
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index 14f28a71edc..bbdfa564183 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -589,7 +589,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/dav/tests`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
+ $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index e405c9256a6..9420e7846f6 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -546,14 +546,14 @@ if (! empty($arrayfields['t.label_operation']['checked']))
// Debit
if (! empty($arrayfields['t.debit']['checked']))
{
- print '
\n";
@@ -340,7 +340,7 @@ while ($i < min($num, $limit))
// Affiche un Sous-Total par compte comptable
if (isset($displayed_account_number)) {
- print '
'.$langs->trans("SubTotal").':
'.price($sous_total_debit).'
'.price($sous_total_credit).'
';
+ print '
'.$langs->trans("SubTotal").':
'.price($sous_total_debit).'
'.price($sous_total_credit).'
';
print "
\n";
print "
\n";
print '
';
@@ -401,7 +401,7 @@ while ($i < min($num, $limit))
// Affiche un Sous-Total du dernier compte comptable affiché
print '
';
-print '
'.$langs->trans("SubTotal").':
'.price($sous_total_debit).'
'.price($sous_total_credit).'
';
+print '
'.$langs->trans("SubTotal").':
'.price($sous_total_debit).'
'.price($sous_total_credit).'
';
print "
\n";
print "
\n";
print '
';
@@ -409,11 +409,11 @@ print '';
// Affiche le Total
print '
';
$enabledisablehtml = $langs->trans("EnablePublicSubscriptionForm").' ';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 738b538540a..a69ab8ec29c 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -2520,7 +2520,7 @@ class Adherent extends CommonObject
/**
- * Charge les informations d'ordre info dans l'objet adherent
+ * Load type info information in the member object
*
* @param int $id Id of member to load
* @return void
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 5bf09ae4b6d..9fd7a9b9d38 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -164,7 +164,7 @@ class AdherentType extends CommonObject
}
/**
- * Met a jour en base donnees du type
+ * Updating the type in the database
*
* @param User $user Object user making change
* @param int $notrigger 1=do not execute triggers, 0 otherwise
@@ -234,9 +234,9 @@ class AdherentType extends CommonObject
}
/**
- * Fonction qui permet de supprimer le status de l'adherent
+ * Function to delete the member's status
*
- * @return int >0 if OK, 0 if not found, < 0 if KO
+ * @return int > 0 if OK, 0 if not found, < 0 if KO
*/
function delete()
{
@@ -267,7 +267,7 @@ class AdherentType extends CommonObject
}
/**
- * Fonction qui permet de recuperer le status de l'adherent
+ * Function that retrieves the status of the member
*
* @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 3332f6be23a..8828a72df28 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -566,7 +566,7 @@ if (! empty($arrayfields['d.tms']['checked']))
// Status
if (! empty($arrayfields['d.statut']['checked']))
{
- print '
';
diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php
index bd9b4c9b176..25e983887df 100644
--- a/htdocs/blockedlog/admin/blockedlog.php
+++ b/htdocs/blockedlog/admin/blockedlog.php
@@ -116,7 +116,7 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
// Example with a yes / no select
print '
';
-if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR))
-{
+if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) {
// This is version that is faster but require more memory and report errors that are outside the filter range
// TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index f70500d3b08..53c027639fc 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -117,11 +117,11 @@ if ($resql)
//print "
';
}
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
new file mode 100644
index 00000000000..5c8dd23a332
--- /dev/null
+++ b/htdocs/contact/consumption.php
@@ -0,0 +1,657 @@
+
+ * Copyright (C) 2004-2016 Laurent Destailleur
+ * Copyright (C) 2013-2015 Juanjo Menent
+ * Copyright (C) 2015 Marcos García
+ * Copyright (C) 2015-2017 Ferran Marcet
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/societe/consumption.php
+ * \ingroup societe
+ * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty
+ */
+
+require "../main.inc.php";
+require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
+
+// Security check
+$id = GETPOST('id', 'int');
+
+$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
+$object = new Contact($db);
+if ($id > 0) $object->fetch($id);
+if(empty($object->thirdparty)) $object->fetch_thirdparty();
+$socid = $object->thirdparty->id;
+
+// Sort & Order fields
+$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
+$sortfield = GETPOST("sortfield",'alpha');
+$sortorder = GETPOST("sortorder",'alpha');
+$page = GETPOST("page",'int');
+if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortorder) $sortorder='DESC';
+if (! $sortfield) $sortfield='dateprint';
+
+// Search fields
+$sref=GETPOST("sref");
+$sprod_fulldescr=GETPOST("sprod_fulldescr");
+$month = GETPOST('month','int');
+$year = GETPOST('year','int');
+
+// Clean up on purge search criteria ?
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
+{
+ $sref='';
+ $sprod_fulldescr='';
+ $year='';
+ $month='';
+}
+// Customer or supplier selected in drop box
+$thirdTypeSelect = GETPOST("third_select_id");
+$type_element = GETPOST('type_element')?GETPOST('type_element'):'';
+
+// Load translation files required by the page
+$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
+
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('consumptioncontact'));
+
+
+/*
+ * Actions
+ */
+
+$parameters=array('id'=>$id);
+$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');
+
+
+/*
+ * View
+ */
+$form = new Form($db);
+$formother = new FormOther($db);
+$productstatic=new Product($db);
+$objsoc = new Societe($db);
+
+$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
+$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
+llxHeader('',$title,$help_url);
+
+if (empty($id))
+{
+ dol_print_error($db);
+ exit;
+}
+
+$head = contact_prepare_head($object);
+dol_fiche_head($head, 'consumption', $langs->trans("ContactsAddresses"), -1, 'contact');
+
+$linkback = ''.$langs->trans("BackToList").'';
+
+$morehtmlref='
';
+
+if ($object->thirdparty->client)
+{
+ $thirdTypeArray['customer']=$langs->trans("customer");
+ if ($conf->propal->enabled && $user->rights->propal->lire) $elementTypeArray['propal']=$langs->transnoentitiesnoconv('Proposals');
+ if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->transnoentitiesnoconv('Orders');
+ if ($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->transnoentitiesnoconv('Invoices');
+ if ($conf->contrat->enabled && $user->rights->contrat->lire) $elementTypeArray['contract']=$langs->transnoentitiesnoconv('Contracts');
+}
+
+if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) $elementTypeArray['fichinter']=$langs->transnoentitiesnoconv('Interventions');
+
+if ($object->thirdparty->fournisseur)
+{
+ $thirdTypeArray['supplier']=$langs->trans("supplier");
+ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice']=$langs->transnoentitiesnoconv('SuppliersInvoices');
+ if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->transnoentitiesnoconv('SuppliersOrders');
+
+ // There no contact type for supplier proposals
+// if ($conf->fournisseur->enabled && $user->rights->supplier_proposal->lire) $elementTypeArray['supplier_proposal']=$langs->transnoentitiesnoconv('SupplierProposals');
+}
+
+print '
';
+
+print '
';
+
+dol_fiche_end();
+print ' ';
+
+
+print '";
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 66cb3cc53f7..dc610854ead 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6355,10 +6355,13 @@ abstract class CommonObject
// Show only the key field in params
if (is_array($params) && array_key_exists('onlykey', $params) && $key != $params['onlykey']) continue;
+ // @TODO Add test also on 'enabled' (different than 'list' that is 'visibility')
$enabled = 1;
- if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))
+
+ $visibility = 1;
+ if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key]))
{
- $enabled = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1);
+ $visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1);
}
$perms = 1;
@@ -6367,7 +6370,7 @@ abstract class CommonObject
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1);
}
- if (($mode == 'create' || $mode == 'edit') && abs($enabled) != 1 && abs($enabled) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
+ if (($mode == 'create' || $mode == 'edit') && abs($visibility) != 1 && abs($visibility) != 3) continue; // <> -1 and <> 1 and <> 3 = not visible on forms, only on list
if (empty($perms)) continue;
// Load language if required
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 950a58352ca..39a46ada4e7 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1358,18 +1358,23 @@ function complete_elementList_with_modules(&$elementList)
*
* @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label)
* where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ...
- * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all
+ * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all (form is output by caller, recommanded)
* @param string $helptext Help
* @return void
*/
function form_constantes($tableau, $strictw3c = 0, $helptext = '')
{
- global $db,$bc,$langs,$conf,$user;
+ global $db,$langs,$conf,$user;
global $_Avery_Labels;
$form = new Form($db);
- if (! empty($strictw3c) && $strictw3c == 1) print "\n".'