Bugzilla – Attachment 62310 Details for
Bug 10357
Send email when serial received subscription link is hard to find
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10357: Do not change the alerttype
Bug-10357-Do-not-change-the-alerttype.patch (text/plain), 11.25 KB, created by
Jonathan Druart
on 2017-04-18 18:16:49 UTC
(
hide
)
Description:
Bug 10357: Do not change the alerttype
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-04-18 18:16:49 UTC
Size:
11.25 KB
patch
obsolete
>From 236567ead436eb89f2a9ba3f3d6f3d300e09d97d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 18 Apr 2017 15:13:18 -0300 >Subject: [PATCH] Bug 10357: Do not change the alerttype > >Previous patch modified the alerttype from "issue" to "issue_det" or >"issue_ser". This is wrong, we do not want to modify this value, >especially because it's used in C4::Letters::SendAlerts >This patch uses a $referer variable instead, like it is already used in >other scripts for redirection. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt | 2 ++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > .../opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt | 4 ++-- > opac/opac-alert-subscribe.pl | 14 +++++++------- > opac/opac-detail.pl | 5 +---- > opac/opac-serial-issues.pl | 10 ++-------- > 6 files changed, 16 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt >index f195feb..b87072f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt >@@ -26,6 +26,7 @@ > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] > <input type="hidden" name="externalid" value="[% externalid %]"> > <input type="hidden" name="alerttype" value="[% alerttype %]"> >+ <input type="hidden" name="referer" value="[% referer %]"> > <input type="hidden" name="biblionumber" value="[% biblionumber %]"> > <input type="hidden" name="op" value="alert_confirmed"> > <input type="submit" class="btn" value="Yes"> >@@ -40,6 +41,7 @@ > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] > <input type="hidden" name="externalid" value="[% externalid %]"> > <input type="hidden" name="alerttype" value="[% alerttype %]"> >+ <input type="hidden" name="referer" value="[% referer %]"> > <input type="hidden" name="biblionumber" value="[% biblionumber %]"> > <input type="hidden" name="op" value="cancel_confirmed"> > <input type="submit" value="Yes" class="btn"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 8a386e5..e4eabbe 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -813,9 +813,9 @@ > [% IF ( subscription.letter ) %]<span class="email_notifications"> > [% IF ( loggedinusername ) %] > [% IF ( subscription.hasalert ) %] >- You have subscribed to email notification on new issues. <a style="color:#000;" class="btn" title="Cancel email notification" href="/cgi-bin/koha/opac-alert-subscribe.pl?op=cancel&externalid=[% subscription.subscriptionid %]&alerttype=issue_det&biblionumber=[% subscription.biblionumber %]">Cancel email notification</a> >+ You have subscribed to email notification on new issues. <a style="color:#000;" class="btn" title="Cancel email notification" href="/cgi-bin/koha/opac-alert-subscribe.pl?op=cancel&externalid=[% subscription.subscriptionid %]&alerttype=issue&biblionumber=[% subscription.biblionumber %]">Cancel email notification</a> > [% ELSE %] >- <a style="color:#000;" class="btn" title="Subscribe to email notification on new issues" href="/cgi-bin/koha/opac-alert-subscribe.pl?externalid=[% subscription.subscriptionid %]&alerttype=issue_det&biblionumber=[% subscription.biblionumber %]">Subscribe to email notification on new issues</a> >+ <a style="color:#000;" class="btn" title="Subscribe to email notification on new issues" href="/cgi-bin/koha/opac-alert-subscribe.pl?externalid=[% subscription.subscriptionid %]&alerttype=issue&biblionumber=[% subscription.biblionumber %]">Subscribe to email notification on new issues</a> > [% END %] > [% ELSE %] > You must log in if you want to subscribe to email notification on new issues >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt >index 75484e9..b231032 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt >@@ -137,11 +137,11 @@ > [% IF ( subscription_LOO.letter ) %] > [% IF ( loggedinusername ) %] > [% IF ( subscription_LOO.hasalert ) %] >- You have subscribed to email notification on new issues <a href="opac-alert-subscribe.pl?op=cancel&externalid=[% subscription_LOO.subscriptionid %]&alerttype=issue_ser&biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Cancel email notification"> >+ You have subscribed to email notification on new issues <a href="opac-alert-subscribe.pl?op=cancel&externalid=[% subscription_LOO.subscriptionid %]&alerttype=issue&referer=serial&biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Cancel email notification"> > Cancel email notification > </a> > [% ELSE %] >- <a href="opac-alert-subscribe.pl?externalid=[% subscription_LOO.subscriptionid %]&alerttype=issue_ser&biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Subscribe to email notification on new issues"> >+ <a href="opac-alert-subscribe.pl?externalid=[% subscription_LOO.subscriptionid %]&alerttype=issue&referer=serial&biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Subscribe to email notification on new issues"> > Subscribe to email notification on new issues > </a> > [% END %] >diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl >index eec71f3..6ed153d 100755 >--- a/opac/opac-alert-subscribe.pl >+++ b/opac/opac-alert-subscribe.pl >@@ -38,6 +38,7 @@ my $sth; > my ( $template, $loggedinuser, $cookie ); > my $externalid = $query->param('externalid'); > my $alerttype = $query->param('alerttype') || ''; >+my $referer = $query->param('referer') || 'detail'; > my $biblionumber = $query->param('biblionumber'); > > ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -53,11 +54,11 @@ my $biblionumber = $query->param('biblionumber'); > > if ( $op eq 'alert_confirmed' ) { > addalert( $loggedinuser, $alerttype, $externalid ); >- if ( $alerttype eq 'issue_ser' ) { >+ if ( $referer eq 'serial' ) { > print $query->redirect( > "opac-serial-issues.pl?biblionumber=$biblionumber"); > exit; >- } elsif ( $alerttype eq 'issue_det' ) { >+ } else { > print $query->redirect( > "opac-detail.pl?biblionumber=$biblionumber"); > exit; >@@ -70,11 +71,11 @@ elsif ( $op eq 'cancel_confirmed' ) { > { # we are supposed to have only 1 result, but just in case... > delalert( $_->{alertid} ); > } >- if ( $alerttype eq 'issue_ser' ) { >+ if ( $referer eq 'serial' ) { > print $query->redirect( > "opac-serial-issues.pl?biblionumber=$biblionumber"); > exit; >- } elsif ( $alerttype eq 'issue_det' ) { >+ } else { > print $query->redirect( > "opac-detail.pl?biblionumber=$biblionumber"); > exit; >@@ -83,18 +84,17 @@ elsif ( $op eq 'cancel_confirmed' ) { > > } > else { >- if ( $alerttype eq 'issue_ser' || $alerttype eq 'issue_det' ) { # alert for subscription issues >+ if ( $alerttype eq 'issue' ) { # alert for subscription issues > my $subscription = &GetSubscription($externalid); > $template->param( > alerttype => $alerttype, >+ referer => $referer, > "typeissue$op" => 1, > bibliotitle => $subscription->{bibliotitle}, > notes => $subscription->{notes}, > externalid => $externalid, > biblionumber => $biblionumber, > ); >- } else { > } >- > } > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 622c1fc..f2c2f6f 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -582,10 +582,7 @@ foreach my $subscription (@subscriptions) { > $cell{latestserials} = > GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display ); > if ( $borrowernumber ) { >- my $sub = getalert($borrowernumber,'issue_det',$subscription->{subscriptionid}); >- if ( !defined $sub ) { >- $sub = getalert($borrowernumber,'issue_ser',$subscription->{subscriptionid}); >- } >+ my $sub = getalert($borrowernumber,'issue',$subscription->{subscriptionid}); > if (@$sub[0]) { > $cell{hasalert} = 1; > } >diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl >index 6a55a1d..f6d7aa8 100755 >--- a/opac/opac-serial-issues.pl >+++ b/opac/opac-serial-issues.pl >@@ -62,10 +62,7 @@ if ( $selectview eq "full" ) { > # now, check is there is an alert subscription for one of the subscriptions > if ($loggedinuser) { > foreach (@$subscriptions) { >- my $sub = getalert($loggedinuser,'issue_ser',$_->{subscriptionid}); >- if (!defined $sub) { >- $sub = getalert($loggedinuser,'issue_det',$_->{subscriptionid}); >- } >+ my $sub = getalert($loggedinuser,'issue',$_->{subscriptionid}); > if ($sub) { > $_->{hasalert} = 1; > } >@@ -105,10 +102,7 @@ else { > # now, check is there is an alert subscription for one of the subscriptions > if ($loggedinuser){ > foreach (@$subscriptions) { >- my $subscription = getalert($loggedinuser,'issue_ser',$_->{subscriptionid}); >- if (!defined $subscription) { >- $subscription = getalert($loggedinuser,'issue_det',$_->{subscriptionid}); >- } >+ my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid}); > if (@$subscription[0]) { > $_->{hasalert} = 1; > } >-- >2.1.4
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 10357
:
59955
|
61531
|
61653
|
61723
|
61724
|
61726
|
61858
|
61869
|
62309
| 62310