Bugzilla – Attachment 58079 Details for
Bug 8612
CSV export profile to have custom fields in export csv basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8612: QA follow-up - distinguish between late issues and basket export csv profiles
Bug-8612-QA-follow-up---distinguish-between-late-i.patch (text/plain), 7.54 KB, created by
Josef Moravec
on 2016-12-09 13:29:19 UTC
(
hide
)
Description:
Bug 8612: QA follow-up - distinguish between late issues and basket export csv profiles
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-09 13:29:19 UTC
Size:
7.54 KB
patch
obsolete
>From e34d81bae8f87bf87cc48d33c0657ac22278d9b9 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >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 2bbf42d..40327ee 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -424,7 +424,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 46fc155..51ae687 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 %] > <h1>Modify a CSV profile</h1> >@@ -124,12 +132,12 @@ function reloadPage(p) { > <li> > <label for="type" class="required">Profile type: </label> > <select id="type" name="type"> >- [% IF csv_profile.type == 'sql' %] >- <option value="marc">MARC</option> >- <option value="sql" selected="selected">SQL</option> >+ [% FOREACH type IN [ 'marc' 'late_issues' 'export_basket'] %] >+ [% IF csv_profile.type == type %] >+ <option value="[% type %]" selected="selected">[% PROCESS type_description type_code = type %]</option> > [% ELSE %] >- <option value="marc" selected="selected">MARC</option> >- <option value="sql">SQL</option> >+ <option value="[% type %]">[% PROCESS type_description type_code = type %]</option> >+ [% END %] > [% END %] > </select> > <span class="required">Required</span> >@@ -182,11 +190,13 @@ function reloadPage(p) { > </li> > > <li class="sql_specific"> >- <label for="sql_content" class="required">Profile SQL fields: </label> >- <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea> >- <p>You have to define which fields you want to export, separated by pipes.</p> >- <p>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.</p> >- <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p> >+ <label for="late_issues_content" class="required">Profile SQL fields: </label> >+ <textarea cols="50" rows="2" name="sql_content" id="sql_content">[% csv_profile.content %]</textarea> >+ <p>You have to define which fields you want to export, separated by pipes.</p> >+ <p>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.</p> >+ <p>Example: Name=subscription.name|Title=subscription.title|Issue number=serial.serialseq</p> >+ <p>For late issues claims you can use data from following tables: serial, subscription, biblio, biblioitems and aqbookseller.</p> >+ <p>For basket exports you can use data from following tables: biblio, biblioitems, aqorders, aqbudgets and aqbasket.</p> > </li> > </ol> > </fieldset> >@@ -243,11 +253,7 @@ function reloadPage(p) { > <td>[% csv_profile.description %]</td> > <td>[% csv_profile.content %]</td> > <td>[% csv_profile.csv_separator %]</td> >- [% IF csv_profile.type == 'sql' %] >- <td>SQL</td> >- [% ELSE %] >- <td>MARC</td> >- [% END %] >+ <td>[% PROCESS type_description type_code = csv_profile.type %]</td> > <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=add_form&export_format_id=[% csv_profile.export_format_id %]">Edit</a></td> > <td><a href="/cgi-bin/koha/tools/csv-profiles.pl?op=delete_confirm&export_format_id=[% csv_profile.export_format_id %]">Delete</a></td> > </tr> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8612
:
11514
|
36860
|
37289
|
37293
|
41224
|
41225
|
41226
|
41227
|
42532
|
42533
|
42534
|
47591
|
47592
|
47593
|
56222
|
56223
|
56224
|
56225
|
57012
|
57013
|
57024
|
57025
|
57026
|
57027
|
57028
|
57029
|
57079
|
58073
|
58074
|
58075
|
58076
|
58077
|
58078
|
58079
|
58985
|
58986
|
58987
|
58988
|
58989
|
58990
|
58991
|
58992
|
59757
|
60480
|
61264
|
61265
|
61266
|
61267
|
61405
|
61520
|
63048
|
63049
|
63050
|
63051
|
63052
|
63053
|
63054
|
63055
|
63056
|
63104
|
63158
|
63279
|
63910
|
63911
|
63912
|
63913
|
63914
|
63915
|
63964
|
63966