Skip to content

Commit

Permalink
Merge branch '20.0' into 20_fixmigration
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Jul 25, 2024
2 parents ffcfa91 + a1ed02f commit bfb8962
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions htdocs/core/modules/modBom.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ public function init($options = '')
//$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);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/modHoliday.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function __construct($db)
$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';
Expand Down
7 changes: 4 additions & 3 deletions htdocs/holiday/class/holiday.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ public function validate($user = null, $notrigger = 0)
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);
Expand Down Expand Up @@ -878,7 +878,7 @@ public function approve($user = null, $notrigger = 0)
{
$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);
Expand Down Expand Up @@ -1006,7 +1006,7 @@ public function update($user = null, $notrigger = 0)
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);
Expand Down Expand Up @@ -2277,6 +2277,7 @@ public function getTypes($active = -1, $affect = -1)
$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);
}
Expand Down

0 comments on commit bfb8962

Please sign in to comment.