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

(-)a/C4/Serials.pm (+2 lines)
Lines 291-296 sub GetSubscription { Link Here
291
    $sth->execute($subscriptionid);
291
    $sth->execute($subscriptionid);
292
    my $subscription = $sth->fetchrow_hashref;
292
    my $subscription = $sth->fetchrow_hashref;
293
293
294
    return unless $subscription;
295
294
    $subscription->{cannotedit} = not can_edit_subscription( $subscription );
296
    $subscription->{cannotedit} = not can_edit_subscription( $subscription );
295
297
296
    # Add additional fields to the subscription into a new key "additional_fields"
298
    # Add additional fields to the subscription into a new key "additional_fields"
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocking_errors.inc (+2 lines)
Lines 7-12 Link Here
7
        <div class="dialog message">This bibliographic record does not exist.</div>
7
        <div class="dialog message">This bibliographic record does not exist.</div>
8
    [% CASE 'unknown_item' %]
8
    [% CASE 'unknown_item' %]
9
        <div class="dialog message">This item does not exist.</div>
9
        <div class="dialog message">This item does not exist.</div>
10
    [% CASE 'unknown_subscription' %]
11
        <div class="dialog message">This subscription does not exist.</div>
10
    [% CASE %][% blocking_error %]
12
    [% CASE %][% blocking_error %]
11
    [% END %]
13
    [% END %]
12
14
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt (-1 / +9 lines)
Lines 7-13 Link Here
7
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'header.inc' %]
8
[% INCLUDE 'serials-search.inc' %]
8
[% INCLUDE 'serials-search.inc' %]
9
9
10
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% title |html %]</i></a> &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]</div>
10
<div id="breadcrumbs">
11
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
12
    &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
13
    [% UNLESS blocking_error %]
14
        &rsaquo; <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% title |html %]</i></a>
15
        &rsaquo; [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %]
16
    [% END %]
17
</div>
11
18
12
<div id="doc3" class="yui-t2">
19
<div id="doc3" class="yui-t2">
13
   
20
   
Lines 15-20 Link Here
15
	<div id="yui-main">
22
	<div id="yui-main">
16
	<div class="yui-b">
23
	<div class="yui-b">
17
24
25
[% INCLUDE 'blocking_errors.inc' %]
18
26
19
[% IF ( op ) %]
27
[% IF ( op ) %]
20
<h1>Create routing list for <i>[% title |html %]</i></h1>
28
<h1>Create routing list for <i>[% title |html %]</i></h1>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 / +8 lines)
Lines 17-23 fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ Link Here
17
[% INCLUDE 'header.inc' %]
17
[% INCLUDE 'header.inc' %]
18
[% INCLUDE 'serials-search.inc' %]
18
[% INCLUDE 'serials-search.inc' %]
19
19
20
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]</div>
20
<div id="breadcrumbs">
21
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22
    &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
23
    [% UNLESS blocking_error %]
24
        &rsaquo; [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]
25
    [% END %]
26
</div>
27
[% INCLUDE 'blocking_errors.inc' %]
21
28
22
<div class="main container-fluid">
29
<div class="main container-fluid">
23
    <div class="row">
30
    <div class="row">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (-1 / +6 lines)
Lines 12-18 Link Here
12
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
13
[% INCLUDE 'serials-search.inc' %]
13
[% INCLUDE 'serials-search.inc' %]
14
14
15
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Details for subscription #[% subscriptionid %]</div>
15
<div id="breadcrumbs">
16
    <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17
    &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
18
    [% UNLESS blocking_error %]&rsaquo; Details for subscription #[% subscriptionid %][% END %]
19
20
</div>
16
21
17
<div id="doc3" class="yui-t2">
22
<div id="doc3" class="yui-t2">
18
   
23
   
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt (+2 lines)
Lines 11-16 Link Here
11
<body id="ser_subscription-renew" class="ser">
11
<body id="ser_subscription-renew" class="ser">
12
    <div class="container-fluid">
12
    <div class="container-fluid">
13
13
14
[% INCLUDE 'blocking_errors.inc' %]
15
14
[% IF op == 'renew' %]
16
[% IF op == 'renew' %]
15
  Subscription renewed.
17
  Subscription renewed.
16
  
18
  
(-)a/serials/routing.pl (-1 / +6 lines)
Lines 61-66 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
61
    }
61
    }
62
);
62
);
63
63
64
my $subs = GetSubscription($subscriptionid);
65
66
output_and_exit( $query, $cookie, $template, 'unknown_subscription')
67
    unless $subs;
68
64
if($op eq 'delete'){
69
if($op eq 'delete'){
65
    delroutingmember($routingid,$subscriptionid);
70
    delroutingmember($routingid,$subscriptionid);
66
}
71
}
Lines 76-82 if($op eq 'save'){ Link Here
76
}
81
}
77
82
78
my @routinglist = getroutinglist($subscriptionid);
83
my @routinglist = getroutinglist($subscriptionid);
79
my $subs = GetSubscription($subscriptionid);
84
80
my ($count,@serials) = GetSerials($subscriptionid);
85
my ($count,@serials) = GetSerials($subscriptionid);
81
my $serialdates = GetLatestSerials($subscriptionid,$count);
86
my $serialdates = GetLatestSerials($subscriptionid,$count);
82
87
(-)a/serials/serials-collection.pl (+5 lines)
Lines 104-109 if($op eq 'gennext' && @subscriptionid){ Link Here
104
        last if HasSubscriptionExpired($subscriptionid) > 0;
104
        last if HasSubscriptionExpired($subscriptionid) > 0;
105
    }
105
    }
106
    print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid);
106
    print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid);
107
    exit;
107
}
108
}
108
109
109
my $subscriptioncount;
110
my $subscriptioncount;
Lines 113-118 if (@subscriptionid){ Link Here
113
   my $closed = 0;
114
   my $closed = 0;
114
   foreach my $subscriptionid (@subscriptionid){
115
   foreach my $subscriptionid (@subscriptionid){
115
    my $subs= GetSubscription($subscriptionid);
116
    my $subs= GetSubscription($subscriptionid);
117
    next unless $subs;
116
    $closed = 1 if $subs->{closed};
118
    $closed = 1 if $subs->{closed};
117
119
118
    $subs->{opacnote}     =~ s/\n/\<br\/\>/g;
120
    $subs->{opacnote}     =~ s/\n/\<br\/\>/g;
Lines 134-139 if (@subscriptionid){ Link Here
134
    my $tmpsubscription= GetFullSubscription($subscriptionid);
136
    my $tmpsubscription= GetFullSubscription($subscriptionid);
135
    @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation);
137
    @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation);
136
  }
138
  }
139
140
  output_and_exit( $query, $cookie, $template, 'unknown_subscription') unless @subscriptioninformation;
141
137
  $template->param(closed => $closed);
142
  $template->param(closed => $closed);
138
  $subscriptions=PrepareSerialsData(\@subscriptioninformation);
143
  $subscriptions=PrepareSerialsData(\@subscriptioninformation);
139
  $subscriptioncount = CountSubscriptionFromBiblionumber($subscriptiondescs->[0]{'biblionumber'});
144
  $subscriptioncount = CountSubscriptionFromBiblionumber($subscriptiondescs->[0]{'biblionumber'});
(-)a/serials/serials-edit.pl (+1 lines)
Lines 112-117 unless ( @serialids ) { Link Here
112
    $string =~ s/,$//;
112
    $string =~ s/,$//;
113
113
114
    print $query->redirect($string);
114
    print $query->redirect($string);
115
    exit;
115
}
116
}
116
117
117
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
118
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/serials/subscription-add.pl (+3 lines)
Lines 69-74 if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') { Link Here
69
    my $subscriptionid = $query->param('subscriptionid');
69
    my $subscriptionid = $query->param('subscriptionid');
70
    $subs = GetSubscription($subscriptionid);
70
    $subs = GetSubscription($subscriptionid);
71
71
72
    output_and_exit( $query, $cookie, $template, 'unknown_subscription')
73
        unless $subs;
74
72
    ## FIXME : Check rights to edit if mod. Could/Should display an error message.
75
    ## FIXME : Check rights to edit if mod. Could/Should display an error message.
73
    if ($subs->{'cannotedit'} && $op eq 'modify'){
76
    if ($subs->{'cannotedit'} && $op eq 'modify'){
74
      carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
77
      carp "Attempt to modify subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
(-)a/serials/subscription-detail.pl (+4 lines)
Lines 62-67 my ($template, $loggedinuser, $cookie) Link Here
62
62
63
63
64
my $subs = GetSubscription($subscriptionid);
64
my $subs = GetSubscription($subscriptionid);
65
66
output_and_exit( $query, $cookie, $template, 'unknown_subscription')
67
    unless $subs;
68
65
$subs->{enddate} ||= GetExpirationDate($subscriptionid);
69
$subs->{enddate} ||= GetExpirationDate($subscriptionid);
66
70
67
my ($totalissues,@serialslist) = GetSerials($subscriptionid);
71
my ($totalissues,@serialslist) = GetSerials($subscriptionid);
(-)a/serials/subscription-renew.pl (-1 / +4 lines)
Lines 75-80 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
75
if ( $op eq "renew" ) {
75
if ( $op eq "renew" ) {
76
    # Do not use this script with op=renew and @subscriptionids > 1!
76
    # Do not use this script with op=renew and @subscriptionids > 1!
77
    my $subscriptionid = $subscriptionids[0];
77
    my $subscriptionid = $subscriptionids[0];
78
    # Make sure the subscription exists
79
    my $subscription = GetSubscription( $subscriptionid );
80
    output_and_exit( $query, $cookie, $template, 'unknown_subscription') unless $subscription;
78
    my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
81
    my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } );
79
    ReNewSubscription(
82
    ReNewSubscription(
80
        $subscriptionid, $loggedinuser,
83
        $subscriptionid, $loggedinuser,
Lines 95-100 if ( $op eq "renew" ) { Link Here
95
} else {
98
} else {
96
    my $subscriptionid = $subscriptionids[0];
99
    my $subscriptionid = $subscriptionids[0];
97
    my $subscription = GetSubscription($subscriptionid);
100
    my $subscription = GetSubscription($subscriptionid);
101
    output_and_exit( $query, $cookie, $template, 'unknown_subscription') unless $subscription;
98
    if ($subscription->{'cannotedit'}){
102
    if ($subscription->{'cannotedit'}){
99
      carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
103
      carp "Attempt to renew subscription $subscriptionid by ".C4::Context->userenv->{'id'}." not allowed";
100
      print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
104
      print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid");
101
- 

Return to bug 20351