Bugzilla – Attachment 98692 Details for
Bug 24163
Add ability to define a CSV profile for late orders export
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24163: Add the csv into the DB - as an example
Bug-24163-Add-the-csv-into-the-DB---as-an-example.patch (text/plain), 3.47 KB, created by
Jonathan Druart
on 2020-02-11 08:54:28 UTC
(
hide
)
Description:
Bug 24163: Add the csv into the DB - as an example
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-02-11 08:54:28 UTC
Size:
3.47 KB
patch
obsolete
>From ad3f92889398c30b27349caf4e7ffb545615392d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Dec 2019 17:32:46 +0100 >Subject: [PATCH] Bug 24163: Add the csv into the DB - as an example > >Sponsored-by: Institute of Technology Tralee >--- > installer/data/mysql/atomicupdate/bug_24163.perl | 18 ++++++++++++++++++ > installer/data/mysql/en/optional/csv_profiles.sql | 14 ++++++++++++-- > 2 files changed, 30 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24163.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_24163.perl b/installer/data/mysql/atomicupdate/bug_24163.perl >new file mode 100644 >index 0000000000..f595db9102 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24163.perl >@@ -0,0 +1,18 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type, used_for ) VALUES >+ ("Late orders (csv profile)", "default CSV export for late orders", 'Title[% separator %]Author[% separator %]Publication year[% separator %]ISBN[% separator %]Quantity[% separator %]Number of claims >+ [% FOR order IN orders ~%] >+ [%~ SET biblio = order.biblio ~%] >+ "[% biblio.title %]"[% separator ~%] >+ "[% biblio.author %]"[% separator ~%] >+ "[% bibio.biblioitem.publicationyear %]"[% separator ~%] >+ "[% biblio.biblioitem.isbn %]"[% separator ~%] >+ "[% order.quantity%]"[% separator ~%] >+ "[% order.claims.count%][% IF order.claims.count %]([% FOR c IN order.claims %][% c.claimed_on | $KohaDates %][% UNLESS loop.last %], [% END %][% END %])[% END %]" >+ [% END %]', ",", "sql", "late_orders") >+ }); >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24163 - Define a default CSV profile for late orders)\n"; >+} >diff --git a/installer/data/mysql/en/optional/csv_profiles.sql b/installer/data/mysql/en/optional/csv_profiles.sql >index 86c2394d76..0758ebe13e 100644 >--- a/installer/data/mysql/en/optional/csv_profiles.sql >+++ b/installer/data/mysql/en/optional/csv_profiles.sql >@@ -1,2 +1,12 @@ >-INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type, used_for ) >-VALUES ( "issues to claim", "default CSV export for serial issue claims", "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate", ",", "sql", "late_issues" ); >+INSERT IGNORE INTO export_format( profile, description, content, csv_separator, type, used_for ) VALUES >+( "issues to claim", "default CSV export for serial issue claims", "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate", ",", "sql", "late_issues" ), >+("Late orders (csv profile)", "default CSV export for late orders", 'Title[% separator %]Author[% separator %]Publication year[% separator %]ISBN[% separator %]Quantity[% separator %]Number of claims >+[% FOR order IN orders ~%] >+[%~ SET biblio = order.biblio ~%] >+"[% biblio.title %]"[% separator ~%] >+"[% biblio.author %]"[% separator ~%] >+"[% bibio.biblioitem.publicationyear %]"[% separator ~%] >+"[% biblio.biblioitem.isbn %]"[% separator ~%] >+"[% order.quantity%]"[% separator ~%] >+"[% order.claims.count%][% IF order.claims.count %]([% FOR c IN order.claims %][% c.claimed_on | $KohaDates %][% UNLESS loop.last %], [% END %][% END %])[% END %]" >+[% END %]', ",", "sql", "late_orders"); >-- >2.11.0
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 24163
:
97120
|
97121
|
97122
|
97123
|
98691
|
98692
|
102185
|
102186
|
102257
|
102258
|
103585
|
103586
|
104192
|
104193
|
104194
|
104252
|
104337
|
104338
|
104339
|
104340
|
104341