"Fossies" - the Fresh Open Source Software Archive

Member "koha-19.11.15/svc/virtualshelves/search" (23 Feb 2021, 2355 Bytes) of package /linux/misc/koha-19.11.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "search": 20.05.06_vs_20.11.00.

    1 #!/usr/bin/perl
    2 
    3 use Modern::Perl;
    4 use CGI;
    5 
    6 use C4::Auth qw( get_template_and_user );
    7 use C4::Output qw( output_with_http_headers );
    8 use C4::Utils::DataTables qw( dt_get_params );
    9 use C4::Utils::DataTables::VirtualShelves qw( search );
   10 
   11 my $input = new CGI;
   12 
   13 exit unless $input->param('template_path');
   14 
   15 my ($template, $user, $cookie) = get_template_and_user({
   16     template_name   => scalar $input->param('template_path'),
   17     query           => $input,
   18     type            => "intranet",
   19     flagsrequired   => { catalogue => 1 }
   20 });
   21 
   22 my $shelfname = $input->param('shelfname');
   23 my $count = $input->param('count');
   24 my $owner = $input->param('owner');
   25 my $type = $input->param('type');
   26 my $sortby = $input->param('sortby');
   27 
   28 # variable information for DataTables (id)
   29 my $sEcho = $input->param('sEcho');
   30 
   31 my %dt_params = dt_get_params($input);
   32 foreach (grep {$_ =~ /^mDataProp/} keys %dt_params) {
   33     $dt_params{$_} =~ s/^dt_//;
   34 }
   35 
   36 my $results = C4::Utils::DataTables::VirtualShelves::search(
   37     {
   38         shelfname => $shelfname,
   39         count => $count,
   40         owner => $owner,
   41         type => $type,
   42         sortby => $sortby,
   43         dt_params => \%dt_params,
   44     }
   45 );
   46 
   47 $template->param(
   48     sEcho => $sEcho,
   49     iTotalRecords => $results->{iTotalRecords},
   50     iTotalDisplayRecords => $results->{iTotalDisplayRecords},
   51     aaData => $results->{shelves}
   52 );
   53 
   54 output_with_http_headers $input, $cookie, $template->output, 'json';
   55 
   56 __END__
   57 
   58 =head1 NAME
   59 
   60 search - a search script for finding virtual shelves
   61 
   62 =head1 SYNOPSIS
   63 
   64 This script provides a service for template for virtual shelves search using DataTables
   65 
   66 =cut
   67 
   68 =back
   69 
   70 =head1 LICENSE
   71 
   72 Copyright 2014 BibLibre
   73 
   74 This file is part of Koha.
   75 
   76 Koha is free software; you can redistribute it and/or modify it under the
   77 terms of the GNU General Public License as published by the Free Software
   78 Foundation; either version 2 of the License, or (at your option) any later
   79 version.
   80 
   81 Koha is distributed in the hope that it will be useful, but WITHOUT ANY
   82 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   83 A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
   84 
   85 You should have received a copy of the GNU General Public License along
   86 with Koha; if not, write to the Free Software Foundation, Inc.,
   87 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.