View | Details | Raw Unified | Return to bug 10357
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-alert-subscribe.tt (-2 / +2 lines)
Lines 25-31 Link Here
25
                                <h4>[% bibliotitle %]</h4>
25
                                <h4>[% bibliotitle %]</h4>
26
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
26
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
27
                                <input type="hidden" name="externalid" value="[% externalid %]">
27
                                <input type="hidden" name="externalid" value="[% externalid %]">
28
                                <input type="hidden" name="alerttype" value="issue">
28
                                <input type="hidden" name="alerttype" value="[% alerttype %]">
29
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
29
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
30
                                <input type="hidden" name="op" value="alert_confirmed">
30
                                <input type="hidden" name="op" value="alert_confirmed">
31
                                <input type="submit" class="btn" value="Yes">
31
                                <input type="submit" class="btn" value="Yes">
Lines 39-45 Link Here
39
                                <h4>[% bibliotitle %]</h4>
39
                                <h4>[% bibliotitle %]</h4>
40
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
40
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
41
                                <input type="hidden" name="externalid" value="[% externalid %]">
41
                                <input type="hidden" name="externalid" value="[% externalid %]">
42
                                <input type="hidden" name="alerttype" value="issue">
42
                                <input type="hidden" name="alerttype" value="[% alerttype %]">
43
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
43
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
44
                                <input type="hidden" name="op" value="cancel_confirmed">
44
                                <input type="hidden" name="op" value="cancel_confirmed">
45
                                <input type="submit" value="Yes" class="btn">
45
                                <input type="submit" value="Yes" class="btn">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (+11 lines)
Lines 810-815 Link Here
810
                                    <p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>
810
                                    <p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>
811
                                [% END %]
811
                                [% END %]
812
                                <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
812
                                <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
813
                                [% IF ( subscription.letter ) %]<span class="email_notifications">
814
                                    [% IF ( loggedinusername ) %]
815
                                        [% IF ( subscription.hasalert ) %]
816
                                            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&amp;externalid=[% subscription.subscriptionid %]&amp;alerttype=issue_det&amp;biblionumber=[% subscription.biblionumber %]">Cancel email notification</a>
817
                                        [% ELSE %]
818
                                            <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 %]&amp;alerttype=issue_det&amp;biblionumber=[% subscription.biblionumber %]">Subscribe to email notification on new issues</a>
819
                                        [% END %]
820
                                    [% ELSE %]
821
                                        You must log in if you want to subscribe to email notification on new issues
822
                                    [% END %]
823
                                </span>[% END %]
813
                                [% IF ( subscription.missinglist ) %]
824
                                [% IF ( subscription.missinglist ) %]
814
                                    <p>Missing issues: [% subscription.missinglist %] </p>
825
                                    <p>Missing issues: [% subscription.missinglist %] </p>
815
                                [% END %]
826
                                [% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt (-2 / +2 lines)
Lines 137-147 Link Here
137
                                    [% IF ( subscription_LOO.letter ) %]
137
                                    [% IF ( subscription_LOO.letter ) %]
138
                                        [% IF ( loggedinusername ) %]
138
                                        [% IF ( loggedinusername ) %]
139
                                            [% IF ( subscription_LOO.hasalert ) %]
139
                                            [% IF ( subscription_LOO.hasalert ) %]
140
                                                You have subscribed to email notification on new issues <a href="opac-alert-subscribe.pl?op=cancel&amp;externalid=[% subscription_LOO.subscriptionid %]&amp;alerttype=issue&amp;biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Cancel email notification">
140
                                                You have subscribed to email notification on new issues <a href="opac-alert-subscribe.pl?op=cancel&amp;externalid=[% subscription_LOO.subscriptionid %]&amp;alerttype=issue_ser&amp;biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Cancel email notification">
141
                                                    Cancel email notification
141
                                                    Cancel email notification
142
                                                </a>
142
                                                </a>
143
                                            [% ELSE %]
143
                                            [% ELSE %]
144
                                                <a href="opac-alert-subscribe.pl?externalid=[% subscription_LOO.subscriptionid %]&amp;alerttype=issue&amp;biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Subscribe to email notification on new issues">
144
                                                <a href="opac-alert-subscribe.pl?externalid=[% subscription_LOO.subscriptionid %]&amp;alerttype=issue_ser&amp;biblionumber=[% subscription_LOO.biblionumber %]" class="btn" title="Subscribe to email notification on new issues">
145
                                                    Subscribe to email notification on new issues
145
                                                    Subscribe to email notification on new issues
146
                                                </a>
146
                                                </a>
147
                                            [% END %]
147
                                            [% END %]
(-)a/opac/opac-alert-subscribe.pl (-5 / +14 lines)
Lines 53-62 my $biblionumber = $query->param('biblionumber'); Link Here
53
53
54
if ( $op eq 'alert_confirmed' ) {
54
if ( $op eq 'alert_confirmed' ) {
55
    addalert( $loggedinuser, $alerttype, $externalid );
55
    addalert( $loggedinuser, $alerttype, $externalid );
56
    if ( $alerttype eq 'issue' ) {
56
    if ( $alerttype eq 'issue_ser' ) {
57
        print $query->redirect(
57
        print $query->redirect(
58
            "opac-serial-issues.pl?biblionumber=$biblionumber");
58
            "opac-serial-issues.pl?biblionumber=$biblionumber");
59
        exit;
59
        exit;
60
    } elsif ( $alerttype eq 'issue_det' ) {
61
        print $query->redirect(
62
            "opac-detail.pl?biblionumber=$biblionumber");
63
        exit;
60
    }
64
    }
61
}
65
}
62
elsif ( $op eq 'cancel_confirmed' ) {
66
elsif ( $op eq 'cancel_confirmed' ) {
Lines 66-90 elsif ( $op eq 'cancel_confirmed' ) { Link Here
66
    {    # we are supposed to have only 1 result, but just in case...
70
    {    # we are supposed to have only 1 result, but just in case...
67
        delalert( $_->{alertid} );
71
        delalert( $_->{alertid} );
68
    }
72
    }
69
    if ( $alerttype eq 'issue' ) {
73
    if ( $alerttype eq 'issue_ser' ) {
70
        print $query->redirect(
74
        print $query->redirect(
71
            "opac-serial-issues.pl?biblionumber=$biblionumber");
75
            "opac-serial-issues.pl?biblionumber=$biblionumber");
72
        exit;
76
        exit;
77
    } elsif ( $alerttype eq 'issue_det' ) {
78
        print $query->redirect(
79
            "opac-detail.pl?biblionumber=$biblionumber");
80
        exit;
73
    }
81
    }
74
82
83
75
}
84
}
76
else {
85
else {
77
    if ( $alerttype eq 'issue' ) {    # alert for subscription issues
86
    if ( $alerttype eq 'issue_ser' || $alerttype eq 'issue_det' ) {    # alert for subscription issues
78
        my $subscription = &GetSubscription($externalid);
87
        my $subscription = &GetSubscription($externalid);
79
        $template->param(
88
        $template->param(
89
            alerttype      => $alerttype,
80
            "typeissue$op" => 1,
90
            "typeissue$op" => 1,
81
            bibliotitle    => $subscription->{bibliotitle},
91
            bibliotitle    => $subscription->{bibliotitle},
82
            notes          => $subscription->{notes},
92
            notes          => $subscription->{notes},
83
            externalid     => $externalid,
93
            externalid     => $externalid,
84
            biblionumber   => $biblionumber,
94
            biblionumber   => $biblionumber,
85
        );
95
        );
86
    }
96
    } else {
87
    else {
88
    }
97
    }
89
98
90
}
99
}
(-)a/opac/opac-detail.pl (-1 / +12 lines)
Lines 40-45 use C4::XSLT; Link Here
40
use C4::ShelfBrowser;
40
use C4::ShelfBrowser;
41
use C4::Reserves;
41
use C4::Reserves;
42
use C4::Charset;
42
use C4::Charset;
43
use C4::Letters;
43
use MARC::Record;
44
use MARC::Record;
44
use MARC::Field;
45
use MARC::Field;
45
use List::MoreUtils qw/any none/;
46
use List::MoreUtils qw/any none/;
Lines 569-583 foreach my $subscription (@subscriptions) { Link Here
569
    $cell{histstartdate}     = $subscription->{histstartdate};
570
    $cell{histstartdate}     = $subscription->{histstartdate};
570
    $cell{histenddate}       = $subscription->{histenddate};
571
    $cell{histenddate}       = $subscription->{histenddate};
571
    $cell{branchcode}        = $subscription->{branchcode};
572
    $cell{branchcode}        = $subscription->{branchcode};
572
    $cell{hasalert}          = $subscription->{hasalert};
573
    $cell{callnumber}        = $subscription->{callnumber};
573
    $cell{callnumber}        = $subscription->{callnumber};
574
    $cell{closed}            = $subscription->{closed};
574
    $cell{closed}            = $subscription->{closed};
575
    $cell{letter}            = $subscription->{letter};
576
    $cell{biblionumber}      = $subscription->{biblionumber};
575
    #get the three latest serials.
577
    #get the three latest serials.
576
    $serials_to_display = $subscription->{opacdisplaycount};
578
    $serials_to_display = $subscription->{opacdisplaycount};
577
    $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
579
    $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
578
	$cell{opacdisplaycount} = $serials_to_display;
580
	$cell{opacdisplaycount} = $serials_to_display;
579
    $cell{latestserials} =
581
    $cell{latestserials} =
580
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
582
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
583
    if ( $borrowernumber ) {
584
        my $sub = getalert($borrowernumber,'issue_det',$subscription->{subscriptionid});
585
        if ( !defined $sub ) {
586
            $sub = getalert($borrowernumber,'issue_ser',$subscription->{subscriptionid});
587
        }
588
        if (@$sub[0]) {
589
            $cell{hasalert} = 1;
590
        }
591
    }
581
    push @subs, \%cell;
592
    push @subs, \%cell;
582
}
593
}
583
594
(-)a/opac/opac-serial-issues.pl (-3 / +9 lines)
Lines 62-68 if ( $selectview eq "full" ) { Link Here
62
    # now, check is there is an alert subscription for one of the subscriptions
62
    # now, check is there is an alert subscription for one of the subscriptions
63
    if ($loggedinuser) {
63
    if ($loggedinuser) {
64
        foreach (@$subscriptions) {
64
        foreach (@$subscriptions) {
65
            if (getalert($loggedinuser,'issue',$_->{subscriptionid})) {
65
            my $sub = getalert($loggedinuser,'issue_ser',$_->{subscriptionid});
66
            if (!defined $sub) {
67
                $sub = getalert($loggedinuser,'issue_det',$_->{subscriptionid});
68
            }
69
            if ($sub) {
66
                $_->{hasalert} = 1;
70
                $_->{hasalert} = 1;
67
            }
71
            }
68
        }
72
        }
Lines 101-107 else { Link Here
101
    # now, check is there is an alert subscription for one of the subscriptions
105
    # now, check is there is an alert subscription for one of the subscriptions
102
    if ($loggedinuser){
106
    if ($loggedinuser){
103
        foreach (@$subscriptions) {
107
        foreach (@$subscriptions) {
104
            my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid});
108
            my $subscription = getalert($loggedinuser,'issue_ser',$_->{subscriptionid});
109
            if (!defined $subscription) {
110
                $subscription = getalert($loggedinuser,'issue_det',$_->{subscriptionid});
111
            }
105
            if (@$subscription[0]) {
112
            if (@$subscription[0]) {
106
                $_->{hasalert} = 1;
113
                $_->{hasalert} = 1;
107
            }
114
            }
108
- 

Return to bug 10357