Bugzilla – Attachment 102191 Details for
Bug 4461
Add a context-sensitive report a problem process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 4461: (follow-up) Redirect to 404 if OPACProblemReport not enabled
Bug-4461-follow-up-Redirect-to-404-if-OPACProblemR.patch (text/plain), 8.60 KB, created by
Jonathan Druart
on 2020-04-01 09:48:41 UTC
(
hide
)
Description:
Bug 4461: (follow-up) Redirect to 404 if OPACProblemReport not enabled
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-04-01 09:48:41 UTC
Size:
8.60 KB
patch
obsolete
>From 0d0ece94799f7ed52ca4386ef3e419fff56fbc0d Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 11 Feb 2020 19:48:30 +0000 >Subject: [PATCH] Bug 4461: (follow-up) Redirect to 404 if OPACProblemReport > not enabled > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../en/modules/opac-reportproblem.tt | 98 +++++++++---------- > opac/opac-reportproblem.pl | 4 + > 2 files changed, 50 insertions(+), 52 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt >index 51c037fc16..102f63cf58 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reportproblem.tt >@@ -27,60 +27,54 @@ > [% END %] > <h1>Report a problem</h1> > >- [% IF Koha.Preference('OPACReportProblem') %] >- >- [% IF ( successfuladd ) %] >- <div class="alert alert-info">Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient %][% END %].</div> >- [% END %] >- [% IF ( ( nolibemail and noadminemail ) or norecipients ) %] >- <div class="alert">Unable to send problem reports.</div> >- [% ELSE %] >- <div id="reportproblem" class="maincontent toptabs"> >- <form name="reportlibform" action="/cgi-bin/koha/opac-reportproblem.pl" method="post"> >- <input type="hidden" name="op" value="addreport"> >- <fieldset class="rows"> >- <ol> >- <li> >- <label for="recipient">Send problem report to: </label> >- [% IF !nolibemail and noadminemail %] >+ [% IF ( successfuladd ) %] >+ <div class="alert alert-info">Your problem report has been sent to the [% IF ( recipient == 'admin' ) %]Koha Administrator[% ELSE %][% recipient %][% END %].</div> >+ [% END %] >+ [% IF ( ( nolibemail and noadminemail ) or norecipients ) %] >+ <div class="alert">Unable to send problem reports.</div> >+ [% ELSE %] >+ <div id="reportproblem" class="maincontent toptabs"> >+ <form name="reportlibform" action="/cgi-bin/koha/opac-reportproblem.pl" method="post"> >+ <input type="hidden" name="op" value="addreport"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="recipient">Send problem report to: </label> >+ [% IF !nolibemail and noadminemail %] >+ <option value="library">A librarian</option> >+ [% ELSIF !noadminemail and nolibemail %] >+ <option value="admin">Koha Administrator</option> >+ [% ELSE %] >+ <select name="recipient" id="recipient"> > <option value="library">A librarian</option> >- [% ELSIF !noadminemail and nolibemail %] > <option value="admin">Koha Administrator</option> >- [% ELSE %] >- <select name="recipient" id="recipient"> >- <option value="library">A librarian</option> >- <option value="admin">Koha Administrator</option> >- </select> >- [% END %] >- </li> >- <li> >- <label for="place">Problem found on page: </label> >- <input type="hidden" name="place" id="place" value="[% probpage %]"> >- [% probpage | html %] >- </li> >- <li> >- <label for="user">Username: </label> >- <input type="hidden" name="user" id="user" value="[% username %]" class="span3"> >- [% username | html %] >- <li> >- <label for="subject">Subject: </label> >- <input type="text" name="subject" id="subject" value="[% subject %]" class="span3"> >- </li> >- <li> >- <label for="message">Message: </label> >- <textarea name="message" id="message" rows="7" cols="60"></textarea> >- </li> >- </ol> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" value="Submit" class="btn"> >- </fieldset> >- </form> >- </div> >- [% END %] >- >- [% ELSE %] <!-- OPACReportProblem preference --> >- <div class="alert">Your library has not activated this feature.</div> >+ </select> >+ [% END %] >+ </li> >+ <li> >+ <label for="place">Problem found on page: </label> >+ <input type="hidden" name="place" id="place" value="[% probpage %]"> >+ [% probpage | html %] >+ </li> >+ <li> >+ <label for="user">Username: </label> >+ <input type="hidden" name="user" id="user" value="[% username %]" class="span3"> >+ [% username | html %] >+ <li> >+ <label for="subject">Subject: </label> >+ <input type="text" name="subject" id="subject" value="[% subject %]" class="span3"> >+ </li> >+ <li> >+ <label for="message">Message: </label> >+ <textarea name="message" id="message" rows="7" cols="60"></textarea> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="submit" value="Submit" class="btn"> >+ </fieldset> >+ </form> >+ </div> > [% END %] > > </div> <!-- / .span10/12 --> >diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl >index d09afe265d..7660e6c5eb 100644 >--- a/opac/opac-reportproblem.pl >+++ b/opac/opac-reportproblem.pl >@@ -39,6 +39,10 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >+if ( !C4::Context->preference('OPACReportProblem') ){ >+ print $input->redirect("/cgi-bin/koha/errors/404.pl"); >+} >+ > my $problempage = $ENV{HTTP_REFERER}; > my $member = Koha::Patrons->find($borrowernumber); > my $username = $member->userid; >-- >2.20.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 4461
:
58887
|
59032
|
61654
|
65871
|
66253
|
66323
|
66324
|
98687
|
98688
|
98689
|
98725
|
99551
|
99599
|
99600
|
99601
|
99602
|
99603
|
99633
|
99635
|
99636
|
99637
|
99638
|
99639
|
99929
|
99930
|
99931
|
99932
|
99933
|
99934
|
99935
|
99936
|
99937
|
99938
|
99939
|
99940
|
99941
|
99942
|
100488
|
100489
|
100490
|
100491
|
100492
|
100493
|
100494
|
100495
|
100496
|
100497
|
100498
|
100499
|
100500
|
100506
|
100507
|
100508
|
100509
|
100510
|
100511
|
100512
|
100513
|
100514
|
100515
|
100516
|
100517
|
100518
|
100519
|
100520
|
100521
|
100522
|
100523
|
100524
|
100619
|
100989
|
100990
|
102188
|
102189
|
102190
|
102191
|
102192
|
102193
|
102194
|
102195
|
102196
|
102198
|
102200
|
102201
|
102202
|
102203
|
102204
|
102205
|
102206
|
102207
|
102208
|
102209
|
102210
|
102211
|
102253
|
102279
|
102281
|
102308
|
102309
|
102310
|
102311
|
102312
|
102313
|
102314
|
102315
|
102316
|
102317
|
102318
|
102319
|
102320
|
102321
|
102322
|
102323
|
102324
|
102325
|
102326
|
102327
|
102328
|
102329
|
102330
|
102331
|
102358
|
102359
|
102360
|
102361
|
102362
|
102363
|
102364
|
102365
|
102366
|
102367
|
102368
|
102369
|
102370
|
102371
|
102372
|
102373
|
102374
|
102375
|
102376
|
102377
|
102378
|
102379
|
102380
|
102381
|
102382
|
102383
|
102384
|
102385
|
102386