Bugzilla – Attachment 61858 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: Adding link for email notification for new subscription issues to opac-detail
Bug-10357-Adding-link-for-email-notification-for-n.patch (text/plain), 12.54 KB, created by
Aleisha Amohia
on 2017-04-04 22:59:06 UTC
(
hide
)
Description:
Bug 10357: Adding link for email notification for new subscription issues to opac-detail
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-04-04 22:59:06 UTC
Size:
12.54 KB
patch
obsolete
>From 9c3b1a513de056c3ab70911808714baa78603923 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 6 Feb 2017 21:26:54 +0000 >Subject: [PATCH] Bug 10357: Adding link for email notification for new > subscription issues to opac-detail >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds the link to the opac-detail.pl page so it is less hard >to find. >Update: Fixing link to look like button, adding span ID around element >Update: Changing ID to Class >Update: Comment 14 fixes > >To test: >1) Add a subscription, attach it to a record and select a notice under >'Patron notification'. Hit Next, fill in some fields and save the >subscription >2) Go to that record detail page in the OPAC. Go to the subscriptions >tab, click 'More details'. Notice how many clicks it takes to see the >'Subscribe' button >3) Apply patch and go back to the details page for the record >4) Notice now there is a 'subscribe' button >5) Confirm this button works as expected and you are redirected to >the detail page >6) Confirm 'Cancel' works and redirect works too >7) Go down to 'More details' and confirm the buttons work and you are >redirected back to the serial-issues plage from here > >Sponsored-by: Catalyst IT > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Followed test plan, works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../bootstrap/en/modules/opac-alert-subscribe.tt | 4 ++-- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 11 +++++++++++ > .../bootstrap/en/modules/opac-serial-issues.tt | 4 ++-- > opac/opac-alert-subscribe.pl | 19 ++++++++++++++----- > opac/opac-detail.pl | 13 ++++++++++++- > opac/opac-serial-issues.pl | 11 +++++++++-- > 6 files changed, 50 insertions(+), 12 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 d4b79c5..f195feb 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 >@@ -25,7 +25,7 @@ > <h4>[% bibliotitle %]</h4> > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] > <input type="hidden" name="externalid" value="[% externalid %]"> >- <input type="hidden" name="alerttype" value="issue"> >+ <input type="hidden" name="alerttype" value="[% alerttype %]"> > <input type="hidden" name="biblionumber" value="[% biblionumber %]"> > <input type="hidden" name="op" value="alert_confirmed"> > <input type="submit" class="btn" value="Yes"> >@@ -39,7 +39,7 @@ > <h4>[% bibliotitle %]</h4> > [% IF ( notes ) %]<p>[% notes %]</p>[% END %] > <input type="hidden" name="externalid" value="[% externalid %]"> >- <input type="hidden" name="alerttype" value="issue"> >+ <input type="hidden" name="alerttype" value="[% alerttype %]"> > <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 4e0a5e7..e114ac5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -810,6 +810,17 @@ > <p>[% subscription.subscriptionnotes FILTER html_line_break %] </p> > [% END %] > <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p> >+ [% 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> >+ [% 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> >+ [% END %] >+ [% ELSE %] >+ You must log in if you want to subscribe to email notification on new issues >+ [% END %] >+ </span>[% END %] > [% IF ( subscription.missinglist ) %] > <p>Missing issues: [% subscription.missinglist %] </p> > [% END %] >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 4517ffc..75484e9 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&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_ser&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&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_ser&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 86a72fe..eec71f3 100755 >--- a/opac/opac-alert-subscribe.pl >+++ b/opac/opac-alert-subscribe.pl >@@ -53,10 +53,14 @@ my $biblionumber = $query->param('biblionumber'); > > if ( $op eq 'alert_confirmed' ) { > addalert( $loggedinuser, $alerttype, $externalid ); >- if ( $alerttype eq 'issue' ) { >+ if ( $alerttype eq 'issue_ser' ) { > print $query->redirect( > "opac-serial-issues.pl?biblionumber=$biblionumber"); > exit; >+ } elsif ( $alerttype eq 'issue_det' ) { >+ print $query->redirect( >+ "opac-detail.pl?biblionumber=$biblionumber"); >+ exit; > } > } > elsif ( $op eq 'cancel_confirmed' ) { >@@ -66,25 +70,30 @@ elsif ( $op eq 'cancel_confirmed' ) { > { # we are supposed to have only 1 result, but just in case... > delalert( $_->{alertid} ); > } >- if ( $alerttype eq 'issue' ) { >+ if ( $alerttype eq 'issue_ser' ) { > print $query->redirect( > "opac-serial-issues.pl?biblionumber=$biblionumber"); > exit; >+ } elsif ( $alerttype eq 'issue_det' ) { >+ print $query->redirect( >+ "opac-detail.pl?biblionumber=$biblionumber"); >+ exit; > } > >+ > } > else { >- if ( $alerttype eq 'issue' ) { # alert for subscription issues >+ if ( $alerttype eq 'issue_ser' || $alerttype eq 'issue_det' ) { # alert for subscription issues > my $subscription = &GetSubscription($externalid); > $template->param( >+ alerttype => $alerttype, > "typeissue$op" => 1, > bibliotitle => $subscription->{bibliotitle}, > notes => $subscription->{notes}, > externalid => $externalid, > biblionumber => $biblionumber, > ); >- } >- else { >+ } else { > } > > } >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 1336ae1..f4ace52 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -40,6 +40,7 @@ use C4::XSLT; > use C4::ShelfBrowser; > use C4::Reserves; > use C4::Charset; >+use C4::Letters; > use MARC::Record; > use MARC::Field; > use List::MoreUtils qw/any none/; >@@ -569,15 +570,25 @@ foreach my $subscription (@subscriptions) { > $cell{histstartdate} = $subscription->{histstartdate}; > $cell{histenddate} = $subscription->{histenddate}; > $cell{branchcode} = $subscription->{branchcode}; >- $cell{hasalert} = $subscription->{hasalert}; > $cell{callnumber} = $subscription->{callnumber}; > $cell{closed} = $subscription->{closed}; >+ $cell{letter} = $subscription->{letter}; >+ $cell{biblionumber} = $subscription->{biblionumber}; > #get the three latest serials. > $serials_to_display = $subscription->{opacdisplaycount}; > $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display; > $cell{opacdisplaycount} = $serials_to_display; > $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}); >+ } >+ if (@$sub[0]) { >+ $cell{hasalert} = 1; >+ } >+ } > push @subs, \%cell; > } > >diff --git a/opac/opac-serial-issues.pl b/opac/opac-serial-issues.pl >index 5b807ea..6a55a1d 100755 >--- a/opac/opac-serial-issues.pl >+++ b/opac/opac-serial-issues.pl >@@ -62,7 +62,11 @@ if ( $selectview eq "full" ) { > # now, check is there is an alert subscription for one of the subscriptions > if ($loggedinuser) { > foreach (@$subscriptions) { >- if (getalert($loggedinuser,'issue',$_->{subscriptionid})) { >+ my $sub = getalert($loggedinuser,'issue_ser',$_->{subscriptionid}); >+ if (!defined $sub) { >+ $sub = getalert($loggedinuser,'issue_det',$_->{subscriptionid}); >+ } >+ if ($sub) { > $_->{hasalert} = 1; > } > } >@@ -101,7 +105,10 @@ else { > # now, check is there is an alert subscription for one of the subscriptions > if ($loggedinuser){ > foreach (@$subscriptions) { >- my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid}); >+ my $subscription = getalert($loggedinuser,'issue_ser',$_->{subscriptionid}); >+ if (!defined $subscription) { >+ $subscription = getalert($loggedinuser,'issue_det',$_->{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