From b177e3d93821f9b78496b940a3195ff944487fa5 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Wed, 2 Nov 2016 12:02:34 +0000 Subject: [PATCH] Bug 8612: QA follow-up - distinguish between late issues and basket export csv profiles --- acqui/basket.pl | 2 +- installer/data/mysql/atomicupdate/bug_8612.sql | 1 + .../prog/en/modules/tools/csv-profiles.tt | 36 +++++++++++++--------- serials/claims.pl | 2 +- t/db_dependent/Acquisition/GetBasketAsCSV.t | 2 +- t/db_dependent/Koha/CsvProfiles.t | 2 +- 6 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_8612.sql diff --git a/acqui/basket.pl b/acqui/basket.pl index 044cd87..148f52b 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -426,7 +426,7 @@ if ( $op eq 'list' ) { unclosable => @orders ? $basket->{is_standing} : 1, has_budgets => $has_budgets, duplinbatch => $duplinbatch, - csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ], + csv_profiles => [ Koha::CsvProfiles->search({ type => 'export_basket' }) ], ); } diff --git a/installer/data/mysql/atomicupdate/bug_8612.sql b/installer/data/mysql/atomicupdate/bug_8612.sql new file mode 100644 index 0000000..37a643b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_8612.sql @@ -0,0 +1 @@ +UPDATE export_format SET type = 'late_issues' WHERE type ='sql'; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt index 45a1193..38d8269 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt @@ -101,6 +101,14 @@ function reloadPage(p) { [% END %] [% END %] +[% BLOCK type_description %] + [% IF type_code == 'marc' %] MARC for export records + [% ELSIF type_code == 'late_issues' %] SQL for late serial issues claims + [% ELSIF type_code == 'export_basket' %] SQL for basket export in acquisition + [% ELSE %] Uknown type + [% END %] +[% END %] + [% IF op == 'add_form' %] [% IF csv_profile %]

Modify a CSV profile

@@ -124,12 +132,12 @@ function reloadPage(p) {
  • Required @@ -182,11 +190,13 @@ function reloadPage(p) {
  • - - -

    You have to define which fields you want to export, separated by pipes.

    -

    You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.

    -

    Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq

    + + +

    You have to define which fields you want to export, separated by pipes.

    +

    You can also use your own headers (instead of the ones from Koha) by prefixing the field name with an header, followed by the equal sign.

    +

    Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq

    +

    For late issues claims you can use data from following tables: serial, subscription, biblio, biblioitems and aqbookseller.

    +

    For basket exports you can use data from following tables: biblio, biblioitems, aqorders, aqbudgets and aqbasket.

  • @@ -243,11 +253,7 @@ function reloadPage(p) { [% csv_profile.description %] [% csv_profile.content %] [% csv_profile.csv_separator %] - [% IF csv_profile.type == 'sql' %] - SQL - [% ELSE %] - MARC - [% END %] + [% PROCESS type_description type_code = csv_profile.type %] Edit Delete diff --git a/serials/claims.pl b/serials/claims.pl index b4bc94f..6f6baba 100755 --- a/serials/claims.pl +++ b/serials/claims.pl @@ -104,7 +104,7 @@ $template->param( supplierid => $supplierid, claimletter => $claimletter, additional_fields_for_subscription => $additional_fields, - csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ], + csv_profiles => [ Koha::CsvProfiles->search({ type => 'late_issues' }) ], letters => $letters, (uc(C4::Context->preference("marcflavour"))) => 1 ); diff --git a/t/db_dependent/Acquisition/GetBasketAsCSV.t b/t/db_dependent/Acquisition/GetBasketAsCSV.t index 320bcca..5ff1f23 100644 --- a/t/db_dependent/Acquisition/GetBasketAsCSV.t +++ b/t/db_dependent/Acquisition/GetBasketAsCSV.t @@ -36,7 +36,7 @@ my $budget = C4::Budgets::GetBudget( $budget_id ); my $csv_profile = Koha::CsvProfile->new({ profile => 'my user profile', - type => 'sql', + type => 'export_basket', csv_separator => ',', content => 'autor=biblio.author|title=biblio.title|quantity=aqorders.quantity', })->store; diff --git a/t/db_dependent/Koha/CsvProfiles.t b/t/db_dependent/Koha/CsvProfiles.t index 70c2201..aee3152 100644 --- a/t/db_dependent/Koha/CsvProfiles.t +++ b/t/db_dependent/Koha/CsvProfiles.t @@ -35,7 +35,7 @@ my $nb_of_csv_profiles = Koha::CsvProfiles->search->count; my $new_csv_profile_1 = Koha::CsvProfile->new({ profile => 'my_csv_profile_name_for_test_1', description => 'my_csv_profile_description_for_test_1', - type => 'sql' + type => 'late_issues' })->store; my $new_csv_profile_2 = Koha::CsvProfile->new({ profile => 'my_csv_profile_name_for_test_2', -- 2.1.4