From deb140e3bc536f8399126056e37a3f3d2682015b Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 7 Feb 2016 09:19:51 +0100 Subject: [PATCH] Fixes to export [skip ci] --- app/Export/Collector/AttachmentCollector.php | 13 ++++++++++--- resources/lang/en_US/firefly.php | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index 976fa4b5cc..443aa187f6 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -83,9 +83,16 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface { /** @var TransactionJournal $journal */ $journal = $attachment->attachable; - $string = 'Attachment #' . $attachment->id . ' is part of ' . strtolower($journal->transactionType->type) . ' #' . $journal->id - . ', with description "' . $journal->description . '". This transaction was for ' . Amount::formatJournal($journal, false) . - ' and occured on ' . $journal->date->formatLocalized(config('config.month_and_day')) . "\n\n"; + $args = [ + 'attachment_name' => $attachment->filename, + 'attachment_id' => $attachment->id, + 'type' => strtolower($journal->transactionType->type), + 'description' => $journal->description, + 'journal_id' => $journal->id, + 'date' => $journal->date->formatLocalized(trans('config.month_and_day')), + 'amount' => Amount::formatJournal($journal, false), + ]; + $string = trans('firefly.attachment_explanation', $args) . "\n"; $this->explanationString .= $string; } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 790c2b5bbe..2097de254c 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -74,6 +74,7 @@ return [ 'export_status_created_zip_file' => 'Created a zip file!', 'export_status_finished' => 'Export has succesfully finished! Yay!', 'export_data_please_wait' => 'Please wait...', + 'attachment_explanation' => 'The file called \':attachment_name\' (#:attachment_id) was originally uploaded to :type \':description\' (#:journal_id) dated :date for the amount of :amount.', // rules 'rules' => 'Rules',