From 2bf9ba0c09fd69f15175db00f22f99044317e889 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia 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 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' link 5) Confirm this link still works as expected Sponsored-by: Catalyst IT Signed-off-by: Séverine QUEUNE Signed-off-by: Séverine QUEUNE --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 11 +++++++++++ opac/opac-detail.pl | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) 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 e4fb61f..3c4b181 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 @@

[% subscription.subscriptionnotes FILTER html_line_break %]

[% END %]

Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]

+ [% IF ( subscription.letter ) %] + [% IF ( loggedinusername ) %] + [% IF ( subscription.hasalert ) %] + You have subscribed to email notification on new issues. Cancel email notification + [% ELSE %] + Subscribe to email notification on new issues + [% END %] + [% ELSE %] + You must log in if you want to subscribe to email notification on new issues + [% END %] + [% END %] [% IF ( subscription.missinglist ) %]

Missing issues: [% subscription.missinglist %]

[% END %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index a7e643c..10e8184 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/; @@ -568,15 +569,22 @@ 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',$subscription->{subscriptionid}); + if (@$sub[0]) { + $cell{hasalert} = 1; + } + } push @subs, \%cell; } -- 2.1.4