From 504e9e042bbd7f032c586672f1a27dc0bce39d9e Mon Sep 17 00:00:00 2001 From: Ere Maijala <ere.maijala@helsinki.fi> Date: Tue, 27 Feb 2018 20:23:28 +0200 Subject: [PATCH] Add support for export via POST form and make RefWorks export use it. (#1110) --- config/vufind/export.ini | 23 +++++++++----- languages/ar.ini | 1 + languages/bn.ini | 1 + languages/ca.ini | 1 + languages/cs.ini | 1 + languages/cy.ini | 1 + languages/de.ini | 1 + languages/el.ini | 1 + languages/en.ini | 3 +- languages/es.ini | 1 + languages/eu.ini | 1 + languages/fi.ini | 1 + languages/fr.ini | 1 + languages/gl.ini | 1 + languages/he.ini | 1 + languages/it.ini | 1 + languages/ja.ini | 1 + languages/nl.ini | 1 + languages/pl.ini | 1 + languages/pt-br.ini | 1 + languages/pt.ini | 1 + languages/ru.ini | 1 + languages/sl.ini | 1 + languages/sv.ini | 1 + languages/tr.ini | 1 + .../src/VuFind/Controller/AbstractRecord.php | 23 +++++++++++++- .../src/VuFind/Controller/CartController.php | 25 +++++++++++++--- module/VuFind/src/VuFind/Export.php | 30 ++++++++++++++++++- .../templates/cart/export-success.phtml | 14 +++++++-- 29 files changed, 125 insertions(+), 16 deletions(-) diff --git a/config/vufind/export.ini b/config/vufind/export.ini index 04a4702aac5..151b04e4ac2 100644 --- a/config/vufind/export.ini +++ b/config/vufind/export.ini @@ -25,16 +25,25 @@ ; {config...} setting above, except result will be URL-encoded. ; requiredMethods[] - a repeatable field indicating methods which must be available ; on the record driver object in order to allow export in this format. -; bulkExportType - [ "link" | "download" ] - link renders a download link in the UI, -; download offers to save the export-file directly; overrides the defaultType -; setting found in the [BulkExport] section of config.ini. This distinction -; currently only affects users with Javascript enabled; the 'download' option -; cannot be implemented in a user-friendly way when Javascript is disabled. +; bulkExportType - [ "link" | "download" | "post" ] - link renders a download link in +; the UI, download offers to save the export-file directly, post sends the +; metadata using the POST method in a form field named by the postField +; parameter; overrides the defaultType setting found in the [BulkExport] section +; of config.ini. This distinction currently only affects users with Javascript +; enabled; the 'download' option cannot be implemented in a user-friendly way +; when Javascript is disabled. +; postField +; Name of the POST field to use when sending records with the POST method. +; targetWindow +; Name of the window where the export is opened in the browser. Default is +; "{format}Main" (e.g. "RefWorksMain"), but could be set to e.g. "_blank" to +; make the export always open a new window. [RefWorks] requiredMethods[] = getTitle -redirectUrl = "{config|RefWorks|url|http://www.refworks.com}/express/expressimport.asp?vendor={encodedConfig|RefWorks|vendor|VuFind}&filter=RefWorks%20Tagged%20Format&url={encodedCallback}" -headers[] = "Content-type: text/plain; charset=utf-8" +redirectUrl = "{config|RefWorks|url|http://www.refworks.com}/express/expressimport.asp?vendor={encodedConfig|RefWorks|vendor|VuFind}&filter=RefWorks%20Tagged%20Format&encoding=65001" +bulkExportType = post +postField = ImportData [EndNoteWeb] requiredMethods[] = getTitle diff --git a/languages/ar.ini b/languages/ar.ini index 8184d439fa7..6902a1289be 100644 --- a/languages/ar.ini +++ b/languages/ar.ini @@ -346,6 +346,7 @@ export_no_formats = "هذه التسجيلة لا تدعم التصدير." export_save = "ØÙظ الملÙ" export_selected = "تصدير المØدد" export_selected_favorites = "تصدير المÙضلة المØددة" +export_send = "بدء التصدير إلى %%service%%" export_success = "اكتمل التصدير" export_unsupported_format = "تنسيق تصدير غير مدعوم" external_auth_heading = "الوصول إلى المادة المرخصة" diff --git a/languages/bn.ini b/languages/bn.ini index 679c6e2ff6e..63382f41920 100644 --- a/languages/bn.ini +++ b/languages/bn.ini @@ -348,6 +348,7 @@ export_no_formats = "à¦à¦‡ রেকরà§à¦¡à¦Ÿà¦¿ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ export_save = "ফাইল সংরকà§à¦·à¦£ করà§à¦¨" export_selected = "নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ ফাইলটি à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨" export_selected_favorites = "নিরà§à¦¬à¦¾à¦šà¦¿à¦¤ পছনà§à¦¦ তালিকাগà§à¦²à¦¿ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨" +export_send = "Start export to %%service%%" export_success = "à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ সমà§à¦ªà§‚রà§à¦¨ হয়েছে" export_unsupported_format = "অসমরà§à¦¥à¦¿à¦¤ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ বিনà§à¦¯à¦¾à¦¸" external_auth_heading = "সাবসà§à¦•à§à¦°à¦¾à¦‡à¦¬ করা গà§à¦°à¦¨à§à¦¥à¦¾à¦—ার সমà§à¦ªà¦¦à§‡à¦° বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨" diff --git a/languages/ca.ini b/languages/ca.ini index cdfefe13f68..28f1c823c20 100644 --- a/languages/ca.ini +++ b/languages/ca.ini @@ -355,6 +355,7 @@ export_no_formats = "Aquest registre no permet exportacions." export_save = "Guardar fitxer" export_selected = "Exportar seleccionats" export_selected_favorites = "Exportar favorits seleccionats" +export_send = "Començar a exportar a %%service%%" export_success = "Exportació completada" export_unsupported_format = "Format d’exportació no suportat" external_auth_heading = "Dibuixar quadre de cerca" diff --git a/languages/cs.ini b/languages/cs.ini index 35a11382387..a9069a9a35c 100644 --- a/languages/cs.ini +++ b/languages/cs.ini @@ -342,6 +342,7 @@ export_no_formats = "Položku nelze exportovat." export_save = "Uložit soubor" export_selected = "Exportovat vybrané" export_selected_favorites = "Exportovat vybrané oblÃbené položky" +export_send = "ZaÄÃt export do %%service%%" export_success = "Export byl úspěšný" export_unsupported_format = "Nepodporovaný exportnà formát." external_auth_heading = "PÅ™Ãstup k licencovaným zdrojům" diff --git a/languages/cy.ini b/languages/cy.ini index 466800e53f3..413a7cd55ab 100644 --- a/languages/cy.ini +++ b/languages/cy.ini @@ -347,6 +347,7 @@ export_no_formats = "Nid yw'r cofnod hwn yn cefnogi allforio" export_save = "Cadw Ffeil" export_selected = "Allfudo'r detholiad" export_selected_favorites = "Allfudo Ffefrynnau Dethol" +export_send = "Dechrau allforio i %%service%%" export_success = "Allfudo'n Llwyddiannus" export_unsupported_format = "Fformat Allfudo na Chefnogwyd" external_auth_heading = "Mynediad i ddeunydd trwyddedig" diff --git a/languages/de.ini b/languages/de.ini index 85677f018a8..7c8a1516b74 100644 --- a/languages/de.ini +++ b/languages/de.ini @@ -346,6 +346,7 @@ export_no_formats = "Dieser Datensatz kann nicht exportiert werden." export_save = "Datei speichern" export_selected = "Auswahl exportieren" export_selected_favorites = "Ausgewählte Favoriten exportieren" +export_send = "Exportiere nach %%service%%" export_success = "Export abgeschlossen" export_unsupported_format = "Nichtunterstütztes Exportformat" external_auth_heading = "Zugriff auf lizenzpflichtige Inhalte" diff --git a/languages/el.ini b/languages/el.ini index 1cc5402c2d0..4e8f2f82b80 100644 --- a/languages/el.ini +++ b/languages/el.ini @@ -347,6 +347,7 @@ export_no_formats = "Αυτή η εγγÏαφή δεν είναι δυνατόν export_save = "Αποθήκευση αÏχείου" export_selected = "Εξαγωγή επιλεγμÎνων" export_selected_favorites = "Εξαγωγή επιλεγμÎνων αγαπημÎνων" +export_send = "ΈναÏξη εξαγωγής σε %%service%%" export_success = "Η εξαγωγή ολοκληÏώθηκε" export_unsupported_format = "Αυτός ο Ï„Ïπος αÏχείου δεν υποστηÏίζεται για εξαγωγή" external_auth_heading = "Î Ïόσβαση σε αδειοδοτημÎνο υλικό" diff --git a/languages/en.ini b/languages/en.ini index 0203688000a..1f4dcc4d26c 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -348,7 +348,8 @@ export_no_formats = "This record does not support export." export_save = "Save File" export_selected = "Export Selected" export_selected_favorites = "Export Selected Favorites" -export_success = "Export Complete" +export_send = "Send to %%service%%" +export_success = "Export Ready" export_unsupported_format = "Unsupported Export Format" external_auth_heading = "Access to licensed material" external_auth_login_message = "Login to access licensed material" diff --git a/languages/es.ini b/languages/es.ini index 7a07dc4e75c..e071e52f16a 100644 --- a/languages/es.ini +++ b/languages/es.ini @@ -347,6 +347,7 @@ export_no_formats = "Este registro no soporta exportación." export_save = "Guardar Archivo" export_selected = "Exportar los Seleccionados" export_selected_favorites = "Exportar los Favoritos Seleccionados." +export_send = "Iniciar exportación a %%service%%" export_success = "Exportación Completada" export_unsupported_format = "Formato de Exportación no soportado." external_auth_heading = "Acceso a material licenciado" diff --git a/languages/eu.ini b/languages/eu.ini index e797676e912..22862eb2e41 100644 --- a/languages/eu.ini +++ b/languages/eu.ini @@ -967,6 +967,7 @@ export_no_formats = "Esportatzea ezin da erabili erregistro honekin." export_save = "Fitxategia gorde" export_selected = "Aukeratutakoak esportatu" export_selected_favorites = "Gogokoenak esportatu." +export_send = "Hasi esportatzen hona%%service%%" export_success = "Esportazioa burutua" export_unsupported_format = "Esportazio formatu hori ezin da erabili." external_auth_heading = "Baimendutako materialerako sarbidea" diff --git a/languages/fi.ini b/languages/fi.ini index e37e2bb2972..52ea267a583 100644 --- a/languages/fi.ini +++ b/languages/fi.ini @@ -353,6 +353,7 @@ export_no_formats = "Tämä aineisto ei tue vientitoimintoa." export_save = "Tallenna tiedosto" export_selected = "Vie valitut" export_selected_favorites = "Vie valitut suosikit" +export_send = "Lähetä palveluun %%service%%" export_success = "Vienti valmis" export_unsupported_format = "Vienti valitussa muodossa ei onnistu" external_auth_heading = "Pääsy lisensioituun aineistoon" diff --git a/languages/fr.ini b/languages/fr.ini index 556f18e5d1a..a4651030b44 100644 --- a/languages/fr.ini +++ b/languages/fr.ini @@ -343,6 +343,7 @@ export_no_formats = "Cette notice ne peut être exportée." export_save = "Enregistrer le fichier" export_selected = "Exporter la sélection" export_selected_favorites = "Exporter les favoris sélectionnés" +export_send = "Démarrer l'export vers %%service%%" export_success = "Export terminé" export_unsupported_format = "Format d'export non supporté" external_auth_heading = "Accès aux contenus qui font l'objet d'une licence" diff --git a/languages/gl.ini b/languages/gl.ini index 7174aeeb425..3d49a0d6700 100644 --- a/languages/gl.ini +++ b/languages/gl.ini @@ -325,6 +325,7 @@ export_no_formats = "Este rexistro non soporta exportación" export_save = "Gardar Arquivo" export_selected = "Exportar os seleccionados" export_selected_favorites = "Exportar os favoritos seleccionados" +export_send = "Iniciar exportación a %%service%%" export_success = "Exportación Completada" export_unsupported_format = "Formato de Exportación non soportado" FAQs = "Preguntas Frecuentes" diff --git a/languages/he.ini b/languages/he.ini index 78ec1a97bcb..436df6167a7 100644 --- a/languages/he.ini +++ b/languages/he.ini @@ -256,6 +256,7 @@ export_no_formats = "רשומה זו ×œ× ×ª×•×ž×›×ª ביצו×." export_save = "שמירת הקובץ" export_selected = "×™×¦×•× × ×‘×—×¨×™×" export_selected_favorites = "×™×¦×•× ×ž×•×¢×“×¤×™× × ×‘×—×¨×™×" +export_send = "התחלת ×™×¦×•× ×œ%%service%%" export_success = "×”×™×¦×•× ×”×¦×œ×™×—" export_unsupported_format = "פורמט ×™×¦×•× ××™× ×• × ×ª×ž×š" FAQs = "ש×לות × ×¤×•×¦×•×ª" diff --git a/languages/it.ini b/languages/it.ini index ce4e86489e6..c07e2d7c540 100644 --- a/languages/it.ini +++ b/languages/it.ini @@ -346,6 +346,7 @@ export_no_formats = "Questo record non può essere esportato." export_save = "Salva" export_selected = "Esporta i selezionati" export_selected_favorites = "Esporta i preferiti selezionati" +export_send = "Esporta verso %%service%%" export_success = "Esportazione completata correttamente" export_unsupported_format = "Formato di esportazione non supportato" external_auth_heading = "Accesso s materiale sottoposto a licenza" diff --git a/languages/ja.ini b/languages/ja.ini index 34d1f9da16e..ef630e89686 100644 --- a/languages/ja.ini +++ b/languages/ja.ini @@ -347,6 +347,7 @@ export_no_formats = "ã“ã®ãƒ¬ã‚³ãƒ¼ãƒ‰ã¯ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆã§ãã¾ã›ã‚“。" export_save = "ファイルをä¿å˜" export_selected = "é¸æŠžã‚¢ã‚¤ãƒ†ãƒ をエクスãƒãƒ¼ãƒˆ" export_selected_favorites = "é¸æŠžã—ãŸãŠæ°—ã«å…¥ã‚Šã‚’エクスãƒãƒ¼ãƒˆ" +export_send = "%%service%%ã¸ã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆã‚’開始" export_success = "エクスãƒãƒ¼ãƒˆå®Œäº†" export_unsupported_format = "未対応ã®ã‚¨ã‚¯ã‚¹ãƒãƒ¼ãƒˆãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆ" external_auth_heading = "ライセンス資料ã«ã‚¢ã‚¯ã‚»ã‚¹" diff --git a/languages/nl.ini b/languages/nl.ini index 20b89f78cf9..4661042e8db 100644 --- a/languages/nl.ini +++ b/languages/nl.ini @@ -347,6 +347,7 @@ export_no_formats = "Dit record ondersteunt exporteren niet" export_save = "Bestand opslaan" export_selected = "Het geselecteerde exporteren" export_selected_favorites = "Geselecteerde favorieten exporteren" +export_send = "Start exporteren naar %%service%%" export_success = "Export afgerond" export_unsupported_format = "niet ondersteund Export Format" external_auth_heading = "Toegang tot gelicentieerd materiaal" diff --git a/languages/pl.ini b/languages/pl.ini index 1f2c810dd50..82667c37a98 100644 --- a/languages/pl.ini +++ b/languages/pl.ini @@ -408,6 +408,7 @@ export_no_formats = "Nie jest możliwe eksportowanie tego zapisu." export_save = "Zapisz plik" export_selected = "Eksportuj zaznaczone książki" export_selected_favorites = "Eksportuj zaznaczone ulubione książki" +export_send = "Eksportuj do %%service%%" export_success = "Eksport zakoÅ„czony" export_unsupported_format = "Niewspomagany format eksportu" external_auth_heading = "Logowanie do peÅ‚nego dostÄ™pu" diff --git a/languages/pt-br.ini b/languages/pt-br.ini index 4fffef4b95d..9db855056e5 100644 --- a/languages/pt-br.ini +++ b/languages/pt-br.ini @@ -346,6 +346,7 @@ export_no_formats = "Este registro não suporta a exportação." export_save = "Salvar arquivo" export_selected = "Exportar selec." export_selected_favorites = "Exportar os Favoritos selecionados" +export_send = "A exportar para o serviço %%service%%" export_success = "Exportação concluÃda" export_unsupported_format = "Formato de exportação não suportado" external_auth_heading = "Acesso a material licenciado" diff --git a/languages/pt.ini b/languages/pt.ini index d669b3a1991..5a4573dd36e 100644 --- a/languages/pt.ini +++ b/languages/pt.ini @@ -315,6 +315,7 @@ export_no_formats = "Este registo não suporta a exportação." export_save = "Guardar arquivo" export_selected = "Exportar selec." export_selected_favorites = "Exportar os Favoritos seleccionados" +export_send = "A exportar para o serviço %%service%%" export_success = "Exportação concluÃda" export_unsupported_format = "Formato de exportação não suportado" FAQs = "FAQs" diff --git a/languages/ru.ini b/languages/ru.ini index 517d1676d9a..509f8576e74 100644 --- a/languages/ru.ini +++ b/languages/ru.ini @@ -346,6 +346,7 @@ export_no_formats = "Ðта запиÑÑŒ не поддерживает ÑкÑп export_save = "Сохранить файл" export_selected = "ÐкÑпорт выбран" export_selected_favorites = "ÐкÑпорт выбранных Избранных" +export_send = "ЗапуÑтите ÑкÑпорт в %%ÑервиÑ%%" export_success = "ÐкÑпорт завершен" export_unsupported_format = "Ðеподдерживаемый формат ÑкÑпорта" FAQs = "ЧаÑто задаваемые вопроÑÑ‹" diff --git a/languages/sl.ini b/languages/sl.ini index 9b5a585320e..e6a362659b0 100644 --- a/languages/sl.ini +++ b/languages/sl.ini @@ -271,6 +271,7 @@ export_no_formats = "Ta zadetek ne podpira izvoz." export_save = "Shrani datoteko" export_selected = "Izvoz izbran" export_selected_favorites = "Izvozi izbrane priljubljene" +export_send = "PriÄni izvoz v %%service%%" export_success = "Izvoz konÄan" export_unsupported_format = "Nepodprt izvozni format" FAQs = "Pogosta vpraÅ¡anja" diff --git a/languages/sv.ini b/languages/sv.ini index 9f4dd8b2b3d..f1b292f77d7 100644 --- a/languages/sv.ini +++ b/languages/sv.ini @@ -348,6 +348,7 @@ export_no_formats = "Detta material stöder inte exportfunktionen" export_save = "Spara posten" export_selected = "Exportera valda" export_selected_favorites = "Exportera valda favoriter" +export_send = "Skicka till %%service%%" export_success = "Exporten färdig" export_unsupported_format = "Export i det valda formatet är inte möjlig" external_auth_heading = "Behörighet att komma Ã¥t licensierat material" diff --git a/languages/tr.ini b/languages/tr.ini index c10cde0f014..f46e56738fb 100644 --- a/languages/tr.ini +++ b/languages/tr.ini @@ -357,6 +357,7 @@ export_no_formats = "Bu kayıt ihracç desteklemiyor." export_save = "Dosyayı Sakla" export_selected = "Aktarım seçildi" export_selected_favorites = "SeçilmiÅŸ Favorileri Aktar" +export_send = "%%service%% e ihraç etmeyi baÅŸlat" export_success = "Aktarım Tamamlandı" export_unsupported_format = "Desteklenmeyen Aktarım Formatı" external_auth_heading = "Lisanslı materyale eriÅŸim" diff --git a/module/VuFind/src/VuFind/Controller/AbstractRecord.php b/module/VuFind/src/VuFind/Controller/AbstractRecord.php index ed085cc8e7d..30e54acd2aa 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractRecord.php +++ b/module/VuFind/src/VuFind/Controller/AbstractRecord.php @@ -550,12 +550,33 @@ class AbstractRecord extends AbstractBase ->toUrl($export->getRedirectUrl($format, $callback)); } + $recordHelper = $this->getViewRenderer()->plugin('record'); + + $exportType = $export->getBulkExportType($format); + if ('post' === $exportType) { + $params = [ + 'exportType' => 'post', + 'postField' => $export->getPostField($format), + 'postData' => $recordHelper($driver)->getExport($format), + 'targetWindow' => $export->getTargetWindow($format), + 'url' => $export->getRedirectUrl($format, ''), + 'format' => $format + ]; + $msg = [ + 'translate' => false, 'html' => true, + 'msg' => $this->getViewRenderer()->render( + 'cart/export-success.phtml', $params + ) + ]; + $this->flashMessenger()->addSuccessMessage($msg); + return $this->redirectToRecord(); + } + // Send appropriate HTTP headers for requested format: $response = $this->getResponse(); $response->getHeaders()->addHeaders($export->getHeaders($format)); // Actually export the record - $recordHelper = $this->getViewRenderer()->plugin('record'); $response->setContent($recordHelper($driver)->getExport($format)); return $response; } diff --git a/module/VuFind/src/VuFind/Controller/CartController.php b/module/VuFind/src/VuFind/Controller/CartController.php index c200387c448..24fe5f42486 100644 --- a/module/VuFind/src/VuFind/Controller/CartController.php +++ b/module/VuFind/src/VuFind/Controller/CartController.php @@ -340,13 +340,30 @@ class CartController extends AbstractBase if ($export->needsRedirect($format)) { return $this->redirect()->toUrl($url); } + $exportType = $export->getBulkExportType($format); + $params = [ + 'exportType' => $exportType, + 'format' => $format + ]; + if ('post' === $exportType) { + $records = $this->getRecordLoader()->loadBatch($ids); + $recordHelper = $this->getViewRenderer()->plugin('record'); + $parts = []; + foreach ($records as $record) { + $parts[] = $recordHelper($record)->getExport($format); + } + + $params['postField'] = $export->getPostField($format); + $params['postData'] = $export->processGroup($format, $parts); + $params['targetWindow'] = $export->getTargetWindow($format); + $params['url'] = $export->getRedirectUrl($format, ''); + } else { + $params['url'] = $url; + } $msg = [ 'translate' => false, 'html' => true, 'msg' => $this->getViewRenderer()->render( - 'cart/export-success.phtml', [ - 'url' => $url, - 'exportType' => $export->getBulkExportType($format) - ] + 'cart/export-success.phtml', $params ) ]; return $this->redirectToSource('success', $msg); diff --git a/module/VuFind/src/VuFind/Export.php b/module/VuFind/src/VuFind/Export.php index 3747a81cf03..dcf7d31c1e0 100644 --- a/module/VuFind/src/VuFind/Export.php +++ b/module/VuFind/src/VuFind/Export.php @@ -160,7 +160,8 @@ class Export */ public function needsRedirect($format) { - return isset($this->exportConfig->$format->redirectUrl); + return !empty($this->exportConfig->$format->redirectUrl) + && 'link' === $this->getBulkExportType($format); } /** @@ -385,4 +386,31 @@ class Export } return $this->activeFormats[$context]; } + + /** + * Get the export POST field name. + * + * @param string $format Format identifier + * + * @return string + */ + public function getPostField($format) + { + return !empty($this->exportConfig->$format->postField) + ? $this->exportConfig->$format->postField : 'ImportData'; + } + + /** + * Get the export target window. + * + * @param string $format Format identifier + * + * @return string + */ + public function getTargetWindow($format) + { + return !empty($this->exportConfig->$format->targetWindow) + ? $this->exportConfig->$format->targetWindow + : $format . 'Main'; + } } diff --git a/themes/bootstrap3/templates/cart/export-success.phtml b/themes/bootstrap3/templates/cart/export-success.phtml index d3b57410399..48cf9dea43c 100644 --- a/themes/bootstrap3/templates/cart/export-success.phtml +++ b/themes/bootstrap3/templates/cart/export-success.phtml @@ -1,4 +1,14 @@ <div class="text-center"> - <?=$this->transEsc('export_success')?> — - <a class="btn btn-primary <?=$this->exportType?>" href="<?=$this->escapeHtmlAttr($this->url)?>"><?=$this->transEsc('export_download')?></a> + <? if ('post' === $this->exportType): ?> + <form id="export-form" method="POST" action="<?=$this->escapeHtmlAttr($this->url)?>" target="<?=$this->escapeHtmlAttr($this->targetWindow)?>"> + <input type="hidden" name="<?=$this->escapeHtmlAttr($this->postField)?>" value="<?=$this->escapeHtmlAttr($this->postData)?>"> + <?=$this->transEsc('export_success')?> — + <input class="btn btn-primary" type="submit" name="submit" + value="<?=$this->escapeHtmlAttr($this->translate('export_send', ['%%service%%' => $this->translate($this->export()->getLabelForFormat($this->format))]))?>" + > + </form> + <? else: ?> + <?=$this->transEsc('export_success')?> — + <a class="btn btn-primary <?=$this->exportType?>" href="<?=$this->escapeHtmlAttr($this->url)?>"><?=$this->transEsc('export_download')?></a> + <? endif; ?> </div> -- GitLab