Bugzilla – Attachment 102186 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.73 KB, created by
Jonathan Druart
on 2020-04-01 09:18:15 UTC
(
hide
)
Description:
Bug 24163: Add the csv into the DB - as an example
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-01 09:18:15 UTC
Size:
3.73 KB
patch
obsolete
>From 19ad62b1f63fa4626183fd270dbfc8f2f1885c30 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 >--- > .../data/mysql/atomicupdate/bug_24163.perl | 18 ++++++++++++++++ > .../data/mysql/en/optional/csv_profiles.yml | 21 +++++++++++++++++-- > 2 files changed, 37 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.yml b/installer/data/mysql/en/optional/csv_profiles.yml >index 2ef57b129b..a4862ac2c5 100644 >--- a/installer/data/mysql/en/optional/csv_profiles.yml >+++ b/installer/data/mysql/en/optional/csv_profiles.yml >@@ -25,11 +25,28 @@ description: > tables: > - export_format: > translatable: [ profile, description ] >- multiline: [] >+ multiline: [ content ] > rows: > - profile: "issues to claim" > description: "default CSV export for serial issue claims" >- content: "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate" >+ content: >+ - "SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate" > csv_separator: "," > type: sql > used_for: late_issues >+ - profile: "Late orders (csv profile)" >+ description: "default CSV export for late orders" >+ content: >+ - '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 %]' >+ csv_separator: "," >+ type: sql >+ used_for: late_orders >-- >2.20.1
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