Koha/svc/mana/search
morgane alonso cffb47ac5d Bug 17047: subscriptions management with Mana-KB
- add a class SharedContent.pm to communicate with Mana-KB server
- add a link in serials-menu.inc to serials_search.pl to open
a mana-subscription research form
- modify the research form in serials-search.tt to show the right fields
for Mana-KB
- create datatable in mana-subscription-search-result.inc to show
results from a research on Mana-KB
- modify serials-search.pl to manage research on Mana-KB

- add a mana_id to subscription table
- add a share button on serials-toolbar.inc and a modal to ask
the language of the share and to alert if the subscription is
already link to a Mana-KB subscription model
- add function in C4/Serials to get all the info for a subscription
sharing
- modify subscription-detail.pl to manage sharing to Mana-KB

- modify subscription-add.tt and subscription.pl to manage a
import from Mana-KB during a subscription creation
- add 2 script in svc for ajax calling from subscription-add.tt
to communicate with Mana-KB server during a asubscription creation
- add a function in Subscription.pm to have all the info for a Mana-KB research
from a biblionumber
- modify functions used by subscription-add.pl in C4/Serials to manage a
frequency which came from Mana-KB server and not already created on the
koha database, and modify the tests of the said functions

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Rebased-by: Alex Arnaud <alex.arnaud@biblibre.com> (2018-07-04)
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-01-23 14:39:26 +00:00

62 lines
1.8 KiB
Perl
Executable file

#!/usr/bin/perl
# Copyright 2016 BibLibre Morgane Alonso
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
#
use strict;
use warnings;
use Koha::SharedContent;
use Koha::Subscription;
use C4::Auth qw(check_cookie_auth), qw(get_template_and_user);
use C4::Output qw( output_with_http_headers );
use CGI;
use JSON;
my $input = new CGI;
my ( $auth_status, $sessionID ) =
check_cookie_auth( $input->cookie('CGISESSID'),
{ serials => 'create_subscription' } );
if ( $auth_status ne "ok" ) {
exit 0;
}
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "serials/mana-subscription-search-result.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
# flagsrequired => { serials => $permission },
flagsrequired => { serials => 'create_subscription' },
debug => 1,
}
);
my $biblionumber = $input->param('biblionumber');
my $sub_mana_info = Koha::Subscription::get_search_info($biblionumber);
my $result =
Koha::SharedContent::manaGetRequest( "subscription", $sub_mana_info );
$template->param( subscriptions => $result->{data} );
output_with_http_headers $input, $cookie, $template->output, 'json';