Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2024-07-25 14:51:48 +02:00
10 changed files with 16 additions and 9 deletions

View File

@@ -413,6 +413,7 @@ return [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time
'PhanTypeObjectUnsetDeclaredProperty',

View File

@@ -66,6 +66,7 @@ $config['suppress_issue_types'] = [
'PhanCompatibleNegativeStringOffset', // return false positive
'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
'PhanPluginUnknownArrayPropertyType', // this option costs more time to be supported than it solves time
'PhanTypeArraySuspiciousNullable', // this option costs more time to be supported than it solves time
'PhanTypeInvalidDimOffset', // this option costs more time to be supported than it solves time
'PhanTypeObjectUnsetDeclaredProperty',

View File

@@ -1896,7 +1896,7 @@ class ActionComm extends CommonObject
/**
* Return label of type of event
*
* @param string $mode 0=Mode short, 1=Mode long
* @param int $mode 0=Mode short, 1=Mode long
* @return string HTML String
*/
public function getTypeLabel($mode = 0)

View File

@@ -139,7 +139,7 @@ abstract class CommonObject
/**
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array();

View File

@@ -464,6 +464,10 @@ class modBom extends DolibarrModules
//$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'mrp', '$conf->bom->enabled');
//$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'mrp', '$conf->bom->enabled');
$result = $this->_load_tables('/install/mysql/', 'bom');
if ($result < 0) {
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
}
// Permissions
$this->remove($options);

View File

@@ -256,7 +256,7 @@ class modHoliday extends DolibarrModules
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'holiday as d';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'holiday_extrafields as extra on d.rowid = extra.fk_object';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_holiday_types as t ON t.rowid = d.fk_type';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_holiday_types as t ON t.rowid = d.fk_type AND t.entity IN ('.getEntity('c_holiday_types').')';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as ua ON ua.rowid = d.fk_validator,';
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'user as u';
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user_extrafields as extrau ON u.rowid = extrau.fk_object';

View File

@@ -755,7 +755,7 @@ class Holiday extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error = 0;
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type);
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type, true);
if ($checkBalance > 0) {
$balance = $this->getCPforUser($this->fk_user, $this->fk_type);
@@ -878,7 +878,7 @@ class Holiday extends CommonObject
{
$error = 0;
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type);
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type, true);
if ($checkBalance > 0) {
$balance = $this->getCPforUser($this->fk_user, $this->fk_type);
@@ -1006,7 +1006,7 @@ class Holiday extends CommonObject
global $conf, $langs;
$error = 0;
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type);
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type, true);
if ($checkBalance > 0 && $this->status != self::STATUS_DRAFT) {
$balance = $this->getCPforUser($this->fk_user, $this->fk_type);
@@ -2277,6 +2277,7 @@ class Holiday extends CommonObject
$sql = "SELECT rowid, code, label, affect, delay, newbymonth";
$sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types";
$sql .= " WHERE (fk_country IS NULL OR fk_country = ".((int) $mysoc->country_id).')';
$sql .= " AND entity IN (".getEntity('c_holiday_types').")";
if ($active >= 0) {
$sql .= " AND active = ".((int) $active);
}

View File

@@ -409,4 +409,3 @@ UPDATE llx_c_units SET short_label = 'mn' WHERE short_label = 'i' AND code = 'MI
ALTER TABLE llx_c_holiday_types DROP INDEX uk_c_holiday_types;
ALTER TABLE llx_c_holiday_types ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_c_holiday_types ADD UNIQUE INDEX uk_c_holiday_types (entity, code);

View File

@@ -2159,7 +2159,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
// Description (used in invoice, propal...)
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
// We use dolibarr_details as type of DolEditor here, because we must not accept images, as description is included into PDF and external links are not accepted by TCPDF.
$doleditor = new DolEditor('desc', GETPOSTISSET('desc') ? GETPOST('desc', 'restricthtml') : $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_4, '90%');
$doleditor->Create();
@@ -2681,7 +2681,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
}
// Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td class="wordbreakimp wrapimp">'.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).'</td></tr>';
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
print '<td class="wordbreakimp wrapimp"><div class="longmessagecut">'.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).'</div></td></tr>';
// Public URL
if (!getDolGlobalString('PRODUCT_DISABLE_PUBLIC_URL')) {