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 lines)
Lines 26-31 Link Here
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="[% alerttype %]">
28
                                <input type="hidden" name="alerttype" value="[% alerttype %]">
29
                                <input type="hidden" name="referer" value="[% referer %]">
29
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
30
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
30
                                <input type="hidden" name="op" value="alert_confirmed">
31
                                <input type="hidden" name="op" value="alert_confirmed">
31
                                <input type="submit" class="btn" value="Yes">
32
                                <input type="submit" class="btn" value="Yes">
Lines 40-45 Link Here
40
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
41
                                [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
41
                                <input type="hidden" name="externalid" value="[% externalid %]">
42
                                <input type="hidden" name="externalid" value="[% externalid %]">
42
                                <input type="hidden" name="alerttype" value="[% alerttype %]">
43
                                <input type="hidden" name="alerttype" value="[% alerttype %]">
44
                                <input type="hidden" name="referer" value="[% referer %]">
43
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
45
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]">
44
                                <input type="hidden" name="op" value="cancel_confirmed">
46
                                <input type="hidden" name="op" value="cancel_confirmed">
45
                                <input type="submit" value="Yes" class="btn">
47
                                <input type="submit" value="Yes" class="btn">
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-2 / +2 lines)
Lines 813-821 Link Here
813
                                [% IF ( subscription.letter ) %]<span class="email_notifications">
813
                                [% IF ( subscription.letter ) %]<span class="email_notifications">
814
                                    [% IF ( loggedinusername ) %]
814
                                    [% IF ( loggedinusername ) %]
815
                                        [% IF ( subscription.hasalert ) %]
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>
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&amp;biblionumber=[% subscription.biblionumber %]">Cancel email notification</a>
817
                                        [% ELSE %]
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>
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&amp;biblionumber=[% subscription.biblionumber %]">Subscribe to email notification on new issues</a>
819
                                        [% END %]
819
                                        [% END %]
820
                                    [% ELSE %]
820
                                    [% ELSE %]
821
                                        You must log in if you want to subscribe to email notification on new issues
821
                                        You must log in if you want to subscribe to email notification on new issues
(-)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_ser&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&amp;referer=serial&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_ser&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&amp;referer=serial&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 (-7 / +7 lines)
Lines 38-43 my $sth; Link Here
38
my ( $template, $loggedinuser, $cookie );
38
my ( $template, $loggedinuser, $cookie );
39
my $externalid   = $query->param('externalid');
39
my $externalid   = $query->param('externalid');
40
my $alerttype    = $query->param('alerttype') || '';
40
my $alerttype    = $query->param('alerttype') || '';
41
my $referer      = $query->param('referer') || 'detail';
41
my $biblionumber = $query->param('biblionumber');
42
my $biblionumber = $query->param('biblionumber');
42
43
43
( $template, $loggedinuser, $cookie ) = get_template_and_user(
44
( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 53-63 my $biblionumber = $query->param('biblionumber'); Link Here
53
54
54
if ( $op eq 'alert_confirmed' ) {
55
if ( $op eq 'alert_confirmed' ) {
55
    addalert( $loggedinuser, $alerttype, $externalid );
56
    addalert( $loggedinuser, $alerttype, $externalid );
56
    if ( $alerttype eq 'issue_ser' ) {
57
    if ( $referer eq 'serial' ) {
57
        print $query->redirect(
58
        print $query->redirect(
58
            "opac-serial-issues.pl?biblionumber=$biblionumber");
59
            "opac-serial-issues.pl?biblionumber=$biblionumber");
59
        exit;
60
        exit;
60
    } elsif ( $alerttype eq 'issue_det' ) {
61
    } else {
61
        print $query->redirect(
62
        print $query->redirect(
62
            "opac-detail.pl?biblionumber=$biblionumber");
63
            "opac-detail.pl?biblionumber=$biblionumber");
63
        exit;
64
        exit;
Lines 70-80 elsif ( $op eq 'cancel_confirmed' ) { Link Here
70
    {    # we are supposed to have only 1 result, but just in case...
71
    {    # we are supposed to have only 1 result, but just in case...
71
        delalert( $_->{alertid} );
72
        delalert( $_->{alertid} );
72
    }
73
    }
73
    if ( $alerttype eq 'issue_ser' ) {
74
    if ( $referer eq 'serial' ) {
74
        print $query->redirect(
75
        print $query->redirect(
75
            "opac-serial-issues.pl?biblionumber=$biblionumber");
76
            "opac-serial-issues.pl?biblionumber=$biblionumber");
76
        exit;
77
        exit;
77
    } elsif ( $alerttype eq 'issue_det' ) {
78
    } else {
78
        print $query->redirect(
79
        print $query->redirect(
79
            "opac-detail.pl?biblionumber=$biblionumber");
80
            "opac-detail.pl?biblionumber=$biblionumber");
80
        exit;
81
        exit;
Lines 83-100 elsif ( $op eq 'cancel_confirmed' ) { Link Here
83
84
84
}
85
}
85
else {
86
else {
86
    if ( $alerttype eq 'issue_ser' || $alerttype eq 'issue_det' ) {    # alert for subscription issues
87
    if ( $alerttype eq 'issue' ) { # alert for subscription issues
87
        my $subscription = &GetSubscription($externalid);
88
        my $subscription = &GetSubscription($externalid);
88
        $template->param(
89
        $template->param(
89
            alerttype      => $alerttype,
90
            alerttype      => $alerttype,
91
            referer        => $referer,
90
            "typeissue$op" => 1,
92
            "typeissue$op" => 1,
91
            bibliotitle    => $subscription->{bibliotitle},
93
            bibliotitle    => $subscription->{bibliotitle},
92
            notes          => $subscription->{notes},
94
            notes          => $subscription->{notes},
93
            externalid     => $externalid,
95
            externalid     => $externalid,
94
            biblionumber   => $biblionumber,
96
            biblionumber   => $biblionumber,
95
        );
97
        );
96
    } else {
97
    }
98
    }
98
99
}
99
}
100
output_html_with_http_headers $query, $cookie, $template->output;
100
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-detail.pl (-4 / +1 lines)
Lines 582-591 foreach my $subscription (@subscriptions) { Link Here
582
    $cell{latestserials} =
582
    $cell{latestserials} =
583
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
583
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
584
    if ( $borrowernumber ) {
584
    if ( $borrowernumber ) {
585
        my $sub = getalert($borrowernumber,'issue_det',$subscription->{subscriptionid});
585
        my $sub = getalert($borrowernumber,'issue',$subscription->{subscriptionid});
586
        if ( !defined $sub ) {
587
            $sub = getalert($borrowernumber,'issue_ser',$subscription->{subscriptionid});
588
        }
589
        if (@$sub[0]) {
586
        if (@$sub[0]) {
590
            $cell{hasalert} = 1;
587
            $cell{hasalert} = 1;
591
        }
588
        }
(-)a/opac/opac-serial-issues.pl (-9 / +2 lines)
Lines 62-71 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
            my $sub = getalert($loggedinuser,'issue_ser',$_->{subscriptionid});
65
            my $sub = getalert($loggedinuser,'issue',$_->{subscriptionid});
66
            if (!defined $sub) {
67
                $sub = getalert($loggedinuser,'issue_det',$_->{subscriptionid});
68
            }
69
            if ($sub) {
66
            if ($sub) {
70
                $_->{hasalert} = 1;
67
                $_->{hasalert} = 1;
71
            }
68
            }
Lines 105-114 else { Link Here
105
    # now, check is there is an alert subscription for one of the subscriptions
102
    # now, check is there is an alert subscription for one of the subscriptions
106
    if ($loggedinuser){
103
    if ($loggedinuser){
107
        foreach (@$subscriptions) {
104
        foreach (@$subscriptions) {
108
            my $subscription = getalert($loggedinuser,'issue_ser',$_->{subscriptionid});
105
            my $subscription = getalert($loggedinuser,'issue',$_->{subscriptionid});
109
            if (!defined $subscription) {
110
                $subscription = getalert($loggedinuser,'issue_det',$_->{subscriptionid});
111
            }
112
            if (@$subscription[0]) {
106
            if (@$subscription[0]) {
113
                $_->{hasalert} = 1;
107
                $_->{hasalert} = 1;
114
            }
108
            }
115
- 

Return to bug 10357