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

This commit is contained in:
Laurent Destailleur 2022-12-31 15:01:24 +01:00
commit 0f763d2606
24 changed files with 81 additions and 41 deletions

View File

@ -945,7 +945,7 @@ class pdf_espadon extends ModelePdfExpedition
* @param Expedition $object Object to show * @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return int <0 if KO, > if OK
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{ {
@ -1078,6 +1078,14 @@ class pdf_espadon extends ModelePdfExpedition
} }
} }
$top_shift = 0;
// Show list of linked objects
/*$current_y = $pdf->getY();
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);
if ($current_y < $pdf->getY()) {
$top_shift = $pdf->getY() - $current_y;
}*/
if ($showaddress) { if ($showaddress) {
// Sender properties // Sender properties
$carac_emetteur = ''; $carac_emetteur = '';
@ -1183,6 +1191,7 @@ class pdf_espadon extends ModelePdfExpedition
} }
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
return $top_shift;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@ -520,7 +520,7 @@ class pdf_merou extends ModelePdfExpedition
* @param Expedition $object Object to show * @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return int <0 if KO, > if OK
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{ {
@ -700,6 +700,16 @@ class pdf_merou extends ModelePdfExpedition
$widthrecbox = $blW; $widthrecbox = $blW;
$top_shift = 0;
// Show list of linked objects
/*
$current_y = $pdf->getY();
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);
if ($current_y < $pdf->getY()) {
$top_shift = $pdf->getY() - $current_y;
}
*/
// Show Recipient frame // Show Recipient frame
$pdf->SetFont('', 'B', $default_font_size - 3); $pdf->SetFont('', 'B', $default_font_size - 3);
$pdf->SetXY($blDestX, $Yoff - 4); $pdf->SetXY($blDestX, $Yoff - 4);
@ -717,5 +727,7 @@ class pdf_merou extends ModelePdfExpedition
$pdf->SetFont('', '', $default_font_size - 3); $pdf->SetFont('', '', $default_font_size - 3);
$pdf->SetXY($blDestX, $posy); $pdf->SetXY($blDestX, $posy);
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
return $top_shift;
} }
} }

View File

@ -890,7 +890,7 @@ class pdf_rouget extends ModelePdfExpedition
* @param Expedition $object Object to show * @param Expedition $object Object to show
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @return void * @return int <0 if KO, > if OK
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{ {
@ -1023,6 +1023,16 @@ class pdf_rouget extends ModelePdfExpedition
} }
} }
$top_shift = 0;
// Show list of linked objects
/*
$current_y = $pdf->getY();
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3, 'R', $default_font_size);
if ($current_y < $pdf->getY()) {
$top_shift = $pdf->getY() - $current_y;
}
*/
if ($showaddress) { if ($showaddress) {
// Sender properties // Sender properties
$carac_emetteur = ''; $carac_emetteur = '';
@ -1128,6 +1138,7 @@ class pdf_rouget extends ModelePdfExpedition
} }
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
return $top_shift;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@ -579,7 +579,7 @@ class ImportCsv extends ModeleImports
} }
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsuppliercodeifauto') { } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsuppliercodeifauto') {
if (strtolower($newval) == 'auto') { if (strtolower($newval) == 'auto') {
$newval = $this->thirdpartyobject->get_codefournisseur(0, 1); $this->thirdpartyobject->get_codefournisseur(0, 1);
$newval = $this->thirdpartyobject->code_fournisseur; $newval = $this->thirdpartyobject->code_fournisseur;
//print 'code_fournisseur='.$newval; //print 'code_fournisseur='.$newval;
} }

View File

@ -624,7 +624,7 @@ class ImportXlsx extends ModeleImports
} }
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsuppliercodeifauto') { } elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsuppliercodeifauto') {
if (strtolower($newval) == 'auto') { if (strtolower($newval) == 'auto') {
$newval = $this->thirdpartyobject->get_codefournisseur(0, 1); $this->thirdpartyobject->get_codefournisseur(0, 1);
$newval = $this->thirdpartyobject->code_fournisseur; $newval = $this->thirdpartyobject->code_fournisseur;
//print 'code_fournisseur='.$newval; //print 'code_fournisseur='.$newval;
} }

View File

@ -941,7 +941,7 @@ class pdf_standard extends ModelePDFMovement
* @param int $showaddress 0=no, 1=yes * @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output * @param Translate $outputlangs Object lang for output
* @param string $titlekey Translation key to show as title of document * @param string $titlekey Translation key to show as title of document
* @return void * @return int Return topshift value
*/ */
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "") protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $titlekey = "")
{ {
@ -1108,8 +1108,13 @@ class pdf_standard extends ModelePDFMovement
$posy += 2; $posy += 2;
$top_shift = 0;
// Show list of linked objects // Show list of linked objects
$current_y = $pdf->getY();
//$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); //$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
//if ($current_y < $pdf->getY()) {
// $top_shift = $pdf->getY() - $current_y;
//}
if ($showaddress) { if ($showaddress) {
/* /*
@ -1146,6 +1151,7 @@ class pdf_standard extends ModelePDFMovement
} }
$pdf->SetTextColor(0, 0, 0); $pdf->SetTextColor(0, 0, 0);
return $top_shift;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore

View File

@ -649,7 +649,7 @@ class TraceableDB extends DoliDB
*/ */
public function free($resultset = null) public function free($resultset = null)
{ {
return $this->db->free($resultset); $this->db->free($resultset);
} }
/** /**

View File

@ -217,7 +217,6 @@ class ConferenceOrBooth extends ActionComm
$this->socid = $this->fk_soc; $this->socid = $this->fk_soc;
$this->datef = $this->datep2; $this->datef = $this->datep2;
$this->note_private = $this->note; $this->note_private = $this->note;
$this->fk_user_author = $this->fk_user_author;
} }
/** /**
@ -716,8 +715,8 @@ class ConferenceOrBooth extends ActionComm
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_conferenceorbooth = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_conferenceorbooth = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -923,8 +923,8 @@ class Evaluation extends CommonObject
$result = $objectline->fetchAll('ASC', '', 0, 0, array('customsql'=>'fk_evaluation = '.$this->id)); $result = $objectline->fetchAll('ASC', '', 0, 0, array('customsql'=>'fk_evaluation = '.$this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -561,7 +561,8 @@ class Evaluationline extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'evaluationline/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'evaluationline/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
$error++; $this->error = $this->db->lasterror(); $error++;
$this->error = $this->db->lasterror();
} }
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments // We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@ -891,8 +892,8 @@ class Evaluationline extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_evaluationdet = '.$this->id)); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_evaluationdet = '.$this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -925,8 +925,8 @@ class Job extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_job = '.$this->id)); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_job = '.$this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -971,8 +971,8 @@ class Position extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = ' . $this->id)); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql' => 'fk_position = ' . $this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -965,8 +965,8 @@ class Skill extends CommonObject
$result = $objectline->fetchAll('ASC', 'rankorder', 0, 0, array('customsql'=>'fk_skill = '.$this->id)); $result = $objectline->fetchAll('ASC', 'rankorder', 0, 0, array('customsql'=>'fk_skill = '.$this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -919,8 +919,8 @@ class SkillRank extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_skillrank = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_skillrank = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -4485,7 +4485,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @param Conf $conf Object conf * @param Conf $conf Object conf
* @return void * @return int <0 if KO, >0 if OK
*/ */
function migrate_reload_menu($db, $langs, $conf) function migrate_reload_menu($db, $langs, $conf)
{ {
@ -4515,6 +4515,8 @@ function migrate_reload_menu($db, $langs, $conf)
print '</td></tr>'; print '</td></tr>';
} }
return 1;
} }
/** /**

View File

@ -918,8 +918,8 @@ class KnowledgeRecord extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_knowledgerecord = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_knowledgerecord = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -1275,8 +1275,8 @@ class Mo extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters); $result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters);
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -1158,8 +1158,8 @@ class Partnership extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_partnership = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_partnership = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -911,8 +911,8 @@ class StockTransfer extends CommonObject
$result = $objectline->fetchAll('ASC', 'rang', 0, 0, array('customsql'=>'fk_stocktransfer = '.$this->id)); $result = $objectline->fetchAll('ASC', 'rang', 0, 0, array('customsql'=>'fk_stocktransfer = '.$this->id));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -915,8 +915,8 @@ class StockTransferLine extends CommonObjectLine
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_stocktransferline = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_stocktransferline = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -467,7 +467,7 @@ if ($id > 0 || !empty($ref)) {
// Task parent // Task parent
print '<tr><td>'.$langs->trans("ChildOfProjectTask").'</td><td>'; print '<tr><td>'.$langs->trans("ChildOfProjectTask").'</td><td>';
print $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id); $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id);
print '</td></tr>'; print '</td></tr>';
// Date start // Date start

View File

@ -894,8 +894,8 @@ class RecruitmentCandidature extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -912,8 +912,8 @@ class Target extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_target = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_target = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} else { } else {
$this->lines = $result; $this->lines = $result;

View File

@ -919,8 +919,8 @@ class Workstation extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_workstation = '.((int) $this->id))); $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_workstation = '.((int) $this->id)));
if (is_numeric($result)) { if (is_numeric($result)) {
$this->error = $this->error; $this->error = $objectline->error;
$this->errors = $this->errors; $this->errors = $objectline->errors;
return $result; return $result;
} }