Merge pull request #22226 from fboitel/fboitel-dev-scrutinizer-11/09/2022

Fix scrutinizer 2
This commit is contained in:
Laurent Destailleur 2022-09-13 01:22:33 +02:00 committed by GitHub
commit f9b5a370ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 6 deletions

View File

@ -876,11 +876,12 @@ class ImportXlsx extends ModeleImports
if (!empty($updatekeys)) {
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
$where = array();
if (empty($lastinsertid)) { // No insert done yet for a parent table
$sqlSelect = "SELECT ".$fname." FROM " . $tablename;
$data = array_combine($listfields, $listvalues);
$where = array();
$filters = array();
foreach ($updatekeys as $key) {
$col = $objimport->array_import_updatekeys[0][$key];
@ -929,6 +930,7 @@ class ImportXlsx extends ModeleImports
// Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object'
$sqlSelect = "SELECT rowid FROM " . $tablename;
if (empty($keyfield)) {
$keyfield = 'rowid';
}

View File

@ -709,7 +709,7 @@ print '<br>';
if (!empty($conn_id)) {
$disconnect = dol_ftp_close($conn_id);
if ($disconnect == false) {
if (!$disconnect) {
setEventMessages($langs->trans("ErrorFTPNodisconnect"), null, 'errors');
}
}

View File

@ -57,6 +57,19 @@ class StockTransfer extends CommonObject
*/
public $isextrafieldmanaged = 1;
/**
* @var string Customer ref
* @deprecated
* @see $ref_customer
*/
public $ref_client;
/**
* @var string Customer ref
*/
public $ref_customer;
/**
* @var string String with name of icon for stocktransfer. Must be the part after the 'object_' into object_stocktransfer.png
*/
@ -140,6 +153,7 @@ class StockTransfer extends CommonObject
public $note_private;
public $date_creation;
public $tms;
public $lead_time_for_warning;
public $fk_user_creat;
public $fk_user_modif;
public $import_key;

View File

@ -232,7 +232,6 @@ class StockTransferLine extends CommonObjectLine
// Reset some properties
unset($object->id);
unset($object->fk_user_creat);
unset($object->import_key);

View File

@ -368,7 +368,7 @@ if (empty($reshook)) {
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
if ($mailfile->error || $mailfile->errors) {
if ($mailfile->error || !empty($mailfile->errors)) {
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} else {
$result = $mailfile->sendfile();
@ -409,7 +409,7 @@ if (empty($reshook)) {
}
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subject, $sendto, $from, $message_admin, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, -1, '', '', 'tic'.$object->id, '', 'ticket');
if ($mailfile->error || $mailfile->errors) {
if ($mailfile->error || !empty($mailfile->errors)) {
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} else {
$result = $mailfile->sendfile();

View File

@ -1654,7 +1654,7 @@ class Ticket extends CommonObject
$sendtocc = '';
$deliveryreceipt = 0;
$mailfile = new CMailFile($subject, $info_sendto['email'], $from, $tmpmessage, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0);
if ($mailfile->error || $mailfile->errors) {
if ($mailfile->error || !empty($mailfile->errors)) {
setEventMessages($mailfile->error, $mailfile->errors, 'errors');
} else {
$result = $mailfile->sendfile();