Bugzilla – Attachment 69060 Details for
Bug 7317
Add an Interlibrary Loan Module to Circulation and OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7317: Fix infinite loop in OPAC
Bug-7317-Fix-infinite-loop-in-OPAC.patch (text/plain), 7.26 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-11-09 14:50:25 UTC
(
hide
)
Description:
Bug 7317: Fix infinite loop in OPAC
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-11-09 14:50:25 UTC
Size:
7.26 KB
patch
obsolete
>From 2964a011f4cf8fddcc9b0760d1e05a84627ea1dd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 9 Nov 2017 11:47:39 -0300 >Subject: [PATCH] Bug 7317: Fix infinite loop in OPAC > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../bootstrap/en/modules/opac-illrequests.tt | 19 +--- > opac/opac-illrequests.pl | 124 ++++++++++----------- > 2 files changed, 63 insertions(+), 80 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >index 2fe6991a94..547d4d34cf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -55,24 +55,7 @@ > [% IF method == 'create' %] > <h2>New Interlibrary loan request</h2> > [% INCLUDE messages %] >- [% IF backends %] >- <form method="post" id="illrequestcreate-form" novalidate="novalidate"> >- <fieldset class="rows"> >- <label for="backend">Provider:</label> >- <select name="backend"> >- [% FOREACH backend IN backends %] >- <option value="[% backend %]">[% backend %]</option> >- [% END %] >- </select> >- </fieldset> >- <fieldset class="action"> >- <input type="hidden" name="method" value="create"> >- <input type="submit" name="create_select_backend" value="Next »"> >- </fieldset> >- </form> >- [% ELSE %] >- [% PROCESS $whole.opac_template %] >- [% END %] >+ [% PROCESS $whole.opac_template %] > [% ELSIF method == 'list' %] > <h2>Interlibrary loan requests</h2> > [% INCLUDE messages %] >diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl >index 4590284184..0aa88247b2 100755 >--- a/opac/opac-illrequests.pl >+++ b/opac/opac-illrequests.pl >@@ -52,74 +52,74 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > # Are we able to actually work? > my $backends = Koha::Illrequest::Config->new->available_backends; > my $backends_available = ( scalar @{$backends} > 0 ); >-$template->param( backends_available => $backends_available ); >+$template->param( >+ backends => $backends, >+ backends_available => $backends_available >+); > > my $op = $params->{'method'} || 'list'; > >-if ( $op eq 'list' ) { >- >- my $requests = Koha::Illrequests->search( >- { borrowernumber => $loggedinuser } >- ); >- my $req = Koha::Illrequest->new; >- $template->param( >- requests => $requests, >- backends => $req->available_backends >- ); >- >-} elsif ( $op eq 'view') { >- my $request = Koha::Illrequests->find({ >- borrowernumber => $loggedinuser, >- illrequest_id => $params->{illrequest_id} >- }); >- $template->param( >- request => $request >- ); >- >-} elsif ( $op eq 'update') { >- my $request = Koha::Illrequests->find({ >- borrowernumber => $loggedinuser, >- illrequest_id => $params->{illrequest_id} >- }); >- $request->notesopac($params->{notesopac})->store; >- print $query->redirect( >- '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' . >- $params->{illrequest_id} . >- '&message=1' >- ); >-} elsif ( $op eq 'cancreq') { >- my $request = Koha::Illrequests->find({ >- borrowernumber => $loggedinuser, >- illrequest_id => $params->{illrequest_id} >- }); >- $request->status('CANCREQ')->store; >- print $query->redirect( >- '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' . >- $params->{illrequest_id} . >- '&message=1' >- ); >- >-} elsif ( $op eq 'create' ) { >- if (!$params->{backend}) { >- my $req = Koha::Illrequest->new; >+if ( $backends_available ) { >+ >+ if ( $op eq 'list' ) { >+ >+ my $requests = Koha::Illrequests->search( >+ { borrowernumber => $loggedinuser } >+ ); > $template->param( >- backends => $req->available_backends >+ requests => $requests > ); >- } else { >- my $request = Koha::Illrequest->new >- ->load_backend($params->{backend}); >- $params->{cardnumber} = Koha::Patrons->find({ >- borrowernumber => $loggedinuser >- })->cardnumber; >- my $backend_result = $request->backend_create($params); >+ >+ } elsif ( $op eq 'view') { >+ my $request = Koha::Illrequests->find({ >+ borrowernumber => $loggedinuser, >+ illrequest_id => $params->{illrequest_id} >+ }); > $template->param( >- media => [ "Book", "Article", "Journal" ], >- branches => Koha::Libraries->search->unblessed, >- whole => $backend_result, >- request => $request >+ request => $request > ); >- if ($backend_result->{stage} eq 'commit') { >- print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2'); >+ >+ } elsif ( $op eq 'update') { >+ my $request = Koha::Illrequests->find({ >+ borrowernumber => $loggedinuser, >+ illrequest_id => $params->{illrequest_id} >+ }); >+ $request->notesopac($params->{notesopac})->store; >+ print $query->redirect( >+ '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' . >+ $params->{illrequest_id} . >+ '&message=1' >+ ); >+ >+ } elsif ( $op eq 'cancreq') { >+ my $request = Koha::Illrequests->find({ >+ borrowernumber => $loggedinuser, >+ illrequest_id => $params->{illrequest_id} >+ }); >+ $request->status('CANCREQ')->store; >+ print $query->redirect( >+ '/cgi-bin/koha/opac-illrequests.pl?method=view&illrequest_id=' . >+ $params->{illrequest_id} . >+ '&message=1' >+ ); >+ >+ } elsif ( $op eq 'create' ) { >+ if ($params->{backend}) { >+ my $request = Koha::Illrequest->new >+ ->load_backend($params->{backend}); >+ $params->{cardnumber} = Koha::Patrons->find({ >+ borrowernumber => $loggedinuser >+ })->cardnumber; >+ my $backend_result = $request->backend_create($params); >+ $template->param( >+ media => [ "Book", "Article", "Journal" ], >+ branches => Koha::Libraries->search->unblessed, >+ whole => $backend_result, >+ request => $request >+ ); >+ if ($backend_result->{stage} eq 'commit') { >+ print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2'); >+ } > } > } > } >@@ -127,7 +127,7 @@ if ( $op eq 'list' ) { > $template->param( > message => $params->{message}, > illrequestsview => 1, >- method => $op >+ method => $op > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.14.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 7317
:
59893
|
59894
|
59895
|
59920
|
60485
|
60486
|
60487
|
60488
|
63081
|
63082
|
63083
|
63084
|
63085
|
63086
|
63087
|
63088
|
63089
|
63090
|
63113
|
63175
|
63176
|
63354
|
63421
|
63472
|
63475
|
65469
|
65470
|
65471
|
65472
|
65473
|
65474
|
65475
|
65476
|
66266
|
67242
|
67243
|
67244
|
67245
|
67246
|
67247
|
67248
|
67249
|
67250
|
67251
|
67252
|
67253
|
67254
|
67255
|
67256
|
67257
|
67258
|
67259
|
67260
|
67261
|
67262
|
67263
|
67264
|
67281
|
67282
|
67283
|
67284
|
67285
|
67286
|
67287
|
67288
|
67289
|
67290
|
67291
|
67292
|
67293
|
67294
|
67295
|
67296
|
67297
|
67298
|
67299
|
67300
|
67301
|
67302
|
67303
|
68185
|
68186
|
68328
|
68391
|
68406
|
68407
|
68408
|
68409
|
68418
|
68444
|
68445
|
68483
|
68484
|
68485
|
68487
|
68516
|
68517
|
68518
|
68519
|
68520
|
68521
|
68522
|
68523
|
68524
|
68525
|
68542
|
68543
|
68544
|
68545
|
68546
|
68547
|
68548
|
68549
|
68550
|
68551
|
68552
|
68558
|
68559
|
68560
|
68561
|
68562
|
68563
|
68564
|
68565
|
68566
|
68567
|
68858
|
68874
|
68877
|
68878
|
68885
|
68886
|
68921
|
68922
|
68926
|
68927
|
68928
|
68929
|
68931
|
68932
|
68933
|
68988
|
68989
|
68999
|
69000
|
69006
|
69008
|
69009
|
69012
|
69014
|
69044
|
69045
|
69046
|
69056
|
69059
| 69060 |
69061
|
69063
|
69064
|
69065
|
69066
|
69069
|
69070
|
69071
|
69074