Skip to content
Snippets Groups Projects
Commit 82681faa authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FEAT #16988 TIME 0:30 folderPrint: unified mass and unitary; fixed empty...

FEAT #16988 TIME 0:30 folderPrint: unified mass and unitary; fixed empty filename if main doc not included
parent 847852ba
No related branches found
No related tags found
No related merge requests found
......@@ -218,15 +218,7 @@ class FolderPrintController
$attachment = $originAttachment;
}
if ($withSeparators) {
$documentPaths[] = FolderPrintController::getAttachmentSeparator([
'attachment' => $attachment,
'chronoResource' => $chronoResource
]);
}
$path = FolderPrintController::getDocumentFilePath(['document' => $attachment, 'collId' => 'attachments_coll']);
if (!empty($path['errors'])) {
LogsController::add([
'isTech' => true,
......@@ -237,9 +229,16 @@ class FolderPrintController
'eventType' => 'Error: ' . $path['errors'],
'eventId' => 'FolderPrint Error'
]);
} else {
$documentPaths[] = $path;
continue;
}
if ($withSeparators) {
$documentPaths[] = FolderPrintController::getAttachmentSeparator([
'attachment' => $attachment,
'chronoResource' => $chronoResource
]);
}
$documentPaths[] = $path;
}
}
}
......@@ -560,6 +559,14 @@ class FolderPrintController
}
if (!empty($documentPaths)) {
if (empty($resource['altIdentifier'] . $resource['subject'])) {
$document = ResModel::getById([
'select' => ['alt_identifier', 'subject'],
'resId' => $resource['resId']
]);
$resource['altIdentifier'] = $document['alt_identifier'];
$resource['subject'] = $document['subject'];
}
$filePathOnTmp = trim($tmpDir . TextFormatModel::formatFilename([
'filename' => $resource['altIdentifier'] . '_' . $resource['subject'],
'maxLength' => 100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment