Fix yogosha#11976

This commit is contained in:
Laurent Destailleur 2022-08-04 16:17:07 +02:00
parent 39dccc4fdf
commit 0a623ab068
2 changed files with 21 additions and 16 deletions

View File

@ -203,25 +203,30 @@ if ($action == 'builddoc') {
$forceimgscalewidth = (empty($conf->global->BARCODE_FORCEIMGSCALEWIDTH) ? 1 : $conf->global->BARCODE_FORCEIMGSCALEWIDTH);
$forceimgscaleheight = (empty($conf->global->BARCODE_FORCEIMGSCALEHEIGHT) ? 1 : $conf->global->BARCODE_FORCEIMGSCALEHEIGHT);
for ($i = 0; $i < $numberofsticker; $i++) {
$arrayofrecords[] = array(
'textleft'=>$textleft,
'textheader'=>$textheader,
'textfooter'=>$textfooter,
'textright'=>$textright,
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
);
$MAXSTICKERS = 1000;
if ($numberofsticker <= $MAXSTICKERS) {
for ($i = 0; $i < $numberofsticker; $i++) {
$arrayofrecords[] = array(
'textleft'=>$textleft,
'textheader'=>$textheader,
'textfooter'=>$textfooter,
'textright'=>$textright,
'code'=>$code,
'encoding'=>$encoding,
'is2d'=>$is2d,
'photo'=>$barcodeimage // Photo must be a file that exists with format supported by TCPDF
);
}
} else {
$mesg = $langs->trans("ErrorQuantityIsLimitedTo", $MAXSTICKERS);
$error++;
}
}
$i++;
$mesg = '';
// Build and output PDF
if ($mode == 'label') {
if (!$error && $mode == 'label') {
if (!count($arrayofrecords)) {
$mesg = $langs->trans("ErrorRecordNotFound");
}
@ -240,7 +245,7 @@ if ($action == 'builddoc') {
}
}
if ($result <= 0 || $mesg) {
if ($result <= 0 || $mesg || $error) {
if (empty($mesg)) {
$mesg = 'Error '.$result;
}
@ -272,8 +277,6 @@ print '<br>';
print '<span class="opacitymedium">'.$langs->trans("PageToGenerateBarCodeSheets", $langs->transnoentitiesnoconv("BuildPageToPrint")).'</span><br>';
print '<br>';
dol_htmloutput_errors($mesg);
//print img_picto('','puce').' '.$langs->trans("PrintsheetForOneBarCode").'<br>';
//print '<br>';

View File

@ -289,6 +289,8 @@ ErrorInvoiceLoadThirdPartyKey=Third-party key "%s" no set for invoice "%s"
ErrorDeleteLineNotAllowedByObjectStatus=Delete line is not allowed by current object status
ErrorAjaxRequestFailed=Request failed
ErrorThirpdartyOrMemberidIsMandatory=Third party or Member of partnership is mandatory
ErrorFailedToWriteInTempDirectory=Failed to write in temp directory
ErrorQuantityIsLimitedTo=Quantity is limited to %s
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.