Skip to content

Commit

Permalink
Merge branch '20.0' of [email protected]:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 16, 2024
2 parents 6e42c6e + 3b96812 commit 19462bf
Show file tree
Hide file tree
Showing 228 changed files with 2,026 additions and 1,982 deletions.
4 changes: 2 additions & 2 deletions htdocs/admin/dict.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
$tabsql[DICT_TYPE_CONTAINER] = "SELECT t.rowid as rowid, t.code, t.label, t.active, t.module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity($tabname[DICT_TYPE_CONTAINER]).")";
//$tabsql[DICT_UNITS]= "SELECT t.rowid as rowid, t.code, t.label, t.short_label, t.active FROM ".MAIN_DB_PREFIX."c_units as t";
$tabsql[DICT_STCOMM] = "SELECT t.id as rowid, t.code, t.libelle, t.picto, t.active FROM ".MAIN_DB_PREFIX."c_stcomm as t";
$tabsql[DICT_HOLIDAY_TYPES] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
$tabsql[DICT_HOLIDAY_TYPES] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid WHERE h.entity IN (".getEntity($tabname[DICT_HOLIDAY_TYPES]).")";
$tabsql[DICT_LEAD_STATUS] = "SELECT t.rowid as rowid, t.code, t.label, percent, t.position, t.active FROM ".MAIN_DB_PREFIX."c_lead_status as t";
$tabsql[DICT_FORMAT_CARDS] = "SELECT t.rowid, t.code, t.name, t.paper_size, t.orientation, t.metric, t.leftmargin, t.topmargin, t.nx, t.ny, t.spacex, t.spacey, t.width, t.height, t.font_size, t.custom_x, t.custom_y, t.active FROM ".MAIN_DB_PREFIX."c_format_cards as t";
$tabsql[DICT_INVOICE_SUBTYPE] = "SELECT t.rowid, t.code, t.label, c.label as country, c.code as country_code, t.fk_country as country_id, t.active FROM ".MAIN_DB_PREFIX."c_invoice_subtype as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_country = c.rowid";
Expand Down Expand Up @@ -470,7 +470,7 @@
$tabfieldinsert[DICT_TYPE_CONTAINER] = "code,label,entity";
//$tabfieldinsert[DICT_UNITS]= "code,label,short_label";
$tabfieldinsert[DICT_STCOMM] = "code,libelle,picto";
$tabfieldinsert[DICT_HOLIDAY_TYPES] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder";
$tabfieldinsert[DICT_HOLIDAY_TYPES] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder,entity";
$tabfieldinsert[DICT_LEAD_STATUS] = "code,label,percent,position";
$tabfieldinsert[DICT_FORMAT_CARDS] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
$tabfieldinsert[DICT_INVOICE_SUBTYPE] = "fk_country,code,label";
Expand Down
6 changes: 5 additions & 1 deletion htdocs/core/tpl/extrafields_list_search_param.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@
$param .= '&'.$search_options_pattern.$tmpkey.'[]='.urlencode($val2);
}
} else {
// test if we have checkbox type , we add the _multiselect needed into param
// test if we have checkbox type, we add the _multiselect needed into param
$tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key);
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('checkbox', 'chkbxlst'))) {
$param .= '&'.$search_options_pattern.$tmpkey.'_multiselect='.urlencode($val);
}
// test if we have boolean type, we add the _booleand needed into param
if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$tmpkey], array('boolean'))) {
$param .= '&'.$search_options_pattern.$tmpkey.'_boolean='.urlencode($val);
}

$param .= '&'.$search_options_pattern.$tmpkey.'='.urlencode($val);
}
Expand Down
17 changes: 9 additions & 8 deletions htdocs/imports/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,11 @@
$tmpstring1 = $line['example1'];
$tmpstring2 = '';
}
$tmpstring1 = strtolower(str_replace('*', '', trim($tmpstring1)));
$tmpstring2 = strtolower(str_replace('*', '', trim($tmpstring2)));
$tmpstring1 = strtolower(dol_string_unaccent(str_replace('*', '', trim($tmpstring1))));
$tmpstring2 = strtolower(dol_string_unaccent(str_replace('*', '', trim($tmpstring2))));

// $tmpstring1 and $tmpstring2 are string from input file.
// $tmpstring1 and $tmpstring2 are string from the input file title of column "Label (fieldname)".
// $tmpval is array of target fields read from the module import profile.
foreach ($tmpval['labelkeyarray'] as $tmpval2) {
$labeltarget = $langs->transnoentities($tmpval2);
//var_dump($tmpstring1.' - '.$tmpstring2.' - '.$tmpval['labelkey'].' - '.$tmpval['label'].' - '.$tmpval2.' - '.$labeltarget);
Expand Down Expand Up @@ -1529,7 +1530,7 @@

// STEP 5: Summary of choices and launch simulation
if ($step == 5 && $datatoimport) {
$max_execution_time_for_importexport = (!getDolGlobalString('IMPORT_MAX_EXECUTION_TIME') ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_execution_time_for_importexport = getDolGlobalInt('IMPORT_MAX_EXECUTION_TIME', 300); // 5mn if not defined
$max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport) {
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
Expand Down Expand Up @@ -1568,7 +1569,7 @@

$nboflines = $obj->import_get_nb_of_lines($conf->import->dir_temp.'/'.$filetoimport);

$param = '&leftmenu=import&format='.urlencode($format).'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines).'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure);
$param = '&leftmenu=import&format='.urlencode($format).'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.((int) $nboflines).'&separator='.urlencode($separator).'&enclosure='.urlencode($enclosure);
$param2 = $param; // $param2 = $param without excludefirstline and endatlinenb
if ($excludefirstline) {
$param .= '&excludefirstline='.urlencode($excludefirstline);
Expand Down Expand Up @@ -2018,7 +2019,7 @@

// STEP 6: Real import
if ($step == 6 && $datatoimport) {
$max_execution_time_for_importexport = (!getDolGlobalString('IMPORT_MAX_EXECUTION_TIME') ? 300 : $conf->global->IMPORT_MAX_EXECUTION_TIME); // 5mn if not defined
$max_execution_time_for_importexport = getDolGlobalInt('IMPORT_MAX_EXECUTION_TIME', 300); // 5mn if not defined
$max_time = @ini_get("max_execution_time");
if ($max_time && $max_time < $max_execution_time_for_importexport) {
dol_syslog("max_execution_time=".$max_time." is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.". We try to increase it dynamically.");
Expand Down Expand Up @@ -2056,9 +2057,9 @@
$obj->import_close_file();
}

$nboflines = GETPOST("nboflines", dol_count_nb_of_line($conf->import->dir_temp.'/'.$filetoimport));
$nboflines = (GETPOSTISSET("nboflines") ? GETPOSTINT("nboflines") : dol_count_nb_of_line($conf->import->dir_temp.'/'.$filetoimport));

$param = '&format='.$format.'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.urlencode($nboflines);
$param = '&format='.$format.'&datatoimport='.urlencode($datatoimport).'&filetoimport='.urlencode($filetoimport).'&nboflines='.((int) $nboflines);
if ($excludefirstline) {
$param .= '&excludefirstline='.urlencode($excludefirstline);
}
Expand Down
Loading

0 comments on commit 19462bf

Please sign in to comment.