diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 578bd592a75..a13037402f8 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -113,13 +113,14 @@ Also, some code changes need a prior approbation:
* if you add a new table, you must first create a page on http://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Than ask the project manager (@eldy) if the new data model you plan to add can be accepted as you suggest.
-Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow
-every developer discuss about the PR.
-If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later.
-If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR.
-By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
-Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio in Open Source world, don't expect the core team
-to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
+Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR.
+
+If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
+
+If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet.
+In most cases, it give you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the flag ask you. The majority of PR are waiting a developer action.
+
+Around 95% of submitted PR are reviewed and tagged. Even if this is one of the most important ratio of answered PR in Open Source world, don't expect the core team to reach the 100%. With the increasing popularity of Dolibarr, this ratio will probably decrease in future.
### Resources
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index 60fea392133..b48aa158cce 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -1,6 +1,6 @@
# .scrutinizer.yml
-build:
- - php-scrutinizer-run
+#build:
+# - php-scrutinizer-run
imports:
- javascript
diff --git a/ChangeLog b/ChangeLog
index 472c3ffba81..c425872e9c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,7 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->libelle_incoterms were renamed into ->label_incoterms
-
+* Removed the method liste_array() of project class. It was not used by core code.
***** ChangeLog for 10.0.0 compared to 9.0.0 *****
@@ -414,7 +414,7 @@ NEW: add option PROPOSAL_AUTO_ADD_AUTHOR_AS_CONTACT
NEW: Add option to display thirdparty adress in combolist
NEW: Add option to swap sender/recipient address on PDF
NEW: Add option to display thirdparty adress in combolist
-NEW: Add project on pament of salaries
+NEW: Add project on payment of salaries
NEW: Add SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME and
NEW: Add somes hooks in bank planned entries
NEW: Add supplier ref in item reception page
diff --git a/build/phpstan/bootstrap.php b/build/phpstan/bootstrap.php
index e567b609a2f..6b6fd7b292e 100644
--- a/build/phpstan/bootstrap.php
+++ b/build/phpstan/bootstrap.php
@@ -8,7 +8,7 @@ define('DOL_DOCUMENT_ROOT', __DIR__ . '/../../htdocs');
define('DOL_DATA_ROOT', __DIR__ . '/../../documents');
define('DOL_URL_ROOT', '/');
-// Load the main.inc.php file to have finctions llx_Header and llx_Footer defined
+// Load the main.inc.php file to have functions llx_Header and llx_Footer defined
if (! defined("NOLOGIN")) define("NOLOGIN", '1');
global $conf, $langs, $user, $db;
include_once __DIR__ . '/../../htdocs/main.inc.php';
diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 5bad55fd4d2..e87b082dd06 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -27,6 +27,15 @@ With
+ESCPOS:
+-------
+Replace
+ private $connector;
+With
+ protected $connector;
+
+
+
NUSOAP:
-------
* In file nusoap.php, to avoid a warning,
diff --git a/htdocs/.gitignore b/htdocs/.gitignore
index ac35d8fab2f..d51eaffd235 100644
--- a/htdocs/.gitignore
+++ b/htdocs/.gitignore
@@ -28,3 +28,4 @@
/nomenclature*
/of/
/workstation/
+/oblyon*
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index cac81bfbcae..78cd92f90e0 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -162,7 +162,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
{
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
- if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature';
+ if ($fieldnamekey == 'nature') $fieldnamekey = 'NatureOfJournal';
}
// Other checks
if (isset($_POST["code"]))
@@ -437,7 +437,7 @@ if ($id)
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
- $valuetoshow=$langs->trans("Nature");
+ $valuetoshow=$langs->trans("NatureOfJournal");
}
if ($valuetoshow != '') {
@@ -516,7 +516,7 @@ if ($id)
}
// Title line with search boxes
- print '
';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
@@ -558,7 +556,7 @@ if ($id)
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
- $valuetoshow=$langs->trans("Nature");
+ $valuetoshow=$langs->trans("NatureOfJournal");
}
// Affiche nom du champ
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 562dfd1505b..1c72ea61abd 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -462,7 +462,7 @@ if ($result)
// print '
' . $obj->description . '
';
// TODO: we shoul set a user defined value to adjust user square / wide screen size
$trunclengh = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
- print '
';
print "\n";
diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php
deleted file mode 100644
index 7d2b897f761..00000000000
--- a/htdocs/contrat/info.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- * Copyright (C) 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/contrat/info.php
- * \ingroup contrat
- * \brief Page des informations d'un contrat
- */
-
-require "../main.inc.php";
-require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
-if (! empty($conf->projet->enabled)) {
- require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
-}
-
-// Load translation files required by the page
-$langs->load("contracts");
-
-$action = GETPOST('action', 'alpha');
-$confirm = GETPOST('confirm', 'alpha');
-$id = GETPOST('id', 'int');
-$ref = GETPOST('ref', 'alpha');
-
-// Security check
-if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'contrat', $id, '');
-
-// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
-$hookmanager->initHooks(array('contractcard','globalcard'));
-
-
-/*
- * Actions
- */
-
-// None
-
-
-
-/*
- * View
- */
-
-$form = new Form($db);
-
-llxHeader('', $langs->trans("Contract"), "");
-
-$object = new Contrat($db);
-$object->fetch($id, $ref);
-if ($object->id > 0)
-{
- $object->fetch_thirdparty();
-}
-
-$object->info($object->id);
-
-$head = contract_prepare_head($object);
-
-dol_fiche_head($head, 'info', $langs->trans("Contract"), -1, 'contract');
-
-
-// Contract card
-
-$linkback = ''.$langs->trans("BackToList").'';
-
-
-$morehtmlref='';
-//if (! empty($modCodeContract->code_auto)) {
-$morehtmlref.=$object->ref;
-/*} else {
- $morehtmlref.=$form->editfieldkey("",'ref',$object->ref,0,'string','',0,3);
-$morehtmlref.=$form->editfieldval("",'ref',$object->ref,0,'string','',0,2);
-}*/
-
-$morehtmlref.='
';
-
-dol_fiche_end();
-
-
-llxFooter();
-$db->close();
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f3832ff2782..43ba2499680 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -10,8 +10,8 @@
* Copyright (C) 2015 Alexandre Spangaro
* Copyright (C) 2016 Bahfir abbes
* Copyright (C) 2017 ATM Consulting
- * Copyright (C) 2017 Nicolas ZABOURI
- * Copyright (C) 2017 Rui Strecht
+ * Copyright (C) 2017-2019 Nicolas ZABOURI
+ * Copyright (C) 2017 Rui Strecht
* Copyright (C) 2018 Frédéric France
* Copyright (C) 2018 Josep Lluís Amador
*
@@ -53,6 +53,7 @@ abstract class CommonObject
/**
* @var string Error string
+ * @see $errors
*/
public $error;
@@ -2443,9 +2444,9 @@ abstract class CommonObject
*/
public function updateRangOfLine($rowid, $rang)
{
- $fieldposition = 'rang'; // @TODO Rename 'rang' and 'position' into 'rank'
+ $fieldposition = 'rang'; // @TODO Rename 'rang' into 'position'
if (in_array($this->table_element_line, array('ecm_files', 'emailcollector_emailcollectoraction'))) $fieldposition = 'position';
- if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'rank';
+ if (in_array($this->table_element_line, array('bom_bomline'))) $fieldposition = 'position';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang;
$sql.= ' WHERE rowid = '.$rowid;
@@ -2749,7 +2750,7 @@ abstract class CommonObject
$MODULE = "";
if ($this->element == 'propal')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL";
- elseif ($this->element == 'order')
+ elseif ($this->element == 'commande' || $this->element == 'order')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER";
elseif ($this->element == 'facture')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE";
@@ -6384,7 +6385,7 @@ abstract class CommonObject
* @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan)
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
- * @param string $onetrtd All fields in same tr td
+ * @param string $onetrtd All fields in same tr td (TODO field not used ?)
* @return string
*/
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0)
@@ -6496,10 +6497,7 @@ abstract class CommonObject
$out .= '
';
- if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
- {
- if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; }
- }
+ if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; }
if ($action == 'selectlines') { $colspan++; }
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 9c403b98104..0d76b83cb8a 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -489,7 +489,10 @@ class Conf
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
// By default, suppliers objects can be linked to all projects
- $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
+ if (! isset($this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)) $this->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
+
+ // By default we enable feature to bill time spent
+ if (! isset($this->global->PROJECT_BILL_TIME_SPENT)) $this->global->PROJECT_BILL_TIME_SPENT = 1;
// MAIN_HTML_TITLE
if (! isset($this->global->MAIN_HTML_TITLE)) $this->global->MAIN_HTML_TITLE='noapp,thirdpartynameonly,contactnameonly,projectnameonly';
diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php
index 861d7f737bb..922338999df 100644
--- a/htdocs/core/class/cunits.class.php
+++ b/htdocs/core/class/cunits.class.php
@@ -92,6 +92,7 @@ class CUnits // extends CommonObject
if (isset($this->short_label)) $this->libelle=trim($this->short_label);
if (isset($this->unit_type)) $this->active=trim($this->unit_type);
if (isset($this->active)) $this->active=trim($this->active);
+ if (isset($this->scale)) $this->scale=trim($this->scale);
// Check parameters
// Put here code to add control on parameters values
@@ -103,12 +104,14 @@ class CUnits // extends CommonObject
$sql.= "label,";
$sql.= "short_label,";
$sql.= "unit_type";
+ $sql.= "scale";
$sql.= ") VALUES (";
$sql.= " ".(! isset($this->id)?'NULL':"'".$this->db->escape($this->id)."'").",";
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
$sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").",";
$sql.= " ".(! isset($this->short_label)?'NULL':"'".$this->db->escape($this->short_label)."'").",";
$sql.= " ".(! isset($this->unit_type)?'NULL':"'".$this->db->escape($this->unit_type)."'");
+ $sql.= " ".(! isset($this->scale)?'NULL':"'".$this->db->escape($this->scale)."'");
$sql.= ")";
$this->db->begin();
@@ -173,6 +176,7 @@ class CUnits // extends CommonObject
$sql.= " t.label,";
$sql.= " t.short_label,";
$sql.= " t.unit_type,";
+ $sql.= " t.scale,";
$sql.= " t.active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_units as t";
$sql_where=array();
@@ -196,6 +200,7 @@ class CUnits // extends CommonObject
$this->label = $obj->label;
$this->short_label = $obj->short_label;
$this->unit_type = $obj->unit_type;
+ $this->scale = $obj->scale;
$this->active = $obj->active;
}
$this->db->free($resql);
@@ -235,6 +240,7 @@ class CUnits // extends CommonObject
$sql.= " t.label,";
$sql.= " t.short_label,";
$sql.= " t.unit_type,";
+ $sql.= " t.scale,";
$sql.= " t.active";
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_units as t';
// Manage filter
@@ -279,6 +285,7 @@ class CUnits // extends CommonObject
$record->label = $obj->label;
$record->short_label = $obj->short_label;
$record->unit_type = $obj->unit_type;
+ $record->scale = $obj->scale;
$record->active = $obj->active;
$this->records[$record->id] = $record;
}
@@ -312,6 +319,7 @@ class CUnits // extends CommonObject
if (isset($this->label)) $this->libelle=trim($this->label);
if (isset($this->short_label)) $this->libelle=trim($this->short_label);
if (isset($this->unit_type)) $this->libelle=trim($this->unit_type);
+ if (isset($this->scale)) $this->scale=trim($this->scale);
if (isset($this->active)) $this->active=trim($this->active);
// Check parameters
@@ -323,6 +331,7 @@ class CUnits // extends CommonObject
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
$sql.= " short_label=".(isset($this->short_label)?"'".$this->db->escape($this->short_label)."'":"null").",";
$sql.= " unit_type=".(isset($this->unit_type)?"'".$this->db->escape($this->unit_type)."'":"null").",";
+ $sql.= " scale=".(isset($this->scale)?"'".$this->db->escape($this->scale)."'":"null").",";
$sql.= " active=".(isset($this->active)?$this->active:"null");
$sql.= " WHERE rowid=".$this->id;
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index b8f5c0480b5..0e6b0befef9 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1627,6 +1627,8 @@ class ExtraFields
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
+ //if ($computed) $value = // $value is already calculated into $value before calling this method
+
$showsize=0;
if ($type == 'date')
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 12cf8893005..e829fdf6661 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -154,7 +154,7 @@ class Form
* @param string $value Value to show/edit
* @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter
- * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
+ * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@@ -174,7 +174,7 @@ class Form
if (empty($typeofdata)) return 'ErrorBadParameter';
// When option to edit inline is activated
- if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker
+ if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/', $typeofdata)) // TODO add jquery timepicker and support select
{
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
}
@@ -231,7 +231,8 @@ class Form
foreach($arraydata as $val)
{
$tmp=explode(':', $val);
- $arraylist[$tmp[0]]=$tmp[1];
+ $tmpkey=str_replace('|', ':', $tmp[0]);
+ $arraylist[$tmpkey]=$tmp[1];
}
$ret.=$this->selectarray($htmlname, $arraylist, $value);
}
@@ -300,7 +301,7 @@ class Form
* @param string $value Value to show/edit
* @param string $htmlname DIV ID (field name)
* @param int $condition Condition to edit
- * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
+ * @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly')
* @param string $editvalue When in edit mode, use this value as $value instead of value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@@ -1678,7 +1679,7 @@ class Form
$out .= ajax_combobox($htmlname);
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
- $out.= '