}
my $referer = $query->param('referer') || $op;
-my $category = 1;
-$category = 2 if $query->param('category') && $query->param('category') == 2;
+my $public = 0;
+$public = 1 if $query->param('public') && $query->param('public') == 1;
my ( $shelf, $shelfnumber, @messages );
$shelf = Koha::Virtualshelves->find($shelfnumber);
if ( $shelf ) {
- $category = $shelf->category;
+ $public = $shelf->public;
my $patron = Koha::Patrons->find( $shelf->owner );
$template->param( owner => $patron, );
unless ( $shelf->can_be_managed( $loggedinuser ) ) {
$shelf = Koha::Virtualshelf->new(
{ shelfname => scalar $query->param('shelfname'),
sortfield => scalar $query->param('sortfield'),
- category => $category,
+ public => $public,
allow_change_from_owner => $allow_changes_from > 0,
allow_change_from_others => $allow_changes_from == ANYONE,
owner => scalar $loggedinuser,
my $allow_changes_from = $query->param('allow_changes_from');
$shelf->allow_change_from_owner( $allow_changes_from > 0 );
$shelf->allow_change_from_others( $allow_changes_from == ANYONE );
- $shelf->category( $category );
+ $shelf->public( $public );
eval { $shelf->store };
if ($@) {
$shelf = Koha::Virtualshelves->find($shelfnumber);
if ( $shelf ) {
if ( $shelf->can_be_viewed( $loggedinuser ) ) {
- $category = $shelf->category;
+ $public = $shelf->public;
# Sortfield param may still include sort order with :asc or :desc, but direction overrides it
my( $sortfield, $direction );
$categorycode = $patron ? $patron->categorycode : undef;
}
- # Lists display falls back to search results configuration
- my $xslfile = C4::Context->preference('OPACXSLTListsDisplay') || "default";
- my $lang = C4::Languages::getlanguage();
- my $sysxml = C4::XSLT::get_xslt_sysprefs();
-
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
my $art_req_itypes;
anonymous_session => ($loggedinuser) ? 0 : 1
};
$this_item->{XSLTBloc} = XSLTParse4Display(
- $biblionumber, $record,
- "OPACXSLTListsDisplay", 1,
- undef, $sysxml,
- $xslfile, $lang,
- $variables, $items->reset
+ {
+ biblionumber => $biblionumber,
+ record => $record,
+ xsl_syspref => "OPACXSLTListsDisplay",
+ fix_amps => 1,
+ xslt_variables => $variables,
+ items_rs => $items->reset,
+ }
);
+
if ( grep {$_ eq $biblionumber} @cart_list) {
$this_item->{incart} = 1;
}
csv_profiles => [
Koha::CsvProfiles->search(
{ type => 'marc', used_for => 'export_records', staff_only => 0 }
- )
+ )->as_list
],
);
if ( $page ) {
if ( $op eq 'list' ) {
my $shelves;
my ( $page, $rows ) = ( $query->param('page') || 1, 20 );
- if ( $category == 1 ) {
+ if ( !$public ) {
$shelves = Koha::Virtualshelves->get_private_shelves({ page => $page, rows => $rows, borrowernumber => $loggedinuser, });
} else {
$shelves = Koha::Virtualshelves->get_public_shelves({ page => $page, rows => $rows, });
shelves => $shelves,
pagination_bar => pagination_bar(
q||, $pager->last_page - $pager->first_page + 1,
- $page, "page", { op => 'list', category => $category, }
+ $page, "page", { op => 'list', public => $public, }
),
);
}
referer => $referer,
shelf => $shelf,
messages => \@messages,
- category => $category,
+ public => $public,
print => scalar $query->param('print') || 0,
listsview => 1,
);