From 2dbe013b9f7089963a31ee37658c6f8cd39ff339 Mon Sep 17 00:00:00 2001 From: morgane alonso Date: Thu, 25 Aug 2016 08:22:50 +0000 Subject: [PATCH] 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 Signed-off-by: Kyle M Hall --- C4/Serials.pm | 39 +-- Koha/SharedContent.pm | 90 ++++++ Koha/Subscription.pm | 65 +++++ Koha/Subscription/Frequencies.pm | 57 ++++ Koha/Subscription/Frequency.pm | 48 ++++ Koha/Subscription/Numberpattern.pm | 48 ++++ Koha/Subscription/Numberpatterns.pm | 77 +++++ .../mana_01-add_mana_id_in_subscription.sql | 1 + .../includes/mana-subscription-search-result.inc | 46 +++ .../prog/en/includes/serials-menu.inc | 3 + .../prog/en/includes/serials-toolbar.inc | 108 +++++++ .../serials/mana-subscription-search-result.tt | 1 + .../prog/en/modules/serials/serials-home.tt | 1 + .../prog/en/modules/serials/serials-search.tt | 49 +++- .../prog/en/modules/serials/subscription-add.tt | 217 ++++++++++++-- .../prog/en/modules/serials/subscription-detail.tt | 16 +- misc/cronjobs/serialsUpdate.pl | 4 +- serials/serials-collection.pl | 6 +- serials/serials-search.pl | 122 +++++--- serials/showpredictionpattern.pl | 23 +- serials/subscription-add.pl | 81 +++++- serials/subscription-detail.pl | 71 ++++- svc/mana/search | 62 ++++ svc/mana/use | 48 ++++ t/db_dependent/Koha/SharedContent.t | 29 ++ t/db_dependent/Koha/Subscription.t | 85 +++++- t/db_dependent/Serials.t | 3 +- t/db_dependent/Serials/GetFictiveIssueNumber.t | 320 ++++++++------------- t/db_dependent/Serials/GetNextDate.t | 307 +++++++++----------- t/db_dependent/Serials/GetNextSeq.t | 124 ++++---- 30 files changed, 1598 insertions(+), 553 deletions(-) create mode 100644 Koha/SharedContent.pm create mode 100644 Koha/Subscription/Frequencies.pm create mode 100644 Koha/Subscription/Frequency.pm create mode 100644 Koha/Subscription/Numberpattern.pm create mode 100644 Koha/Subscription/Numberpatterns.pm create mode 100644 installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/serials/mana-subscription-search-result.tt create mode 100755 svc/mana/search create mode 100755 svc/mana/use create mode 100644 t/db_dependent/Koha/SharedContent.t diff --git a/C4/Serials.pm b/C4/Serials.pm index 45bae8c..d7c44e8 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -871,19 +871,20 @@ sub GetDistributedTo { my ( $nextseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1, $newinnerloop2, $newinnerloop3 - ) = GetNextSeq( $subscription, $pattern, $planneddate ); + ) = GetNextSeq( $subscription, $pattern, $frequency, $planneddate ); $subscription is a hashref containing all the attributes of the table 'subscription'. $pattern is a hashref containing all the attributes of the table 'subscription_numberpatterns'. +$frequency is a hashref containing all the attributes of the table 'subscription_frequencies' $planneddate is a date string in iso format. This function get the next issue for the subscription given on input arg =cut sub GetNextSeq { - my ($subscription, $pattern, $planneddate) = @_; + my ($subscription, $pattern, $frequency, $planneddate) = @_; return unless ($subscription and $pattern); @@ -896,7 +897,7 @@ sub GetNextSeq { if(@irreg > 0) { my $irregularities = {}; $irregularities->{$_} = 1 foreach(@irreg); - my $issueno = GetFictiveIssueNumber($subscription, $planneddate) + 1; + my $issueno = GetFictiveIssueNumber($subscription, $planneddate, $frequency) + 1; while($irregularities->{$issueno}) { $count++; $issueno++; @@ -1039,7 +1040,7 @@ sub GetExpirationDate { #calculate the date of the last issue. for ( my $i = 1 ; $i <= $length ; $i++ ) { - $enddate = GetNextDate( $subscription, $enddate ); + $enddate = GetNextDate( $subscription, $enddate, $frequency ); } } elsif ( $subscription->{monthlength} ) { if ( $$subscription{startdate} ) { @@ -1191,16 +1192,17 @@ sub ModSerialStatus { if ( !$otherIssueExpected && $oldstatus == EXPECTED && $status != EXPECTED ) { my $subscription = GetSubscription($subscriptionid); my $pattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subscription->{numberpattern}); + my $frequency = C4::Serials::Frequency::GetSubscriptionFrequency($subscription->{periodicity}); # next issue number my ( $newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1, $newinnerloop2, $newinnerloop3 ) - = GetNextSeq( $subscription, $pattern, $publisheddate ); + = GetNextSeq( $subscription, $pattern, $frequency, $publisheddate ); # next date (calculated from actual date & frequency parameters) - my $nextpublisheddate = GetNextDate($subscription, $publisheddate, 1); + my $nextpublisheddate = GetNextDate($subscription, $publisheddate, $frequency, 1); my $nextpubdate = $nextpublisheddate; $query = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=? WHERE subscriptionid = ?"; @@ -1409,7 +1411,7 @@ sub NewSubscription { $innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, - $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype + $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id ) = @_; my $dbh = C4::Context->dbh; @@ -1423,8 +1425,8 @@ sub NewSubscription { irregularity, numberpattern, locale, callnumber, manualhistory, internalnotes, serialsadditems, staffdisplaycount, opacdisplaycount, graceperiod, location, enddate, skip_serialseq, - itemtype, previousitemtype) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) + itemtype, previousitemtype, mana_id) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?) |; my $sth = $dbh->prepare($query); $sth->execute( @@ -1435,7 +1437,7 @@ sub NewSubscription { $firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, - $itemtype, $previousitemtype + $itemtype, $previousitemtype, $mana_id ); my $subscriptionid = $dbh->{'mysql_insertid'}; @@ -2166,7 +2168,7 @@ sub abouttoexpire { my $expirationdate = GetExpirationDate($subscriptionid); my ($res) = $dbh->selectrow_array('select max(planneddate) from serial where subscriptionid = ?', undef, $subscriptionid); - my $nextdate = GetNextDate($subscription, $res); + my $nextdate = GetNextDate($subscription, $res, $frequency); # only compare dates if both dates exist. if ($nextdate and $expirationdate) { @@ -2232,7 +2234,7 @@ sub GetSubscriptionsFromBorrower { =head2 GetFictiveIssueNumber -$issueno = GetFictiveIssueNumber($subscription, $publishedate); +$issueno = GetFictiveIssueNumber($subscription, $publishedate, $frequency); Get the position of the issue published at $publisheddate, considering the first issue (at firstacquidate) is at position 1, the next is at position 2, etc... @@ -2251,9 +2253,8 @@ date (in GetNextDate) or the next issue number (in GetNextSeq). =cut sub GetFictiveIssueNumber { - my ($subscription, $publisheddate) = @_; + my ($subscription, $publisheddate, $frequency) = @_; - my $frequency = GetSubscriptionFrequency($subscription->{'periodicity'}); my $unit = $frequency->{unit} ? lc $frequency->{'unit'} : undef; return if !$unit; my $issueno; @@ -2397,12 +2398,13 @@ sub _get_next_date_year { =head2 GetNextDate -$resultdate = GetNextDate($publisheddate,$subscription) +$resultdate = GetNextDate($publisheddate,$subscription,$freqdata,$updatecount) this function it takes the publisheddate and will return the next issue's date and will skip dates if there exists an irregularity. $publisheddate has to be an ISO date -$subscription is a hashref containing at least 'periodicity', 'firstacquidate', 'irregularity', and 'countissuesperunit' +$subscription is a hashref containing at least 'firstacquidate', 'irregularity', and 'countissuesperunit' +$frequency is a hashref containing frequency informations $updatecount is a boolean value which, when set to true, update the 'countissuesperunit' in database - eg if periodicity is monthly and $publisheddate is 2007-02-10 but if March and April is to be skipped then the returned date will be 2007-05-10 @@ -2415,11 +2417,10 @@ Return undef if subscription is irregular =cut sub GetNextDate { - my ( $subscription, $publisheddate, $updatecount ) = @_; + my ( $subscription, $publisheddate, $freqdata, $updatecount ) = @_; return unless $subscription and $publisheddate; - my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'}); if ($freqdata->{'unit'}) { my ( $year, $month, $day ) = split /-/, $publisheddate; @@ -2439,7 +2440,7 @@ sub GetNextDate { # Get the 'fictive' next issue number # It is used to check if next issue is an irregular issue. - my $issueno = GetFictiveIssueNumber($subscription, $publisheddate) + 1; + my $issueno = GetFictiveIssueNumber($subscription, $publisheddate, $freqdata) + 1; # Then get the next date my $unit = lc $freqdata->{'unit'}; diff --git a/Koha/SharedContent.pm b/Koha/SharedContent.pm new file mode 100644 index 0000000..e0c512b --- /dev/null +++ b/Koha/SharedContent.pm @@ -0,0 +1,90 @@ +package Koha::SharedContent; + +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +use JSON; +use HTTP::Request; +use LWP::UserAgent; + +our $MANA_IP = "http://10.25.159.107:5000"; + +sub manaRequest { + my $mana_request = shift; + my $result; + + $mana_request->content_type('application/json'); + my $userAgent = LWP::UserAgent->new; + my $response = $userAgent->request($mana_request); + + if ( $response->code ne "204" ) { + $result = from_json( $response->decoded_content ); + } + $result->{code} = $response->code; + + return $result if ( $response->code =~ /^2..$/ ); +} + +sub manaNewUserPatchRequest { + my $resource = shift; + my $id = shift; + + my $url = "$MANA_IP/$resource/$id.json/newUser"; + my $request = HTTP::Request->new( PATCH => $url ); + + return manaRequest($request); +} + +sub manaPostRequest { + my $resource = shift; + my $content = shift; + + my $url = "$MANA_IP/$resource.json"; + my $request = HTTP::Request->new( POST => $url ); + + $content->{bulk_import} = 0; + my $json = to_json( $content, { utf8 => 1 } ); + $request->content($json); + + return manaRequest($request); +} + +sub manaGetRequestWithId { + my $resource = shift; + my $id = shift; + + my $url = "$MANA_IP/$resource/$id.json"; + my $request = HTTP::Request->new( GET => $url ); + + return manaRequest($request); +} + +sub manaGetRequest { + my $resource = shift; + my $parameters = shift; + + $parameters = join '&', + map { defined $parameters->{$_} ? $_ . "=" . $parameters->{$_} : () } + keys %$parameters; + my $url = "$MANA_IP/$resource.json?$parameters"; + my $request = HTTP::Request->new( GET => $url ); + + return manaRequest($request); +} + +1; diff --git a/Koha/Subscription.pm b/Koha/Subscription.pm index 2a793e5..b865eaf 100644 --- a/Koha/Subscription.pm +++ b/Koha/Subscription.pm @@ -23,6 +23,11 @@ use Carp; use Koha::Database; use Koha::Biblios; +use Koha::Biblioitems; +use Koha::Subscriptions; +use Koha::Subscription::Frequencies; +use Koha::Subscription::Numberpatterns; +use JSON; use base qw(Koha::Object); @@ -52,6 +57,66 @@ sub biblio { =cut +sub get_search_info { + my $searched_sub_id = shift; + my $biblio = Koha::Biblios->find( { 'biblionumber' => $searched_sub_id } ); + my $biblioitem = + Koha::Biblioitems->find( { 'biblionumber' => $searched_sub_id } ); + + my $sub_mana_info = { + 'title' => $biblio->title, + 'issn' => $biblioitem->issn, + 'ean' => $biblioitem->ean, + 'publishercode' => $biblioitem->publishercode + }; + return $sub_mana_info; +} + +sub get_sharable_info { + my $shared_sub_id = shift; + my $subscription = Koha::Subscriptions->find($shared_sub_id); + my $biblio = Koha::Biblios->find( $subscription->biblionumber ); + my $biblioitem = Koha::Biblioitems->find( + { 'biblionumber' => $subscription->biblionumber } ); + my $sub_frequency = + Koha::Subscription::Frequencies->find( $subscription->periodicity ); + my $sub_numberpatteern = + Koha::Subscription::Numberpatterns->find( $subscription->numberpattern ); + + my $sub_mana_info = { + 'title' => $biblio->title, + 'sfdescription' => $sub_frequency->description, + 'unit' => $sub_frequency->unit, + 'unitsperissue' => $sub_frequency->unitsperissue, + 'issuesperunit' => $sub_frequency->issuesperunit, + 'label' => $sub_numberpatteern->label, + 'sndescription' => $sub_numberpatteern->description, + 'numberingmethod' => $sub_numberpatteern->numberingmethod, + 'label1' => $sub_numberpatteern->label1, + 'add1' => $sub_numberpatteern->add1, + 'every1' => $sub_numberpatteern->every1, + 'whenmorethan1' => $sub_numberpatteern->whenmorethan1, + 'setto1' => $sub_numberpatteern->setto1, + 'numbering1' => $sub_numberpatteern->numbering1, + 'label2' => $sub_numberpatteern->label2, + 'add2' => $sub_numberpatteern->add2, + 'every2' => $sub_numberpatteern->every2, + 'whenmorethan2' => $sub_numberpatteern->whenmorethan2, + 'setto2' => $sub_numberpatteern->setto2, + 'numbering2' => $sub_numberpatteern->numbering2, + 'label3' => $sub_numberpatteern->label3, + 'add3' => $sub_numberpatteern->add3, + 'every3' => $sub_numberpatteern->every3, + 'whenmorethan3' => $sub_numberpatteern->whenmorethan3, + 'setto3' => $sub_numberpatteern->setto3, + 'numbering3' => $sub_numberpatteern->numbering3, + 'issn' => $biblioitem->issn, + 'ean' => $biblioitem->ean, + 'publishercode' => $biblioitem->publishercode + }; + return $sub_mana_info; +} + sub _type { return 'Subscription'; } diff --git a/Koha/Subscription/Frequencies.pm b/Koha/Subscription/Frequencies.pm new file mode 100644 index 0000000..0742a67 --- /dev/null +++ b/Koha/Subscription/Frequencies.pm @@ -0,0 +1,57 @@ +package Koha::Subscription::Frequencies; + +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +use Koha::Database; +use Koha::Subscription::Frequency; +use base qw(Koha::Objects); + +=head1 NAME + +Koha::Subscription::Frequencies - Koha Subscription::Frequency object set class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'SubscriptionFrequency'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Subscription::Frequency'; +} + +=head1 AUTHOR + +Morgane Alonso + +=cut + +1; diff --git a/Koha/Subscription/Frequency.pm b/Koha/Subscription/Frequency.pm new file mode 100644 index 0000000..a0b7834 --- /dev/null +++ b/Koha/Subscription/Frequency.pm @@ -0,0 +1,48 @@ +package Koha::Subscription::Frequency; + +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +use Koha::Database; +use base qw(Koha::Object); + +=head1 NAME + +Koha::Subscription::Frequency - Koha Subscription::Frequency Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'SubscriptionFrequency'; +} + +=head1 AUTHOR + +Morgane Alonso + +=cut + +1; diff --git a/Koha/Subscription/Numberpattern.pm b/Koha/Subscription/Numberpattern.pm new file mode 100644 index 0000000..049fbfe --- /dev/null +++ b/Koha/Subscription/Numberpattern.pm @@ -0,0 +1,48 @@ +package Koha::Subscription::Numberpattern; + +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +use Koha::Database; +use base qw(Koha::Object); + +=head1 NAME + +Koha::SubscriptionNumberpattern - Koha SubscriptionNumberpattern Object class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 type + +=cut + +sub _type { + return 'SubscriptionNumberpattern'; +} + +=head1 AUTHOR + +Morgane Alonso + +=cut + +1; diff --git a/Koha/Subscription/Numberpatterns.pm b/Koha/Subscription/Numberpatterns.pm new file mode 100644 index 0000000..638e028 --- /dev/null +++ b/Koha/Subscription/Numberpatterns.pm @@ -0,0 +1,77 @@ +package Koha::Subscription::Numberpatterns; + +# 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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +use Modern::Perl; +use Koha::Database; +use Koha::Subscription::Numberpattern; +use base qw(Koha::Objects); + +=head1 NAME + +Koha::SubscriptionNumberpatterns - Koha SubscriptionNumberpattern object set class + +=head1 API + +=head2 Class Methods + +=cut + +=head3 uniqeLabel + +=cut + +sub uniqueLabel { + my ($self, $label) = @_; + + my $samelabel = Koha::Subscription::Numberpatterns->search({label => $label})->next(); + if ($samelabel) { + my $i = 2; + my $newlabel = $samelabel->label . " ($i)"; + while (my $othersamelabel = $self->search({label => $newlabel})->next()) { + $i++; + $newlabel = $samelabel->label . " ($i)"; + } + $label = $newlabel; + } + return $label; +} + +=head3 type + +=cut + +sub _type { + return 'SubscriptionNumberpattern'; +} + +=head3 object_class + +=cut + +sub object_class { + return 'Koha::Subscription::Numberpattern'; +} + +=head1 AUTHOR + +Morgane Alonso + +=cut + +1; diff --git a/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql b/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql new file mode 100644 index 0000000..5c590d1 --- /dev/null +++ b/installer/data/mysql/atomicupdate/mana_01-add_mana_id_in_subscription.sql @@ -0,0 +1 @@ +ALTER TABLE subscription ADD mana_id int(11); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc new file mode 100644 index 0000000..4ce9b9b --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana-subscription-search-result.inc @@ -0,0 +1,46 @@ +[% USE KohaDates %] + + + + + + + + + + [% UNLESS search_only %] + + [% END %] + + + + + + + + + + + [% UNLESS search_only %] + + [% END %] + + + + [% FOREACH subscription IN subscriptions %] + [% UNLESS subscription.cannotdisplay %] + + + + + + + + [% UNLESS search_only %] + + [% END %] + + [% END %] + [% END %] + +
ISSNTitleFrequencyNumbering patternNumber of usersLast ImportActions
[% IF ( subscription.issn ) %][% subscription.issn %][% END %][% subscription.title %][% IF ( subscription.sfdescription ) %][% subscription.sfdescription %][% END %][% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod %][% END %][% IF ( subscription.nbofusers ) %][% subscription.nbofusers %][% END %][% subscription.lastimport | $KohaDates %] Use
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc index 21dff3a..ee66508 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc @@ -31,4 +31,7 @@
  • Add subscription fields
  • + [% IF Koha.Preference('Mana') %] +
  • Search on Mana
  • + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc index ecc9e55..2cebb6d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc @@ -13,6 +13,9 @@ window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen"; } } + function share() { + window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share"; + } $(document).ready(function() { $("#deletesub").click(function(){ @@ -43,6 +46,13 @@ [% ELSE %] [% END %] + [% IF Koha.Preference('Mana') %] + [% IF one_language_enabled==0 or mana_id %] + + [% ELSE %] + + [% END %] + [% END %] [% END %] [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %] @@ -99,3 +109,101 @@ [% END %] [% END %] + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/mana-subscription-search-result.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/mana-subscription-search-result.tt new file mode 100644 index 0000000..0afe02c --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/mana-subscription-search-result.tt @@ -0,0 +1 @@ +[% INCLUDE 'mana-subscription-search-result.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt index eaafc94..f587b28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt @@ -1,5 +1,6 @@ [% INCLUDE 'doc-head-open.inc' %] [% USE KohaDates %] +[% USE Koha %] Koha › Serials [% biblionumber %] [% INCLUDE 'doc-head-close.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt index 1728fb0..6131ed1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt @@ -1,6 +1,7 @@ [% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] [% USE KohaDates %] +[% USE Koha %] [% USE AuthorisedValues %] Koha › Serials [% biblionumber %] [% INCLUDE 'doc-head-close.inc' %] @@ -10,6 +11,14 @@ @@ -123,6 +144,7 @@ [% END %] + [% IF ( mana ) %][% END %]
    @@ -130,13 +152,22 @@ [% END %] - [% IF ( done_searched ) %] - [% IF ( total ) %] -
    - + [% IF ( done_searched ) %] + [% IF ( total ) %] +
    + + [% IF mana %] +
    + [% INCLUDE 'mana-subscription-search-result.inc' %] +
    + [% ELSE %]
    [% IF openedsubscriptions %] @@ -354,6 +385,7 @@ [% END %] + [% END %] [% ELSE %]
    @@ -367,6 +399,7 @@
    [% INCLUDE 'serials-menu.inc' %] [% IF ( done_searched ) %] + [% UNLESS ( mana ) %]
    @@ -439,10 +472,12 @@
    +
    [% END %] + [% END %]
    [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index ff918b0..46c732e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -1,5 +1,6 @@ [% USE KohaDates %] [% USE Branches %] +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › Serials › [% IF ( modify ) %][% bibliotitle |html %] › Modify subscription[% ELSE %]New subscription[% END %] @@ -11,11 +12,16 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ width: 300px; /* not enough for IE7 apparently */ } + +[% INCLUDE 'datatables.inc' %]