Bugzilla – Attachment 170725 Details for
Bug 14322
Add option to create a shareable link for item searches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14322: (follow-up) Perl tidy
Bug-14322-follow-up-Perl-tidy.patch (text/plain), 4.07 KB, created by
Brendan Lawlor
on 2024-08-26 14:50:08 UTC
(
hide
)
Description:
Bug 14322: (follow-up) Perl tidy
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2024-08-26 14:50:08 UTC
Size:
4.07 KB
patch
obsolete
>From 9bd87bc1400536ae398a4813cf6b4331fc15800e Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Thu, 1 Aug 2024 13:59:28 +0000 >Subject: [PATCH] Bug 14322: (follow-up) Perl tidy > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> >--- > catalogue/itemsearch.pl | 50 ++++++++++++++++++++++------------------- > 1 file changed, 27 insertions(+), 23 deletions(-) > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index a8134712f4..40b42adeb7 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -38,61 +38,65 @@ my $cgi = CGI->new; > my $format = $cgi->param('format'); > my $template_name = 'catalogue/itemsearch.tt'; > >-if (defined $format and $format eq 'json') { >+if ( defined $format and $format eq 'json' ) { > $template_name = 'catalogue/itemsearch_json.tt'; > > # Map DataTables parameters with 'regular' parameters >- $cgi->param('rows', scalar $cgi->param('length')); >- $cgi->param('page', (scalar $cgi->param('start') / scalar $cgi->param('length')) + 1); >+ $cgi->param( 'rows', scalar $cgi->param('length') ); >+ $cgi->param( 'page', ( scalar $cgi->param('start') / scalar $cgi->param('length') ) + 1 ); > my @columns = @{ from_json $cgi->param('columns') }; >- $cgi->param('sortby', $columns[ $cgi->param('order[0][column]') ]->{name}); >- $cgi->param('sortorder', scalar $cgi->param('order[0][dir]')); >+ $cgi->param( 'sortby', $columns[ $cgi->param('order[0][column]') ]->{name} ); >+ $cgi->param( 'sortorder', scalar $cgi->param('order[0][dir]') ); > > my @f = $cgi->multi_param('f'); > my @q = $cgi->multi_param('q'); > > # If index indicates the value is a barcode, we need to preprocess it before searching >- for ( my $i = 0; $i < @q; $i++ ) { >- $q[$i] = barcodedecode($q[$i]) if $f[$i] eq 'barcode'; >+ for ( my $i = 0 ; $i < @q ; $i++ ) { >+ $q[$i] = barcodedecode( $q[$i] ) if $f[$i] eq 'barcode'; > } > > push @q, '' if @q == 0; > my @op = $cgi->multi_param('op'); >- my @c = $cgi->multi_param('c'); >+ my @c = $cgi->multi_param('c'); > for my $column (@columns) { >- my $search = $column->{search}->{value}; >+ my $search = $column->{search}->{value}; > my $column_name = $column->{name}; >- if (defined $search and $search ne '') { >+ if ( defined $search and $search ne '' ) { > my @words = split /\s+/, $search; > foreach my $word (@words) { > push @f, $column_name; > push @c, 'and'; > >- if ( grep { $_ eq $column_name } qw( ccode homebranch holdingbranch location itype notforloan itemlost onloan ) ) { >- push @q, "$word"; >+ if ( grep { $_ eq $column_name } >+ qw( ccode homebranch holdingbranch location itype notforloan itemlost onloan ) ) >+ { >+ push @q, "$word"; > push @op, '='; > } else { >- push @q, "%$word%"; >+ push @q, "%$word%"; > push @op, 'like'; > } > } > } > } >- $cgi->param('f', @f); >- $cgi->param('q', @q); >- $cgi->param('op', @op); >- $cgi->param('c', @c); >-} elsif (defined $format and $format eq 'csv') { >+ $cgi->param( 'f', @f ); >+ $cgi->param( 'q', @q ); >+ $cgi->param( 'op', @op ); >+ $cgi->param( 'c', @c ); >+} elsif ( defined $format and $format eq 'csv' ) { > $template_name = 'catalogue/itemsearch_csv.tt'; > > # Retrieve all results >- $cgi->param('rows', 0); >-} elsif (defined $format and $format eq 'barcodes') { >+ $cgi->param( 'rows', 0 ); >+} elsif ( defined $format and $format eq 'barcodes' ) { >+ > # Retrieve all results >- $cgi->param('rows', 0); >-} elsif (defined $format and $format eq 'shareable') { >+ $cgi->param( 'rows', 0 ); >+} elsif ( defined $format and $format eq 'shareable' ) { >+ > # get the item search parameters from the url and fill form >-} elsif (defined $format) { >+} elsif ( defined $format ) { > die "Unsupported format $format"; > } > >-- >2.39.2
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 14322
:
164962
|
168084
|
168768
|
168863
|
169029
|
169033
|
169304
|
169305
|
169306
|
169948
|
169949
|
169950
|
169951
|
169952
|
169969
|
169970
|
169971
|
169972
|
169973
|
170347
|
170348
|
170349
|
170350
|
170351
|
170352
|
170721
|
170722
|
170723
|
170724
| 170725 |
170726
|
170727