);
}
else {
- warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' );
+ warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' );
my $LibraryNameTitle = C4::Context->preference("LibraryName");
$LibraryNameTitle =~ s/<(?:\/?)(?:br|p)\s*(?:\/?)>/ /sgi;
$LibraryNameTitle =~ s/<(?:[^<>'"]|'(?:[^']*)'|"(?:[^"]*)")*>//sg;
reviewson => C4::Context->preference("reviewson"),
hide_marc => C4::Context->preference("hide_marc"),
patronimages => C4::Context->preference("patronimages"),
+ mylibraryfirst => C4::Context->preference("SearchMyLibraryFirst"),
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
);
}
</div>
<div id="opac-main-search">
Search
+ <!-- TMPL_IF name="mylibraryfirst" --> <!-- TMPL_IF name="loggedinusername" -->(in <!-- TMPL_VAR name="LoginBranchcode" --> only)<!-- /TMPL_IF --><!-- /TMPL_IF -->
<form name="searchform" method="post" action="/cgi-bin/koha/opac-search.pl" id="searchform">
- <input type="text" name="q" style="width: 30%;"/>
+ <input type="text" name="q" style="width: 30%;" />
+ <!-- TMPL_IF name="mylibraryfirst" --><!-- TMPL_IF name="loggedinusername" -->
+ <input name="limit" value="<!-- TMPL_VAR name="LoginBranchcode" -->" type="hidden" />
+ <!-- /TMPL_IF --><!-- /TMPL_IF -->
<input type="submit" value="OK" class="submit" />
</form>
<a href="/cgi-bin/koha/opac-search.pl">more search options</a>
my $input = new CGI;
my $dbh = C4::Context->dbh;
-my $limit = $input->param('recentacqui');
-
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
{
template_name => "opac-main.tmpl",
}
);
-if ($limit) {
- my $recentacquiloop = GetRecentAcqui($limit);
-
- # warn Data::Dumper::Dumper($recentacquiloop);
- $template->param( recentacquiloop => $recentacquiloop, );
-}
-
-# SearchMyLibraryFirst
-if ( C4::Context->preference("SearchMyLibraryFirst") ) {
- if ( C4::Context->userenv ) {
- my $branches = GetBranches();
- my @branchloop;
-
- foreach my $thisbranch (sort keys %$branches ) {
- my $selected = 1
- if ( C4::Context->userenv
- && ( $thisbranch eq C4::Context->userenv->{branch} ) );
-
-# warn $thisbranch;
-# warn C4::Context->userenv;
-# warn C4::Context->userenv->{branch};
-# warn " => ".C4::Context->userenv && ($thisbranch eq C4::Context->userenv->{branch});
- my %row = (
- value => $thisbranch,
- selected => $selected,
- branchname => $branches->{$thisbranch}->{'branchname'},
- );
- push @branchloop, \%row;
- }
- $template->param( "mylibraryfirst" => 1, branchloop => \@branchloop );
- }
- else {
- $template->param( "mylibraryfirst" => 0 );
- }
-}
-
my $borrower = GetMember( $borrowernumber, 'borrowernumber' );
my @languages;
my $counter = 0;