Bugzilla – Attachment 182150 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.14 KB, created by
Matt Blenkinsop
on 2025-05-09 07:22:24 UTC
(
hide
)
Description:
Bug 33430: DO NOT PUSH - data script
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2025-05-09 07:22:24 UTC
Size:
2.14 KB
patch
obsolete
>From 134f4a87ff2deb7f6f639364723ac6d1fde7fdf1 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 > >--- > dummySuggestions.pl | 52 +++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 52 insertions(+) > create mode 100644 dummySuggestions.pl > >diff --git a/dummySuggestions.pl b/dummySuggestions.pl >new file mode 100644 >index 00000000000..13089bb4d87 >--- /dev/null >+++ b/dummySuggestions.pl >@@ -0,0 +1,52 @@ >+ >+#!/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 $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(); >+ >+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 $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 >+ } >+ )->store; >+} >+ >+warn "Complete"; >-- >2.48.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 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