parent
0b57086228
commit
46f8bc47f2
36
C4/Bull.pm
36
C4/Bull.pm
|
|
@ -46,6 +46,7 @@ Give all XYZ functions
|
|||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(&newsubscription &modsubscription &delsubscription &getsubscriptions &getsubscription
|
||||
&getsubscriptionfrombiblionumber &get_subscription_list_from_biblionumber
|
||||
&get_full_subscription_list_from_biblionumber
|
||||
&modsubscriptionhistory &newissue
|
||||
&getserials &serialchangestatus
|
||||
&Find_Next_Date, &Get_Next_Seq
|
||||
|
|
@ -166,7 +167,7 @@ sub getsubscriptionfrombiblionumber {
|
|||
sub get_subscription_list_from_biblionumber {
|
||||
my ($biblionumber) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*,aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
|
||||
my $sth = $dbh->prepare('select subscription.*,subscriptionhistory.*, aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
|
||||
from subscription
|
||||
left join subscriptionhistory on subscription.subscriptionid=subscriptionhistory.subscriptionid
|
||||
left join aqbudget on subscription.aqbudgetid=aqbudget.aqbudgetid
|
||||
|
|
@ -185,6 +186,39 @@ sub get_subscription_list_from_biblionumber {
|
|||
return \@res;
|
||||
}
|
||||
|
||||
sub get_full_subscription_list_from_biblionumber {
|
||||
my ($biblionumber) = @_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth = $dbh->prepare('select year(subscription.startdate) as year,subscription.*, aqbudget.bookfundid,aqbooksellers.name as aqbooksellername,biblio.title as bibliotitle
|
||||
from subscription
|
||||
left join aqbudget on subscription.aqbudgetid=aqbudget.aqbudgetid
|
||||
left join aqbooksellers on subscription.aqbooksellerid=aqbooksellers.id
|
||||
left join biblio on biblio.biblionumber=subscription.biblionumber
|
||||
where subscription.biblionumber = ? order by subscription.startdate');
|
||||
$sth->execute($biblionumber);
|
||||
my @res;
|
||||
my $year;
|
||||
my @loopissues;
|
||||
while (my $subs = $sth->fetchrow_hashref) {
|
||||
my $sth2 = $dbh->prepare('select serial.serialseq, serial.planneddate, year(serial.planneddate) as year, serial.status from serial where serial.biblionumber = ? and serial.subscriptionid=? order by serial.planneddate');
|
||||
$sth2->execute($biblionumber,$subs->{'subscriptionid'});
|
||||
while (my $issues = $sth2->fetchrow_hashref){
|
||||
push @loopissues,
|
||||
{'planneddate' => $issues->{'planneddate'},
|
||||
'serialseq' => $issues->{'serialseq'},
|
||||
'status' => $issues->{'status'}};
|
||||
# warn "planneddate ".$issues->{'planneddate'};
|
||||
# warn "serialseq".$issues->{'serialseq'};
|
||||
}
|
||||
my %cell;
|
||||
$cell{'year'}=$subs->{year};
|
||||
$cell{'title'}=$subs->{title};
|
||||
$cell{'booksellername'}=$subs->{booksellername};
|
||||
$cell{'serials'}=\@loopissues;
|
||||
push @res,\%cell;
|
||||
}
|
||||
return \@res;
|
||||
}
|
||||
|
||||
sub modsubscription {
|
||||
my ($auser,$aqbooksellerid,$cost,$aqbudgetid,$startdate,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
<!-- TMPL_INCLUDE NAME="opac-top.inc" -->
|
||||
|
||||
|
||||
<!-- TMPL_UNLESS name="popup" -->
|
||||
<div class="tabbed">
|
||||
<h1 class="catalogue">Issues for a subscription</h1>
|
||||
<a href="opac-detail.pl?bib=<!-- TMPL_VAR name="biblionumber" -->" class="button catalogue">Back to biblio</a>
|
||||
<h2 class="catalogue">Subscription information for biblio number : <!-- TMPL_VAR NAME="biblionumber" --> with title : <!-- TMPL_VAR name="bibliotitle" --></h2>
|
||||
|
||||
</div>
|
||||
<!-- /TMPL_UNLESS -->
|
||||
<div class="tabs">
|
||||
<!-- TMPL_LOOP NAME="years" -->
|
||||
<!-- TMPL_IF NAME="year" -->
|
||||
<div id="link<!--TMPL_VAR Name="year" -->"><a href="javascript:active(<!-- TMPL_VAR NAME="year" -->)"><!-- TMPL_VAR NAME="year" --></a></div>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
</div>
|
||||
|
||||
<!-- TMPL_LOOP NAME="years" -->
|
||||
<div name="<!-- TMPL_VAR NAME="year" -->XX" id="<!-- TMPL_VAR NAME="year" -->XX" class="tab" style="visibility:visible">
|
||||
<table>
|
||||
<tr>
|
||||
<th> Date
|
||||
</th>
|
||||
<th> Number
|
||||
</th>
|
||||
<th> Status
|
||||
</th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP Name="serials" -->
|
||||
<tr>
|
||||
<td>
|
||||
<!-- TMPL_VAR Name="planneddate" -->
|
||||
</td>
|
||||
<td>
|
||||
<!-- TMPL_VAR Name="serialseq" -->
|
||||
</td>
|
||||
<td>
|
||||
<!-- TMPL_VAR Name="status" -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</div>
|
||||
<!--/TMPL_LOOP -->
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function active(numlayer)
|
||||
{
|
||||
for (i=<!--TMPL_VAR Name="yearmin"-->; i <= <!--TMPL_VAR Name="yearmax"--> ; i++ ) {
|
||||
ong = i+"XX";
|
||||
link = "link"+i;
|
||||
if (numlayer==i) {
|
||||
document.getElementById(ong).style.visibility="visible";
|
||||
} else {
|
||||
document.getElementById(ong).style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -14,10 +14,46 @@ use HTML::Template;
|
|||
my $query = new CGI;
|
||||
my $op = $query->param('op');
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $selectview = C4::Context->preference("SubscriptionHistory");
|
||||
warn "selectview : ".$selectview;
|
||||
|
||||
my $sth;
|
||||
# my $id;
|
||||
my ($template, $loggedinuser, $cookie);
|
||||
my $biblionumber = $query->param('biblionumber');
|
||||
if ($selectview eq "full"){
|
||||
my $subscriptions = get_full_subscription_list_from_biblionumber($biblionumber);
|
||||
|
||||
my $year;
|
||||
my $yearmin=$subscriptions->[1]{year};
|
||||
warn "yearmin".$yearmin;
|
||||
my $yearmax;
|
||||
my @loopissues;
|
||||
my $yearmax=$subscriptions->[scalar(@$subscriptions)]{year};
|
||||
warn "yearmax".$yearmax;
|
||||
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "opac-full-serial-issues.tmpl",
|
||||
query => $query,
|
||||
type => "opac",
|
||||
authnotrequired => 1,
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
# replace CR by <br> in librarian note
|
||||
# $subscription->{opacnote} =~ s/\n/\<br\/\>/g;
|
||||
|
||||
$template->param(
|
||||
biblionumber => $query->param('biblionumber'),
|
||||
years => $subscriptions,
|
||||
yearmin => $yearmin,
|
||||
yearmax =>$yearmax,
|
||||
suggestion => C4::Context->preference("suggestion"),
|
||||
virtualshelves => C4::Context->preference("virtualshelves"),
|
||||
);
|
||||
|
||||
} else {
|
||||
my $subscriptions = get_subscription_list_from_biblionumber($biblionumber);
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
|
|
@ -37,5 +73,5 @@ $template->param(
|
|||
suggestion => C4::Context->preference("suggestion"),
|
||||
virtualshelves => C4::Context->preference("virtualshelves"),
|
||||
);
|
||||
|
||||
}
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue