It would be nice to be able to export reports from the export_records.pl command-line utility using a report. Adding a reportID parameter to the export_records.pl script would enable libraries to have greater control over what records are exported.
Created attachment 166170 [details] [review] Bug 36770: WIP Enable export_records.pl to use report output
Created attachment 166347 [details] [review] Bug 36770: Export records using a report Enable the export_records.pl script use a report output to export biblios or authorities Test plan: 1. Apply patches and restart services 2. Create a SQL report (id=1) SELECT biblionumber FROM biblio 3. Create a SQL report (id=2) and set an item as notforloan = -1 SELECT title, author, biblio.biblionumber FROM biblio LEFT JOIN items USING (biblionumber) WHERE items.notforloan = <<Not for loan|NOT_LOAN>> 4. Create a SQL report (id=3) SELECT title, author FROM biblio 5. Create a SQL report (id=4) SELECT authid FROM auth_header 6. Run export_records.pl using report id=1 and confirm a koha.mrc file is created in the misc directory: cd misc ./export_records.pl --report_id=1 7. Delete the koha.mrc file 8. Run export_records.pl using report id=2 ./export_records.pl --report_id=2 9. Notice you are prompted to supply a parameter 10. Re-run report id=2 supplying a parameter. Confirm the koha.mrc file is created and contains bib data ./export_records.pl --report_id=2 --report_param=-1 11. Run export_records.pl using report id=3 ./export_records.pl --report_id=3 12. Notice you get the message: The --report_id you specified does not fetch a biblionumber 13. Delete the koha.mrc file 14. Run export_records.pl using report id=4 ./export_records.pl --report_id=4 15. Notice you get a message 'The --report_id you specified does not fetch a biblionumber' 16. Re-run export_records.pl setting the record-type=auths ./export_records.pl --record-type=auths --report_id=4 17. Notice the koha.mrc file is generated and contains auth data Sponsored-by: Horowhenua Libraries, Toi Ohomai Institute of Technology, Plant and Food Research Limited, Waitaki District Council, South Taranaki District Council New Zealand
Created attachment 166442 [details] [review] Bug 36770: Export records using a report Enable the export_records.pl script use a report output to export biblios or authorities Test plan: 1. Apply patches and restart services 2. Create a SQL report (id=1) SELECT biblionumber FROM biblio 3. Create a SQL report (id=2) and set an item as notforloan = -1 SELECT title, author, biblio.biblionumber FROM biblio LEFT JOIN items USING (biblionumber) WHERE items.notforloan = <<Not for loan|NOT_LOAN>> 4. Create a SQL report (id=3) SELECT title, author FROM biblio 5. Create a SQL report (id=4) SELECT authid FROM auth_header 6. Run export_records.pl using report id=1 and confirm a koha.mrc file is created in the misc directory: cd misc ./export_records.pl --report_id=1 7. Delete the koha.mrc file 8. Run export_records.pl using report id=2 ./export_records.pl --report_id=2 9. Notice you are prompted to supply a parameter 10. Re-run report id=2 supplying a parameter. Confirm the koha.mrc file is created and contains bib data ./export_records.pl --report_id=2 --report_param=-1 11. Run export_records.pl using report id=3 ./export_records.pl --report_id=3 12. Notice you get the message: The --report_id you specified does not fetch a biblionumber 13. Delete the koha.mrc file 14. Run export_records.pl using report id=4 ./export_records.pl --report_id=4 15. Notice you get a message 'The --report_id you specified does not fetch a biblionumber' 16. Re-run export_records.pl setting the record-type=auths ./export_records.pl --record-type=auths --report_id=4 17. Notice the koha.mrc file is generated and contains auth data Sponsored-by: Horowhenua Libraries, Toi Ohomai Institute of Technology, Plant and Food Research Limited, Waitaki District Council, South Taranaki District Council New Zealand Signed-off-by: alexandre <alexandre.noel@inlibro.com>
Created attachment 169247 [details] [review] Bug 36770: Export records using a report Enable the export_records.pl script use a report output to export biblios or authorities Test plan: 1. Apply patches and restart services 2. Create a SQL report (id=1) SELECT biblionumber FROM biblio 3. Create a SQL report (id=2) and set an item as notforloan = -1 SELECT title, author, biblio.biblionumber FROM biblio LEFT JOIN items USING (biblionumber) WHERE items.notforloan = <<Not for loan|NOT_LOAN>> 4. Create a SQL report (id=3) SELECT title, author FROM biblio 5. Create a SQL report (id=4) SELECT authid FROM auth_header 6. Run export_records.pl using report id=1 and confirm a koha.mrc file is created in the misc directory: cd misc ./export_records.pl --report_id=1 7. Delete the koha.mrc file 8. Run export_records.pl using report id=2 ./export_records.pl --report_id=2 9. Notice you are prompted to supply a parameter 10. Re-run report id=2 supplying a parameter. Confirm the koha.mrc file is created and contains bib data ./export_records.pl --report_id=2 --report_param=-1 11. Run export_records.pl using report id=3 ./export_records.pl --report_id=3 12. Notice you get the message: The --report_id you specified does not fetch a biblionumber 13. Delete the koha.mrc file 14. Run export_records.pl using report id=4 ./export_records.pl --report_id=4 15. Notice you get a message 'The --report_id you specified does not fetch a biblionumber' 16. Re-run export_records.pl setting the record-type=auths ./export_records.pl --record-type=auths --report_id=4 17. Notice the koha.mrc file is generated and contains auth data Sponsored-by: Horowhenua Libraries, Toi Ohomai Institute of Technology, Plant and Food Research Limited, Waitaki District Council, South Taranaki District Council New Zealand Signed-off-by: alexandre <alexandre.noel@inlibro.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 169248 [details] [review] Bug 36770: (QA follow-up) Tidy export_records.pl Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
I love that so many libraries sponsored this :) For the future I think separate sponsored-by lines would be better, as this will allow parsing and counting for the release notes script. New sponsor found with name Horowhenua Libraries, Toi Ohomai Institute of Technology, Plant and Food Research Limited, Waitaki District Council, South Taranaki District Council New Zealand
Pushed for 24.11! Well done everyone, thank you!
(In reply to Katrin Fischer from comment #6) > I love that so many libraries sponsored this :) > > For the future I think separate sponsored-by lines would be better, as this > will allow parsing and counting for the release notes script. > > New sponsor found with name Horowhenua Libraries, Toi Ohomai Institute of > Technology, Plant and Food Research Limited, Waitaki District Council, South > Taranaki District Council New Zealand Thanks so much Katrin! Yes, very good point about using separate sponsored-by lines in the future. We will keep that in mind :)
Enhancement will not be backported to 24.05.x
*** Bug 36208 has been marked as a duplicate of this bug. ***
*** Bug 36201 has been marked as a duplicate of this bug. ***