Skip to content

Commit

Permalink
Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 18, 2019
2 parents 29974a5 + f44182c commit 5f917c6
Show file tree
Hide file tree
Showing 35 changed files with 144 additions and 110 deletions.
9 changes: 9 additions & 0 deletions dev/dolibarr_changes.txt
Expand Up @@ -27,6 +27,15 @@ With



ESCPOS:
-------
Replace
private $connector;
With
protected $connector;



NUSOAP:
-------
* In file nusoap.php, to avoid a warning,
Expand Down
20 changes: 9 additions & 11 deletions htdocs/accountancy/admin/journals_list.php
Expand Up @@ -162,7 +162,7 @@
{
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"]))
Expand Down Expand Up @@ -437,7 +437,7 @@
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature");
$valuetoshow=$langs->trans("NatureOfJournal");
}

if ($valuetoshow != '') {
Expand Down Expand Up @@ -516,24 +516,22 @@
}

// Title line with search boxes
print '<tr class="liste_titre_filter liste_titre_add">';
/*print '<tr class="liste_titre_filter liste_titre_add">';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre center">';
if ($filterfound)
{
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
}
$searchpicto=$form->showFilterButtons();
print $searchpicto;
print '</td>';
print '</tr>';

*/

// Title of lines
print '<tr class="liste_titre">';
print '<tr class="liste_titre liste_titre_add">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
Expand All @@ -558,7 +556,7 @@
$valuetoshow=$langs->trans("Label");
}
if ($fieldlist[$field]=='nature') {
$valuetoshow=$langs->trans("Nature");
$valuetoshow=$langs->trans("NatureOfJournal");
}

// Affiche nom du champ
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/admin/productaccount.php
Expand Up @@ -462,7 +462,7 @@
// print '<td class="left">' . $obj->description . '</td>';
// 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 '<td style="' . $code_sell_p_l_differ . '">' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
print '<td>' . nl2br(dol_trunc($obj->description, $trunclengh)) . '</td>';
}

if ($accounting_product_mode == 'ACCOUNTANCY_SELL' || $accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA' || $accounting_product_mode == 'ACCOUNTANCY_SELL_EXPORT')
Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/journal/bankjournal.php
Expand Up @@ -964,7 +964,7 @@

$varlink = 'id_journal=' . $id_journal;

journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
journalHead($nom, '', $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);


// Test that setup is complete
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/card.php
Expand Up @@ -653,7 +653,7 @@

if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
$error++;
}
else {
Expand Down Expand Up @@ -734,7 +734,7 @@

if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
$error++;
}
else {
Expand Down
3 changes: 2 additions & 1 deletion htdocs/adherents/class/adherent.class.php
Expand Up @@ -2438,6 +2438,7 @@ public function initAsSpecimen()


// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
Expand All @@ -2447,7 +2448,7 @@ public function initAsSpecimen()
* 2=Return key only (uid=qqq)
* @return string DN
*/
private function _load_ldap_dn($info, $mode = 0)
public function _load_ldap_dn($info, $mode = 0)
{
// phpcs:enable
global $conf;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/subscription/list.php
Expand Up @@ -229,7 +229,7 @@
if ($date_select) $param.="&date_select=".urlencode($date_select);
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
if ($search_login) $param.="&search_login=".urlencode($search_login);
if ($search_acount) $param.="&search_account=".urlencode($search_account);
if ($search_account) $param.="&search_account=".urlencode($search_account);
if ($search_amount) $param.="&search_amount=".urlencode($search_amount);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
Expand Down
6 changes: 3 additions & 3 deletions htdocs/bom/class/bom.class.php
Expand Up @@ -889,7 +889,7 @@ public function getLinesArray()
$this->lines=array();

$objectline = new BOMLine($this->db);
$result = $objectline->fetchAll('ASC', 'rank', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));

if (is_numeric($result))
{
Expand Down Expand Up @@ -1044,7 +1044,7 @@ class BOMLine extends CommonObject
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
'qty' => array('type'=>'double(24,8)', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'position'=>100, 'notnull'=>1, 'isameasure'=>'1',),
'efficiency' => array('type'=>'double(8,4)', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>110, 'notnull'=>1, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLoss'),
'rank' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,),
'position' => array('type'=>'integer', 'label'=>'Rank', 'enabled'=>1, 'visible'=>0, 'position'=>200, 'notnull'=>1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
);
public $rowid;
Expand All @@ -1053,7 +1053,7 @@ class BOMLine extends CommonObject
public $description;
public $qty;
public $efficiency;
public $rank;
public $position;
public $import_key;
// END MODULEBUILDER PROPERTIES

Expand Down
4 changes: 2 additions & 2 deletions htdocs/commande/card.php
Expand Up @@ -1519,11 +1519,11 @@
if ($element == 'order' || $element == 'commande') {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
elseif ($element == 'propal') {
$element = 'comm/propal';
$subelement = 'propal';
}
if ($element == 'contract') {
elseif ($element == 'contract') {
$element = $subelement = 'contrat';
}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/fiche-rec.php
Expand Up @@ -1423,8 +1423,8 @@
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
$list = array();
$models = ModelePDFFactures::liste_modeles($db);
foreach ($models as $model) {
$list[] = $model . ':' . $model;
foreach ($models as $k => $model) {
$list[] = str_replace(':', '|', $k) . ':' . $model;
}
$select = 'select;'.implode(',', $list);
print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select);
Expand Down
11 changes: 6 additions & 5 deletions htdocs/compta/prelevement/class/bonprelevement.class.php
Expand Up @@ -1393,7 +1393,7 @@ public function generate($format = 'ALL', $executiondate = '')

$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
$sql.= " f.ref as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum";
$sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
Expand All @@ -1419,7 +1419,7 @@ public function generate($format = 'ALL', $executiondate = '')
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum);
$this->total = $this->total + $obj->somme;
$i++;
}
Expand Down Expand Up @@ -1624,15 +1624,16 @@ public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
* @param string $row_cg pl.code_guichet AS cg, Not used for SEPA
* @param string $row_cc pl.number AS cc, Not used for SEPA
* @param string $row_somme pl.amount AS somme,
* @param string $row_ref f.ref
* @param string $row_ref f.ref
* @param string $row_idfac pf.fk_facture AS idfac,
* @param string $row_iban rib.iban_prefix AS iban,
* @param string $row_bic rib.bic AS bic,
* @param string $row_datec rib.datec,
* @param string $row_drum rib.rowid used to generate rum
* @param string $row_rum rib.rum Rum defined on company bank account
* @return string Return string with SEPA part DrctDbtTxInf
*/
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_ref, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum)
{
// phpcs:enable
global $conf;
Expand All @@ -1644,7 +1645,7 @@ public function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address,

// Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum);
$Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum;

// Define date of RUM signature
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/stats/byratecountry.php
Expand Up @@ -38,7 +38,7 @@
// Load translation files required by the page
$langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy"));

$modecompta = GETPOST('modecompta', 'alpha');
$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE);

// Date range
$year=GETPOST("year", 'int');
Expand Down
3 changes: 2 additions & 1 deletion htdocs/contact/class/contact.class.php
Expand Up @@ -498,6 +498,7 @@ public function update($id, $user = null, $notrigger = 0, $action = 'update', $n


// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
Expand All @@ -507,7 +508,7 @@ public function update($id, $user = null, $notrigger = 0, $action = 'update', $n
* 2=Return key only (uid=qqq)
* @return string DN
*/
private function _load_ldap_dn($info, $mode = 0)
public function _load_ldap_dn($info, $mode = 0)
{
// phpcs:enable
global $conf;
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -10,7 +10,7 @@
* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
Expand Down Expand Up @@ -2443,9 +2443,9 @@ public function line_down($rowid, $fk_parent_line = true)
*/
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;
Expand Down Expand Up @@ -2749,7 +2749,7 @@ public function update_price($exclspec = 0, $roundingadjust = 'none', $nodatabas
$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";
Expand Down
2 changes: 2 additions & 0 deletions htdocs/core/class/extrafields.class.php
Expand Up @@ -1627,6 +1627,8 @@ public function showOutputField($key, $value, $moreparam = '', $extrafieldsobjec

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')
{
Expand Down
9 changes: 5 additions & 4 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -154,7 +154,7 @@ public function editfieldkey($text, $htmlname, $preselected, $object, $perm, $ty
* @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')
Expand All @@ -174,7 +174,7 @@ public function editfieldval($text, $htmlname, $value, $object, $perm, $typeofda
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);
}
Expand Down Expand Up @@ -231,7 +231,8 @@ public function editfieldval($text, $htmlname, $value, $object, $perm, $typeofda
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);
}
Expand Down Expand Up @@ -300,7 +301,7 @@ public function editfieldval($text, $htmlname, $value, $object, $perm, $typeofda
* @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')
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/html.formother.class.php
Expand Up @@ -422,7 +422,7 @@ public function select_salesrepresentatives($selected, $htmlname, $user, $showst
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))";
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('usergroup')."))";
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
}
}
Expand All @@ -445,7 +445,7 @@ public function select_salesrepresentatives($selected, $htmlname, $user, $showst
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))";
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('usergroup')."))";
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -1579,7 +1579,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
{
$langs->load("mrp");

$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
$newmenu->add("", $langs->trans("MenuBOM"), 0, $user->rights->bom->read, '', $mainmenu, 'bom');
$newmenu->add("/bom/bom_card.php?leftmenu=bom&amp;action=create", $langs->trans("NewBOM"), 1, $user->rights->bom->write);
$newmenu->add("/bom/bom_list.php?leftmenu=bom", $langs->trans("List"), 1, $user->rights->bom->read);
}
Expand Down

0 comments on commit 5f917c6

Please sign in to comment.