From 9c2bf86fea950268afdba8647d339cec456c395e Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:47:38 +0200 Subject: [PATCH 1/7] Paging for exporting transaction history until work processor is implemented --- local/languages/finna/en-gb.ini | 2 +- local/languages/finna/fi.ini | 2 +- local/languages/finna/sv.ini | 2 +- .../Finna/Controller/MyResearchController.php | 98 +++++++++---------- .../finna2/templates/checkouts/history.phtml | 21 +++- 5 files changed, 68 insertions(+), 57 deletions(-) diff --git a/local/languages/finna/en-gb.ini b/local/languages/finna/en-gb.ini index 6ee91623ff4..4ac27d2f4fc 100644 --- a/local/languages/finna/en-gb.ini +++ b/local/languages/finna/en-gb.ini @@ -599,7 +599,7 @@ list_order_saved = "Sort order saved" list-tags-info = "Add a new keyword" Loading = "Loading" Loan Details = "Loan Details" -loan_history_download = "Export all" +loan_history_download = "Export all in page" loan_history_download_csv = "Export CSV" loan_history_download_ods = "Export OpenOffice (ods)" loan_history_download_xlsx = "Export Excel (xlsx)" diff --git a/local/languages/finna/fi.ini b/local/languages/finna/fi.ini index 49457eb14fe..66e17185bfb 100644 --- a/local/languages/finna/fi.ini +++ b/local/languages/finna/fi.ini @@ -589,7 +589,7 @@ list_order_saved = "Järjestys tallennettu" list-tags-info = "Lisää uusi avainsana" Loading = "Ladataan" Loan Details = "Lainan tiedot" -loan_history_download = "Vie kaikki" +loan_history_download = "Vie kaikki sivulta" loan_history_download_csv = "Vie CSV" loan_history_download_ods = "Vie OpenOffice (ods)" loan_history_download_xlsx = "Vie Excel (xlsx)" diff --git a/local/languages/finna/sv.ini b/local/languages/finna/sv.ini index fd87e1c5ade..e3e84c7b4a9 100644 --- a/local/languages/finna/sv.ini +++ b/local/languages/finna/sv.ini @@ -587,7 +587,7 @@ list_order_saved = "Sortering sparad" list-tags-info = "Lägg till nytt nyckelord" Loading = "Laddar" Loan Details = "Information om lånet" -loan_history_download = "Exportera alla" +loan_history_download = "Exportera alla på sidan" loan_history_download_csv = "Exportera CSV" loan_history_download_ods = "Exportera OpenOffice (ods)" loan_history_download_xlsx = "Exportera Excel (xlsx)" diff --git a/module/Finna/src/Finna/Controller/MyResearchController.php b/module/Finna/src/Finna/Controller/MyResearchController.php index b5e9fa9fca0..9be2eb547c9 100644 --- a/module/Finna/src/Finna/Controller/MyResearchController.php +++ b/module/Finna/src/Finna/Controller/MyResearchController.php @@ -1356,8 +1356,10 @@ public function downloadLoanHistoryAction() throw new \Exception('Invalid parameters.'); } + $page = (int)$this->params()->fromQuery('page', 1); + $sort = $this->params()->fromQuery('sort', ''); $recordLoader = $this->serviceLocator->get(\VuFind\Record\Loader::class); - $page = 1; + $config = $this->getConfig(); try { $tmp = fopen('php://temp/maxmemory:' . (5 * 1024 * 1024), 'r+'); $header = [ @@ -1377,55 +1379,50 @@ public function downloadLoanHistoryAction() if ('xlsx' === $fileFormat) { Cell::setValueBinder(new AdvancedValueBinder()); } - do { - // Try to use large page size, but take ILS limits into account - $pageOptions = $this->getPaginationHelper() - ->getOptions($page, null, 1000, $functionConfig); - $result = $catalog - ->getMyTransactionHistory($patron, $pageOptions['ilsParams']); - - if (isset($result['success']) && !$result['success']) { - $this->flashMessenger()->addErrorMessage($result['status']); - return $this->redirect()->toRoute('checkouts-history'); - } + $pageOptions = $this->getPaginationHelper()->getOptions( + $page, + $sort, + $config->Catalog->historic_loan_page_size ?? 50, + $functionConfig + ); + $result = $catalog->getMyTransactionHistory($patron, $pageOptions['ilsParams']); - $ids = []; - foreach ($result['transactions'] as $current) { - $id = $current['id'] ?? ''; - $source = $current['source'] ?? DEFAULT_SEARCH_BACKEND; - $ids[] = compact('id', 'source'); - } - $records = $recordLoader->loadBatch($ids, true); - foreach ($result['transactions'] as $i => $current) { - $driver = $records[$i]; - $format = $driver->getFormats(); - $format = end($format); - $author = $driver->tryMethod('getNonPresenterAuthors'); - - $loan = []; - $loan[] = $current['title'] ?? $driver->getTitle() ?? ''; - $loan[] = $this->translate($format); - $loan[] = $author[0]['name'] ?? ''; - $loan[] = $current['publication_year'] ?? ''; - $loan[] = empty($current['institution_name']) - ? '' - : $this->translateWithPrefix('location_', $current['institution_name']); - $loan[] = empty($current['borrowingLocation']) - ? '' - : $this->translateWithPrefix('location_', $current['borrowingLocation']); - $loan[] = $current['checkoutDate'] ?? ''; - $loan[] = $current['returnDate'] ?? ''; - $loan[] = $current['dueDate'] ?? ''; - - $nextRow = $worksheet->getHighestRow() + 1; - $worksheet->fromArray($loan, null, 'A' . (string)$nextRow); - } + if (isset($result['success']) && !$result['success']) { + $this->flashMessenger()->addErrorMessage($result['status']); + return $this->redirect()->toRoute('checkouts-history'); + } - $pageEnd = $pageOptions['ilsPaging'] - ? ceil($result['count'] / $pageOptions['limit']) - : 1; - $page++; - } while ($page <= $pageEnd); + $ids = []; + foreach ($result['transactions'] as $current) { + $id = $current['id'] ?? ''; + $source = $current['source'] ?? DEFAULT_SEARCH_BACKEND; + $ids[] = compact('id', 'source'); + } + $records = $recordLoader->loadBatch($ids, true); + foreach ($result['transactions'] as $i => $current) { + $driver = $records[$i]; + $format = $driver->getFormats(); + $format = end($format); + $author = $driver->tryMethod('getNonPresenterAuthors'); + + $loan = []; + $loan[] = $current['title'] ?? $driver->getTitle() ?? ''; + $loan[] = $this->translate($format); + $loan[] = $author[0]['name'] ?? ''; + $loan[] = $current['publication_year'] ?? ''; + $loan[] = empty($current['institution_name']) + ? '' + : $this->translateWithPrefix('location_', $current['institution_name']); + $loan[] = empty($current['borrowingLocation']) + ? '' + : $this->translateWithPrefix('location_', $current['borrowingLocation']); + $loan[] = $current['checkoutDate'] ?? ''; + $loan[] = $current['returnDate'] ?? ''; + $loan[] = $current['dueDate'] ?? ''; + + $nextRow = $worksheet->getHighestRow() + 1; + $worksheet->fromArray($loan, null, 'A' . (string)$nextRow); + } if ('xlsx' === $fileFormat) { $worksheet->getStyle('G2:I' . $worksheet->getHighestRow()) ->getNumberFormat() @@ -1442,11 +1439,12 @@ public function downloadLoanHistoryAction() ); $writer = new $this->exportFormats[$fileFormat]['writer']($spreadsheet); $writer->save($tmp); - + $fileName = implode('-', ['finna-loan-history-page', $page, $sort,]); + $fileName = str_replace(' ', '-', $fileName) . '.' . $fileFormat; $response->getHeaders() ->addHeaderLine( 'Content-Disposition', - 'attachment; filename="finna-loan-history.' . $fileFormat . '"' + 'attachment; filename="' . $fileName . '"' ); rewind($tmp); diff --git a/themes/finna2/templates/checkouts/history.phtml b/themes/finna2/templates/checkouts/history.phtml index dbcd1c4137f..9057319546c 100644 --- a/themes/finna2/templates/checkouts/history.phtml +++ b/themes/finna2/templates/checkouts/history.phtml @@ -88,18 +88,31 @@ transactions)): ?> +
+ transEsc('loan_history_save')?> +
- + transEsc('loan_history_download')?>
From 0d6b1c25092f9257eb079a9c7ead9860e9dc3be3 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:41:04 +0200 Subject: [PATCH 4/7] QA --- .../Finna/src/Finna/Controller/MyResearchController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/Finna/src/Finna/Controller/MyResearchController.php b/module/Finna/src/Finna/Controller/MyResearchController.php index 15920c1e164..456b8f12a2f 100644 --- a/module/Finna/src/Finna/Controller/MyResearchController.php +++ b/module/Finna/src/Finna/Controller/MyResearchController.php @@ -1352,6 +1352,7 @@ public function downloadLoanHistoryAction() $this->flashMessenger()->addErrorMessage('ils_action_unavailable'); return $this->redirect()->toRoute('checkouts-history'); } + $config = $this->getConfig(); $allowedFileFormats = ['csv', 'ods', 'xlsx']; if (!$this->formWasSubmitted('submitLoanHistoryRequest')) { $pageOptions = $this->getPaginationHelper()->getOptions( @@ -1360,7 +1361,7 @@ public function downloadLoanHistoryAction() $config->Catalog->historic_loan_page_size ?? 50, $functionConfig ); - // Get checked out item details: + // Get checked out item details: $result = $catalog->getMyTransactionHistory($patron, $pageOptions['ilsParams']); $paginator = $this->getPaginationHelper()->getPaginator( $pageOptions, @@ -1394,7 +1395,7 @@ public function downloadLoanHistoryAction() if (!in_array($fileFormat, $allowedFileFormats)) { throw new \Exception('Should be not here.'); } - + $startPage = (int)$requestCombined['startIndex']; $lastPage = (int)($requestCombined['lastIndex'] ?? $startPage); $alternativeLimit = $startPage + 9; @@ -1403,7 +1404,6 @@ public function downloadLoanHistoryAction() } $recordLoader = $this->serviceLocator->get(\VuFind\Record\Loader::class); - $config = $this->getConfig(); $tmp = fopen('php://temp/maxmemory:' . (5 * 1024 * 1024), 'r+'); $header = [ @@ -1417,7 +1417,7 @@ public function downloadLoanHistoryAction() $this->translate('Return Date'), $this->translate('Due Date'), ]; - + if ($file = $requestCombined['append_file']['tmp_name'] ?? null) { $fileFormatLimit = [ \PhpOffice\PhpSpreadsheet\IOFactory::READER_CSV, From 4cfe9cca6791e1ac18652cb147ad5fd8a759c76e Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:46:30 +0200 Subject: [PATCH 5/7] Adjusted translations --- local/languages/finna/en-gb.ini | 2 +- local/languages/finna/sv.ini | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/local/languages/finna/en-gb.ini b/local/languages/finna/en-gb.ini index c9d0cf9525b..796fa9ff9e0 100644 --- a/local/languages/finna/en-gb.ini +++ b/local/languages/finna/en-gb.ini @@ -603,7 +603,7 @@ loan_history_download = "Download loan history" loan_history_download_csv = "CSV" loan_history_download_ods = "OpenOffice (ods)" loan_history_download_xlsx = "Excel (xlsx)" -loan_history_info = "Select starting page for downloading loan history. Download starts from the first page and 9 following pages." +loan_history_info = "Select first page for downloading loan history. Download starts from the first page and includes 9 following pages." loan_history_pages = "Pages available to download: %%total%%" loan_history_append_file = "Choose a file where to append loan history" loan_history_create_new_file = "Or create a new file" diff --git a/local/languages/finna/sv.ini b/local/languages/finna/sv.ini index 31d8dde5488..9fa438e9784 100644 --- a/local/languages/finna/sv.ini +++ b/local/languages/finna/sv.ini @@ -591,9 +591,9 @@ loan_history_download = "Ladda lånehistorik" loan_history_download_csv = "CSV" loan_history_download_ods = "OpenOffice (ods)" loan_history_download_xlsx = "Excel (xlsx)" -loan_history_info = "Välja första sidan att ladda lånehistorik. Laddning börjar från första sidan och innehåller nästa 9 sidorna." -loan_history_pages = "Sidorna tillgänglig för laddning: %%total%%" -loan_history_append_file = "Välj filen för att fortsätta nedladdningen" +loan_history_info = "Välja startsida för att ladda ner lånehistorik. Nedladdningen börjar från den första sidan och innehåller de följande 9 sidorna." +loan_history_pages = "Sidorna tillgängliga för nedladdning: %%total%%" +loan_history_append_file = "Välj en fil för att fortsätta nedladdningen" loan_history_create_new_file = "Eller skapa en ny fil" loan_history_purge = "Rensa historiken" loan_history_purge_prompt_html = "Är du säker på att du vill rensa din utlåningshistorik? Raderad historik kan inte återskapas." From 33616de2cfbf1041b034dd69b6fa979d309a6fc9 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:09:34 +0200 Subject: [PATCH 6/7] Adjustments to loan history downloading --- local/config/finna/config.ini.sample | 4 + local/languages/finna/en-gb.ini | 5 +- local/languages/finna/fi.ini | 5 +- local/languages/finna/sv.ini | 5 +- .../Finna/Controller/MyResearchController.php | 121 +++++++----------- .../templates/checkouts/downloadhistory.phtml | 59 +++++---- .../finna2/templates/checkouts/history.phtml | 2 +- 7 files changed, 90 insertions(+), 111 deletions(-) diff --git a/local/config/finna/config.ini.sample b/local/config/finna/config.ini.sample index 022fd5b5e79..180a0539b89 100644 --- a/local/config/finna/config.ini.sample +++ b/local/config/finna/config.ini.sample @@ -311,6 +311,10 @@ library_cards = true ; memory problems for users with a large number of historic loans). Default = 50 ;historic_loan_page_size = 50 +; Limit for how many historic transactions to fetch at most from ILS +; when downloading loan history +loan_history_download_batch_limit = 1000 + ; Whether to display the item barcode for each loan. Default is false. display_checked_out_item_barcode = true diff --git a/local/languages/finna/en-gb.ini b/local/languages/finna/en-gb.ini index 796fa9ff9e0..a8f2c5227d8 100644 --- a/local/languages/finna/en-gb.ini +++ b/local/languages/finna/en-gb.ini @@ -603,10 +603,9 @@ loan_history_download = "Download loan history" loan_history_download_csv = "CSV" loan_history_download_ods = "OpenOffice (ods)" loan_history_download_xlsx = "Excel (xlsx)" -loan_history_info = "Select first page for downloading loan history. Download starts from the first page and includes 9 following pages." +loan_history_info = "Pages downloaded at most %%total%%" loan_history_pages = "Pages available to download: %%total%%" -loan_history_append_file = "Choose a file where to append loan history" -loan_history_create_new_file = "Or create a new file" +loan_history_choose_file_format = "Choose file format" loan_history_purge = "Purge History" loan_history_purge_prompt_html = "Are you sure you will purge the loan history? Cleared loan history cannot be retrieved anymore." loan_history_purge_selected = "Purge Selected" diff --git a/local/languages/finna/fi.ini b/local/languages/finna/fi.ini index 2a0e6763341..cf169d2609e 100644 --- a/local/languages/finna/fi.ini +++ b/local/languages/finna/fi.ini @@ -593,10 +593,9 @@ loan_history_download = "Lataa lainaushistoria" loan_history_download_csv = "CSV" loan_history_download_ods = "OpenOffice (ods)" loan_history_download_xlsx = "Excel (xlsx)" -loan_history_info = "Valitse aloitussivu lainahistorian lataamiselle. Sivuja ladataan ensimmäinen valittu sivu ja 9 seuraavaa." +loan_history_info = "Sivuja ladataan korkeintaan %%total%%" loan_history_pages = "Sivuja ladattavana: %%total%%" -loan_history_append_file = "Valitse tiedosto, mihin lainahistoriaa jatketaan" -loan_history_create_new_file = "Tai luo uusi tiedosto" +loan_history_choose_file_format = "Valitse tiedostomuoto" loan_history_purge = "Tyhjennä historia" loan_history_purge_prompt_html = "Oletko varma, että haluat tyhjentää lainaushistoriasi? Tyhjennettyä historiaa ei saa takaisin." loan_history_purge_selected = "Poista valitut" diff --git a/local/languages/finna/sv.ini b/local/languages/finna/sv.ini index 9fa438e9784..e543beeb5c0 100644 --- a/local/languages/finna/sv.ini +++ b/local/languages/finna/sv.ini @@ -591,10 +591,9 @@ loan_history_download = "Ladda lånehistorik" loan_history_download_csv = "CSV" loan_history_download_ods = "OpenOffice (ods)" loan_history_download_xlsx = "Excel (xlsx)" -loan_history_info = "Välja startsida för att ladda ner lånehistorik. Nedladdningen börjar från den första sidan och innehåller de följande 9 sidorna." +loan_history_info = "Sidorna laddas högst %%total%%" loan_history_pages = "Sidorna tillgängliga för nedladdning: %%total%%" -loan_history_append_file = "Välj en fil för att fortsätta nedladdningen" -loan_history_create_new_file = "Eller skapa en ny fil" +loan_history_choose_file_format = "Välja filformat" loan_history_purge = "Rensa historiken" loan_history_purge_prompt_html = "Är du säker på att du vill rensa din utlåningshistorik? Raderad historik kan inte återskapas." loan_history_purge_selected = "Radera valda" diff --git a/module/Finna/src/Finna/Controller/MyResearchController.php b/module/Finna/src/Finna/Controller/MyResearchController.php index 456b8f12a2f..a003c471a6c 100644 --- a/module/Finna/src/Finna/Controller/MyResearchController.php +++ b/module/Finna/src/Finna/Controller/MyResearchController.php @@ -1352,111 +1352,61 @@ public function downloadLoanHistoryAction() $this->flashMessenger()->addErrorMessage('ils_action_unavailable'); return $this->redirect()->toRoute('checkouts-history'); } - $config = $this->getConfig(); + $allowedFileFormats = ['csv', 'ods', 'xlsx']; + $historyResult = $this->forwardTo('checkouts', 'history'); + if (!isset($historyResult->transactions)) { + return $historyResult; + } + $batchLimit = $this->getConfig()->Catalog->loan_history_download_batch_limit ?? 1000; + $pagesTotal = $historyResult->paginator ? $historyResult->paginator->count() : 1; + $pagesDownloadCounter = 1; + // Calculate how many times required to fetch from ILS to achieve the $batchLimit + if ($pagesTotal > 1) { + $pagesDownloadCounter = ceil($batchLimit / $historyResult->paginator->getItemCountPerPage()); + } if (!$this->formWasSubmitted('submitLoanHistoryRequest')) { - $pageOptions = $this->getPaginationHelper()->getOptions( - 1, - null, - $config->Catalog->historic_loan_page_size ?? 50, - $functionConfig - ); - // Get checked out item details: - $result = $catalog->getMyTransactionHistory($patron, $pageOptions['ilsParams']); - $paginator = $this->getPaginationHelper()->getPaginator( - $pageOptions, - $result['count'], - $result['transactions'] - ); $view = $this->createViewModel([ - 'paginator' => $paginator, 'fileFormats' => $allowedFileFormats, - 'params' => $pageOptions['ilsParams'], + 'params' => $historyResult->params, + 'pagesTotal' => $pagesTotal, + 'pagesDownloadCounter' => $pagesDownloadCounter, ]); $view->setTemplate('checkouts/downloadhistory.phtml'); return $view; } - $request = $this->getRequest(); if (!$request->isPost()) { throw new \Exception('Invalid method.'); } - $requestCombined = array_merge_recursive( - $request->getPost()->toArray(), - $request->getFiles()->toArray() - ); // Do CSRF check $csrf = $this->serviceLocator->get(\VuFind\Validator\CsrfInterface::class); - if (!$csrf->isValid($requestCombined['csrf'])) { + if (!$csrf->isValid($request->getPost('csrf'))) { throw new \VuFind\Exception\BadRequest('error_inconsistent_parameters'); } - $fileFormat = $requestCombined['history_file_format'] ?? ''; + $fileFormat = $request->getPost('history_file_format', ''); if (!in_array($fileFormat, $allowedFileFormats)) { - throw new \Exception('Should be not here.'); + throw new \Exception('Invalid format.'); } - $startPage = (int)$requestCombined['startIndex']; - $lastPage = (int)($requestCombined['lastIndex'] ?? $startPage); - $alternativeLimit = $startPage + 9; - if ($lastPage > $startPage + 9) { - $lastPage = $alternativeLimit; - } + $startPage = (int)$request->getPost('startPage', 1); + $lastPage = min($startPage + $pagesDownloadCounter, $pagesTotal); $recordLoader = $this->serviceLocator->get(\VuFind\Record\Loader::class); - $tmp = fopen('php://temp/maxmemory:' . (5 * 1024 * 1024), 'r+'); - $header = [ - $this->translate('Title'), - $this->translate('Format'), - $this->translate('Author'), - $this->translate('Publication Year'), - $this->translate('Institution'), - $this->translate('Borrowing Location'), - $this->translate('Checkout Date'), - $this->translate('Return Date'), - $this->translate('Due Date'), - ]; - - if ($file = $requestCombined['append_file']['tmp_name'] ?? null) { - $fileFormatLimit = [ - \PhpOffice\PhpSpreadsheet\IOFactory::READER_CSV, - \PhpOffice\PhpSpreadsheet\IOFactory::READER_ODS, - \PhpOffice\PhpSpreadsheet\IOFactory::READER_XLSX, - ]; - try { - $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file, 0, $fileFormatLimit); - } catch (\Exception $e) { - throw new \Exception('Invalid format'); - } - $worksheet = $spreadsheet->getActiveSheet(); - } else { - $spreadsheet = new Spreadsheet(); - $worksheet = $spreadsheet->getActiveSheet(); - $worksheet->fromArray($header); - } - if ('xlsx' === $fileFormat) { - Cell::setValueBinder(new AdvancedValueBinder()); - } $transactions = []; for ($i = $startPage; $i <= $lastPage; $i++) { - $pageOptions = $this->getPaginationHelper()->getOptions( - $i, - null, - $config->Catalog->historic_loan_page_size ?? 50, - $functionConfig - ); - $result = $catalog->getMyTransactionHistory($patron, $pageOptions['ilsParams']); + $result = $catalog->getMyTransactionHistory($patron, $historyResult->params); if (isset($result['success']) && !$result['success']) { $this->flashMessenger()->addErrorMessage($result['status']); return $this->redirect()->toRoute('checkouts-history'); } - $tempPaginator = $this->getPaginationHelper()->getPaginator( - $pageOptions, - $result['count'], - $result['transactions'] - ); + // Break if no transactions found + if (empty($result['transactions'])) { + break; + } $transactions = array_merge($transactions, $result['transactions']); } $ids = []; @@ -1466,6 +1416,27 @@ public function downloadLoanHistoryAction() $ids[] = compact('id', 'source'); } $records = $recordLoader->loadBatch($ids, true); + + $header = [ + $this->translate('Title'), + $this->translate('Format'), + $this->translate('Author'), + $this->translate('Publication Year'), + $this->translate('Institution'), + $this->translate('Borrowing Location'), + $this->translate('Checkout Date'), + $this->translate('Return Date'), + $this->translate('Due Date'), + ]; + + $spreadsheet = new Spreadsheet(); + $worksheet = $spreadsheet->getActiveSheet(); + $worksheet->fromArray($header); + + if ('xlsx' === $fileFormat) { + Cell::setValueBinder(new AdvancedValueBinder()); + } + foreach ($transactions as $i => $current) { $driver = $records[$i]; $format = $driver->getFormats(); diff --git a/themes/finna2/templates/checkouts/downloadhistory.phtml b/themes/finna2/templates/checkouts/downloadhistory.phtml index c2ac6442826..265a59aa4a0 100644 --- a/themes/finna2/templates/checkouts/downloadhistory.phtml +++ b/themes/finna2/templates/checkouts/downloadhistory.phtml @@ -1,26 +1,33 @@ -

transEsc('loan_history_download')?>

- - -
- transEsc('loan_history_info')?> -
- transEsc('loan_history_pages', ['%%total%%' => $this->paginator->count()])?> -
- - -
-
- - -
-
- - -
- - - + +headTitle($this->translate('loan_history_download')); + + // Set up breadcrumbs: + $this->layout()->breadcrumbs = '
  • ' . $this->transEsc('Your Account') . '
  • ' . $this->transEsc('Loan History') . '
  • '; +?> +context($this)->renderInContext('myresearch/menu.phtml', ['active' => 'historicLoans']); ?> + +
    +

    transEsc('loan_history_download')?>

    +
    + +
    + transEsc('loan_history_info', ['%%total%%' => $this->pagesDownloadCounter])?> +
    + transEsc('loan_history_pages', ['%%total%%' => $this->pagesTotal])?> +
    + + +
    +
    + + +
    + +
    +
    diff --git a/themes/finna2/templates/checkouts/history.phtml b/themes/finna2/templates/checkouts/history.phtml index 52b89293147..cfa22f2ead8 100644 --- a/themes/finna2/templates/checkouts/history.phtml +++ b/themes/finna2/templates/checkouts/history.phtml @@ -92,7 +92,7 @@ transEsc('loan_history_save')?>
    - transEsc('loan_history_download')?> + transEsc('loan_history_download')?>
    From 5573fca782ca6201675ef46a011a52c1c31d94cf Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:13:54 +0200 Subject: [PATCH 7/7] Added comments to template --- themes/finna2/templates/checkouts/downloadhistory.phtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/finna2/templates/checkouts/downloadhistory.phtml b/themes/finna2/templates/checkouts/downloadhistory.phtml index 265a59aa4a0..d21ca6f40f3 100644 --- a/themes/finna2/templates/checkouts/downloadhistory.phtml +++ b/themes/finna2/templates/checkouts/downloadhistory.phtml @@ -1,4 +1,4 @@ - + headTitle($this->translate('loan_history_download')); @@ -31,3 +31,4 @@ +