Recent Acuiqisition page with branch selection.

BEWARE !!!
One CANNOT list ALL recent acquisitions in ALL branches.
You MUST select One criterium (either branch or doctype)
No Answer when choosing no criteria
This commit is contained in:
hdl 2006-02-03 16:31:54 +00:00
parent 55c75b2a87
commit 24fc9b1925
2 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,33 @@
<!-- TMPL_INCLUDE NAME="opac-top.inc" -->
<div id="mainbloc">
<h1 class="catalogue">Recent Acquisitions</h1>
<form name="f" method="post" action="/cgi-bin/koha/opac-search.pl">
<div id="bloc60">
<!-- TMPL_VAR name="CGIbranch" -->
<input type="hidden" name="marclist" value="items.homebranch" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<input type="hidden" name="operator" value="=" />
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="opac" />
<!-- TMPL_VAR name="CGIitemtype" -->
<input type="hidden" name="marclist" value="biblioitems.itemtype" />
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<input type="hidden" name="operator" value="=" />
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="opac" />
acquired in the last
<input type="text" name="desc_or_asc" size="3" />
days
<input type="hidden" name="orderby" value="biblio.timestamp" />
<input type="submit" value="OK" class="button" />
</div>
</form>
</form>
</div>
<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->

View File

@ -0,0 +1,62 @@
#!/usr/bin/perl
use strict;
require Exporter;
use CGI;
use HTML::Template;
use C4::Auth; # get_template_and_user
use C4::Acquisition; # get_template_and_user
use C4::Interface::CGI::Output;
use C4::Koha;
my $input = new CGI;
my $dbh = C4::Context->dbh;
my $query="Select itemtype,description from itemtypes order by description";
my $sth=$dbh->prepare($query);
$sth->execute;
my @itemtype;
my %itemtypes;
while (my ($value,$lib) = $sth->fetchrow_array) {
push @itemtype, $value;
$itemtypes{$value}=$lib;
}
my $CGIitemtype=CGI::scrolling_list( -name => 'value',
-values => \@itemtype,
-labels => \%itemtypes,
-size => 1,
-multiple => 0 );
$sth->finish;
my @branches;
my @select_branch;
my %select_branches;
my ($count2,@branches)=branches();
push @select_branch, "";
$select_branches{''} = "";
for (my $i=0;$i<$count2;$i++){
push @select_branch, $branches[$i]->{'branchcode'};#
$select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
}
my $CGIbranch=CGI::scrolling_list( -name => 'value',
-values => \@select_branch,
-labels => \%select_branches,
-size => 1,
-multiple => 0 );
$sth->finish;
my ($template, $borrowernumber, $cookie)
= get_template_and_user({template_name => "opac-recacquisitions.tmpl",
type => "opac",
query => $input,
authnotrequired => 1,
flagsrequired => {borrow => 1},
});
my $borrower = getmember('',$borrowernumber);
my @options;
my $counter=0;
$template->param(CGIitemtype => $CGIitemtype,
CGIbranch=>$CGIbranch
);
output_html_with_http_headers $input, $cookie, $template->output;