@@ -, +, @@
- I think we should add default CSV profiles for the different "usage",
- Most of the code to export CSV is no reusable. We should make
---
.../prog/en/modules/reports/itemslost.tt | 18 ++++++-
.../prog/en/modules/tools/csv-profiles.tt | 3 +-
reports/itemslost.pl | 62 +++++++++++++++++++++-
3 files changed, 78 insertions(+), 5 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt
@@ -33,7 +33,8 @@
itemnumbers.push($(this).val());
});
if (itemnumbers.length > 0) {
- var url = '/cgi-bin/koha/tools/batchMod.pl?op=show';
+ var csv_profile_id = $("#csv_profile_id option:selected").val();
+ var url = '/cgi-bin/koha/reports/itemslost.pl?op=export&csv_profile_id='+csv_profile_id;
url += '&itemnumber=' + itemnumbers.join('&itemnumber=');
$('a.itemselection_action_export').attr('href', url);
} else {
@@ -56,6 +57,9 @@
$("input[name='itemnumber'][type='checkbox']").change(function() {
itemSelectionBuildActionLinks();
});
+ $("#csv_profile_id").change(function() {
+ itemSelectionBuildActionLinks();
+ });
$(".SelectAll").on("click",function(e){
e.preventDefault();
@@ -104,7 +108,17 @@
Clear all
| Actions:
- Export selected items
+ [% IF csv_profiles.count %]
+ Export selected items
+ Using the following CSV profile:
+
+ [% ELSE %]
+ Export selected items
+ [% END %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt
@@ -112,6 +112,7 @@ function reloadPage(p) {
[% IF used_for_code == 'export_records' %] Export records
[% ELSIF used_for_code == 'late_issues' %] Late serial issues claims
[% ELSIF used_for_code == 'export_basket' %] Basket export in acquisition
+ [% ELSIF used_for_code == 'export_lost_items' %] Export lost items in report
[% ELSE %] Unknown usage
[% END %]
[% END %]
@@ -152,7 +153,7 @@ function reloadPage(p) {