Bugzilla – Attachment 182493 Details for
Bug 33430
Use REST API for suggestions tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33430: DO NOT PUSH - data script
Bug-33430-DO-NOT-PUSH---data-script.patch (text/plain), 2.67 KB, created by
Lisette Scheer
on 2025-05-15 16:58:22 UTC
(
hide
)
Description:
Bug 33430: DO NOT PUSH - data script
Filename:
MIME Type:
Creator:
Lisette Scheer
Created:
2025-05-15 16:58:22 UTC
Size:
2.67 KB
patch
obsolete
>From cdc1cb40ee58aaf6b1f23b29c7b15aa5c05f4948 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk> >Date: Fri, 2 May 2025 14:10:37 +0100 >Subject: [PATCH] Bug 33430: DO NOT PUSH - data script > >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> >--- > dummySuggestions.pl | 63 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 63 insertions(+) > create mode 100644 dummySuggestions.pl > >diff --git a/dummySuggestions.pl b/dummySuggestions.pl >new file mode 100644 >index 00000000000..e11432f1d75 >--- /dev/null >+++ b/dummySuggestions.pl >@@ -0,0 +1,63 @@ >+ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Koha::Suggestion; >+use Koha::AuthorisedValue; >+ >+use String::Random qw( random_string ); >+ >+my @status_list = ( 'TEST', 'TEST2', 'ASKED', 'ACCEPTED', 'REJECTED', 'CHECKED', 'ORDERED', 'AVAILABLE' ); >+my @branches = ( "CPL", "FFL", "FPL", "FRL", "IPT", "LPL", "MPL", "PVL", "RPL", "SPL", "TPL", "UPL" ); >+my @dates = ( "2025-05-01", "2025-05-02", "2025-05-03", "2025-05-04", "2025-05-05" ); >+my @opac_reasons = ( 'bestseller', 'damaged', 'cheap' ); >+ >+my $av1 = Koha::AuthorisedValue->new( >+ { >+ category => 'SUGGEST_STATUS', >+ authorised_value => 'TEST', >+ lib => 'Test', >+ lib_opac => 'Test', >+ imageurl => '', >+ } >+)->store(); >+my $av2 = Koha::AuthorisedValue->new( >+ { >+ category => 'SUGGEST_STATUS', >+ authorised_value => 'TEST2', >+ lib => 'Another test', >+ lib_opac => 'Another test', >+ imageurl => '', >+ } >+)->store(); >+my $av3 = Koha::AuthorisedValue->new( >+ { >+ category => 'OPAC_SUG', >+ authorised_value => 'cheap', >+ lib => 'This is cheap', >+ lib_opac => 'This is cheap', >+ imageurl => '', >+ } >+)->store(); >+ >+foreach my $i ( 1 .. 2000 ) { >+ warn $i . " created\n" if $i % 100 == 0; >+ my $title = random_string("cccccccccc"); >+ >+ my $status_index = rand(8); >+ my $branch_index = rand(12); >+ my $dates_index = rand(5); >+ my $opac_index = rand(3); >+ my $patron_id = rand(50) + 1; >+ my $suggestion = Koha::Suggestion->new( >+ { >+ suggestedby => $patron_id, STATUS => $status_list[$status_index], >+ branchcode => $branches[$branch_index], managedby => 51, itemtype => 'BOOK', >+ suggesteddate => $dates[$dates_index], >+ archived => 0, title => $title, patronreason => $opac_reasons[$opac_index] >+ } >+ )->store; >+} >+ >+warn "Complete"; >-- >2.39.5
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 33430
:
182146
|
182147
|
182148
|
182149
|
182150
|
182161
|
182196
|
182197
|
182198
|
182199
|
182200
|
182202
|
182203
|
182204
|
182205
|
182206
|
182207
|
182208
|
182209
|
182210
|
182211
|
182339
|
182340
|
182341
|
182342
|
182343
|
182428
|
182429
|
182430
|
182431
|
182432
|
182433
|
182434
|
182478
|
182480
|
182481
|
182482
|
182483
|
182484
|
182485
|
182486
|
182487
| 182493 |
182494
|
182495
|
182496
|
182497
|
182498
|
182499
|
182500
|
182577
|
182578