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

Conflicts:
	htdocs/comm/action/list.php
This commit is contained in:
Laurent Destailleur 2022-01-07 16:00:19 +01:00
commit 60b2479389
5 changed files with 39 additions and 39 deletions

View File

@ -881,6 +881,8 @@ while ($i < min($num, $limit)) {
$actionstatic->label = $obj->label; $actionstatic->label = $obj->label;
$actionstatic->location = $obj->location; $actionstatic->location = $obj->location;
$actionstatic->note_private = dol_htmlentitiesbr($obj->note); $actionstatic->note_private = dol_htmlentitiesbr($obj->note);
$actionstatic->datep = $db->jdate($obj->dp);
$actionstatic->percentage = $obj->percent;
// Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid // Initialize $this->userassigned && this->socpeopleassigned array && this->userownerid
// but only if we need it // but only if we need it
@ -953,16 +955,7 @@ while ($i < min($num, $limit)) {
print '<td class="center nowraponall">'; print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser'); print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
$late = 0; $late = 0;
if ($obj->percent == 0 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) { if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
$late = 1;
}
if ($obj->percent == 0 && !$obj->dp && $obj->dp2 && $db->jdate($obj->dp) < ($now - $delay_warning)) {
$late = 1;
}
if ($obj->percent > 0 && $obj->percent < 100 && $obj->dp2 && $db->jdate($obj->dp2) < ($now - $delay_warning)) {
$late = 1;
}
if ($obj->percent > 0 && $obj->percent < 100 && !$obj->dp2 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning)) {
$late = 1; $late = 1;
} }
if ($late) { if ($late) {

View File

@ -399,21 +399,23 @@ class Utils
if ($execmethod == 2) { // With this method, there is no way to get the return code, only output if ($execmethod == 2) { // With this method, there is no way to get the return code, only output
$handlein = popen($fullcommandclear, 'r'); $handlein = popen($fullcommandclear, 'r');
$i = 0; $i = 0;
while (!feof($handlein)) { if ($handlein) {
$i++; // output line number while (!feof($handlein)) {
$read = fgets($handlein); $i++; // output line number
// Exclude warning line we don't want $read = fgets($handlein);
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) { // Exclude warning line we don't want
continue; if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) {
} continue;
fwrite($handle, $read); }
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) { fwrite($handle, $read);
$ok = 1; if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) {
} elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) { $ok = 1;
$ok = 1; } elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) {
$ok = 1;
}
} }
pclose($handlein);
} }
pclose($handlein);
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@stocks.sourceforge.net> /* Copyright (C) 2017 Laurent Destailleur <eldy@stocks.sourceforge.net>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -290,7 +291,7 @@ class pdf_standard extends ModelePDFStock
$pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
$tab_top = 80 + $top_shift; $tab_top = 65 + $top_shift;
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10); $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext; $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
@ -319,7 +320,7 @@ class pdf_standard extends ModelePDFStock
$i = 0; $i = 0;
$nblines = $num; $nblines = $num;
$this->tabTitleHeight = 0; $this->tabTitleHeight = 10;
$nexY = $tab_top + $this->tabTitleHeight; $nexY = $tab_top + $this->tabTitleHeight;
for ($i = 0; $i < $nblines; $i++) { for ($i = 0; $i < $nblines; $i++) {
@ -357,14 +358,16 @@ class pdf_standard extends ModelePDFStock
$showpricebeforepagebreak = 1; $showpricebeforepagebreak = 1;
$pdf->startTransaction(); $pdf->startTransaction();
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pdf->writeHTMLCell($this->wref, 3, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true);
//pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc);
$pageposafter = $pdf->getPage(); $pageposafter = $pdf->getPage();
if ($pageposafter > $pageposbefore) { // There is a pagebreak if ($pageposafter > $pageposbefore) { // There is a pagebreak
$pdf->rollbackTransaction(true); $pdf->rollbackTransaction(true);
$pageposafter = $pageposbefore; $pageposafter = $pageposbefore;
//print $pageposafter.'-'.$pageposbefore;exit; //print $pageposafter.'-'.$pageposbefore;exit;
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pdf->writeHTMLCell($this->wref, 4, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true);
//pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc);
$pageposafter = $pdf->getPage(); $pageposafter = $pdf->getPage();
$posyafter = $pdf->GetY(); $posyafter = $pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text
@ -417,8 +420,8 @@ class pdf_standard extends ModelePDFStock
$productstatic->status_batch = $objp->tobatch; $productstatic->status_batch = $objp->tobatch;
// Ref. // Ref.
$pdf->SetXY($this->posxdesc, $curY); //$pdf->SetXY($this->posxdesc, $curY);
$pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L'); //$pdf->MultiCell($this->wref, 3, $productstatic->ref, 0, 'L');
// Label // Label
$pdf->SetXY($this->posxlabel + 0.8, $curY); $pdf->SetXY($this->posxlabel + 0.8, $curY);
@ -505,7 +508,7 @@ class pdf_standard extends ModelePDFStock
/** /**
* Footer table * Footer table
*/ */
$nexY = $pdf->GetY(); //$nexY = $pdf->GetY();
$nexY += 2; $nexY += 2;
$curY = $nexY; $curY = $nexY;
@ -569,11 +572,11 @@ class pdf_standard extends ModelePDFStock
$height_note = 0; $height_note = 0;
} }
$iniY = $tab_top + 7; /*$iniY = $tab_top + 7;
$curY = $tab_top + 7; $curY = $tab_top + 7;
$nexY = $tab_top + 7; $nexY = $tab_top + 7;
$tab_top = $tab_top_newpage + 25 + $top_shift; $tab_top = $tab_top_newpage + 25 + $top_shift;*/
// Show square // Show square
if ($pagenb == 1) { if ($pagenb == 1) {
@ -726,10 +729,12 @@ class pdf_standard extends ModelePDFStock
$pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 2, $outputlangs->transnoentities("EstimatedStockValueSellShort"), '', 'R'); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 2, $outputlangs->transnoentities("EstimatedStockValueSellShort"), '', 'R');
} }
$pdf->SetDrawColor(200, 200, 200); if (empty($hidetop)) {
$pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200))); $pdf->SetDrawColor(200, 200, 200);
$pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200)));
$pdf->SetLineStyle(array('dash'=>0)); $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10);
$pdf->SetLineStyle(array('dash' => 0));
}
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@ -2252,7 +2252,7 @@ class ExpenseReport extends CommonObject
$sql = "SELECT DISTINCT ur.fk_user"; $sql = "SELECT DISTINCT ur.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd"; $sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve'; $sql .= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';
$sql .= "UNION"; $sql .= " UNION";
$sql .= " SELECT DISTINCT ugu.fk_user"; $sql .= " SELECT DISTINCT ugu.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd"; $sql .= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve'; $sql .= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';

View File

@ -226,10 +226,10 @@ insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '05','',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '05','',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '06','',1,'FLANDRE-ORIENTALE','Flandre-Orientale'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '06','',1,'FLANDRE-ORIENTALE','Flandre-Orientale');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '07','',2,'HAINAUT','Hainaut'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '07','',2,'HAINAUT','Hainaut');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '08','',2,'LIEGE','Liège'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '08','',2,'LIEGE','Liège');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '09','',1,'LIMBOURG','Limbourg'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '09','',1,'LIMBOURG','Limbourg');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '10','',2,'LUXEMBOURG','Luxembourg'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '10','',2,'LUXEMBOURG','Luxembourg');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201, '11','',2,'NAMUR','Namur'); insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (202, '11','',2,'NAMUR','Namur');
-- Brazil Provinces (id country=56) -- Brazil Provinces (id country=56)