diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 6d7c5bf82fd..6b2c02de197 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -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'; } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 857d41fc85b..74a459328f4 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -709,7 +709,7 @@ print '
'; if (!empty($conn_id)) { $disconnect = dol_ftp_close($conn_id); - if ($disconnect == false) { + if (!$disconnect) { setEventMessages($langs->trans("ErrorFTPNodisconnect"), null, 'errors'); } } diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index d0f27eb46f4..a71098fc2bf 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -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; diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index a5d49dcc3a7..14febad09d4 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -232,7 +232,6 @@ class StockTransferLine extends CommonObjectLine // Reset some properties unset($object->id); - unset($object->fk_user_creat); unset($object->import_key); diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index b4df70e3dd8..e982a4507b8 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -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(); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 5306b0c0141..df581d96fdc 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -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();