|
Lines 60-72
if($op eq 'add'){
Link Here
|
| 60 |
addroutingmember($borrowernumber,$subscriptionid); |
60 |
addroutingmember($borrowernumber,$subscriptionid); |
| 61 |
} |
61 |
} |
| 62 |
if($op eq 'save'){ |
62 |
if($op eq 'save'){ |
| 63 |
my $sth = $dbh->prepare("UPDATE serial SET routingnotes = ? WHERE subscriptionid = ?"); |
63 |
my $sth = $dbh->prepare('UPDATE serial SET routingnotes = ? WHERE subscriptionid = ?'); |
| 64 |
$sth->execute($notes,$subscriptionid); |
64 |
$sth->execute($notes,$subscriptionid); |
| 65 |
my $urldate = URI::Escape::uri_escape($date_selected); |
65 |
my $urldate = URI::Escape::uri_escape($date_selected); |
| 66 |
print $query->redirect("routing-preview.pl?subscriptionid=$subscriptionid&issue=$urldate"); |
66 |
print $query->redirect("routing-preview.pl?subscriptionid=$subscriptionid&issue=$urldate"); |
| 67 |
} |
67 |
} |
| 68 |
|
68 |
|
| 69 |
my ($routing, @routinglist) = getroutinglist($subscriptionid); |
69 |
my @routinglist = getroutinglist($subscriptionid); |
| 70 |
my $subs = GetSubscription($subscriptionid); |
70 |
my $subs = GetSubscription($subscriptionid); |
| 71 |
my ($count,@serials) = GetSerials($subscriptionid); |
71 |
my ($count,@serials) = GetSerials($subscriptionid); |
| 72 |
my $serialdates = GetLatestSerials($subscriptionid,$count); |
72 |
my $serialdates = GetLatestSerials($subscriptionid,$count); |
|
Lines 86-150
foreach my $dateseq (@{$serialdates}) {
Link Here
|
| 86 |
} |
86 |
} |
| 87 |
|
87 |
|
| 88 |
my ($template, $loggedinuser, $cookie) |
88 |
my ($template, $loggedinuser, $cookie) |
| 89 |
= get_template_and_user({template_name => "serials/routing.tmpl", |
89 |
= get_template_and_user({template_name => 'serials/routing.tmpl', |
| 90 |
query => $query, |
90 |
query => $query, |
| 91 |
type => "intranet", |
91 |
type => 'intranet', |
| 92 |
authnotrequired => 0, |
92 |
authnotrequired => 0, |
| 93 |
flagsrequired => {serials => 'routing'}, |
93 |
flagsrequired => {serials => 'routing'}, |
| 94 |
debug => 1, |
94 |
debug => 1, |
| 95 |
}); |
95 |
}); |
| 96 |
|
96 |
|
| 97 |
my @results; |
97 |
my $member_loop = []; |
| 98 |
my $data; |
98 |
for my $routing ( @routinglist ) { |
| 99 |
for(my $i=0;$i<$routing;$i++){ |
99 |
my $member=GetMember('borrowernumber' => $routing->{borrowernumber}); |
| 100 |
$data=GetMember('borrowernumber' => $routinglist[$i]->{'borrowernumber'}); |
100 |
$member->{location} = $member->{branchcode}; |
| 101 |
$data->{'location'}=$data->{'branchcode'}; |
101 |
if ($member->{firstname} ) { |
| 102 |
if ($data->{firstname} ) { |
102 |
$member->{name} = $member->{firstname} . q| |; |
| 103 |
$data->{name} = $data->{firstname} . q| |; |
|
|
| 104 |
} |
103 |
} |
| 105 |
else { |
104 |
else { |
| 106 |
$data->{name} = q{}; |
105 |
$member->{name} = q{}; |
| 107 |
} |
106 |
} |
| 108 |
if ($data->{surname} ) { |
107 |
if ($member->{surname} ) { |
| 109 |
$data->{name} .= $data->{surname}; |
108 |
$member->{name} .= $member->{surname}; |
| 110 |
} |
109 |
} |
| 111 |
$data->{'routingid'}=$routinglist[$i]->{'routingid'}; |
110 |
$member->{routingid}=$routing->{routingid} || q{}; |
| 112 |
$data->{'subscriptionid'}=$subscriptionid; |
111 |
$member->{ranking} = $routing->{ranking} || q{}; |
| 113 |
if (! $routinglist[$i]->{routingid} ) { |
|
|
| 114 |
$routinglist[$i]->{routingid} = q||; |
| 115 |
} |
| 116 |
my $rankingbox = '<select name="itemrank" onchange="reorder_item(' |
| 117 |
. $subscriptionid . ',' .$routinglist[$i]->{'routingid'} . ',this.options[this.selectedIndex].value)">'; |
| 118 |
for(my $j=1; $j <= $routing; $j++) { |
| 119 |
$rankingbox .= "<option "; |
| 120 |
if($routinglist[$i]->{ranking} && $routinglist[$i]->{ranking} == $j){ |
| 121 |
$rankingbox .= " selected=\"selected\""; |
| 122 |
} |
| 123 |
$rankingbox .= " value=\"$j\">$j</option>"; |
| 124 |
} |
| 125 |
$rankingbox .= "</select>"; |
| 126 |
$data->{'routingbox'} = $rankingbox; |
| 127 |
|
| 128 |
push(@results, $data); |
| 129 |
} |
| 130 |
|
112 |
|
| 131 |
# for adding routing list |
113 |
push(@{$member_loop}, $member); |
| 132 |
my $new; |
|
|
| 133 |
if ($op eq 'new') { |
| 134 |
$new = 1; |
| 135 |
} else { |
| 136 |
# for modify routing list default |
| 137 |
$new = 0; |
| 138 |
} |
114 |
} |
| 139 |
|
115 |
|
| 140 |
$template->param( |
116 |
$template->param( |
| 141 |
title => $subs->{'bibliotitle'}, |
117 |
title => $subs->{bibliotitle}, |
| 142 |
subscriptionid => $subscriptionid, |
118 |
subscriptionid => $subscriptionid, |
| 143 |
memberloop => \@results, |
119 |
memberloop => $member_loop, |
| 144 |
op => $new, |
120 |
op => $op eq 'new', |
| 145 |
dates => $dates, |
121 |
dates => $dates, |
| 146 |
routingnotes => $serials[0]->{'routingnotes'}, |
122 |
routingnotes => $serials[0]->{'routingnotes'}, |
| 147 |
hasRouting => check_routing($subscriptionid), |
123 |
hasRouting => check_routing($subscriptionid), |
| 148 |
); |
124 |
); |
| 149 |
|
125 |
|
| 150 |
output_html_with_http_headers $query, $cookie, $template->output; |
126 |
output_html_with_http_headers $query, $cookie, $template->output; |