Bugzilla – Attachment 55470 Details for
Bug 7677
Subscriptions: Ability to define default itemtype and automatically change itemtype of older issues on receive of next issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 7677 [Follow-up]: New areas in subscriptions and new functions when receiving.
PASSED-QA-Bug-7677-Follow-up-New-areas-in-subscrip.patch (text/plain), 6.14 KB, created by
Katrin Fischer
on 2016-09-10 11:20:42 UTC
(
hide
)
Description:
[PASSED QA] Bug 7677 [Follow-up]: New areas in subscriptions and new functions when receiving.
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-09-10 11:20:42 UTC
Size:
6.14 KB
patch
obsolete
>From b71b4c52d9a3af7ecd34b35a36ec64b91a71bb85 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Mon, 28 Sep 2015 16:29:16 +0200 >Subject: [PATCH] [PASSED QA] Bug 7677 [Follow-up]: New areas in subscriptions > and new functions when receiving. > > - Various fixes. > >Test plan: > >Once the makePreviousSerialAvailable syspref is enabled, receive a serial, and then another, then check that: > > - the first received itemtype has been set to the "previous item type" value (set in the subscription). > > - the first received has been made available. > > - the last received serial itemtype has been set to the "item type" value (set in the subscription). > > - 995$l is automatically prefilled. > >Configure the serialsFieldsToAV syspref. When creating or editing a subscription, check that: > > - the domain and/or origin and/or support fields are correctly displaying the authorized values configured in the syspref. > >Signed-off-by: Chris <chris@bigballofwax.co.nz> > >Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> >--- > C4/Items.pm | 4 ++++ > C4/Serials.pm | 26 +++++++++++++++++++++- > .../prog/en/modules/admin/preferences/serials.pref | 2 +- > .../prog/en/modules/serials/subscription-add.tt | 2 +- > serials/serials-edit.pl | 8 +------ > 5 files changed, 32 insertions(+), 10 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 0e894ce..8e1050a 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -3001,6 +3001,10 @@ sub PrepareItemrecordDisplay { > push @authorised_values, $itemtype->{itemtype}; > $authorised_lib{$itemtype->{itemtype}} = $itemtype->{translated_description}; > } >+ if ($defaultvalues && $defaultvalues->{'itemtype'}) { >+ $defaultvalue = $defaultvalues->{'itemtype'}; >+ } >+ > #---- class_sources > } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { > push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 18d315c..3408c47 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -66,7 +66,7 @@ BEGIN { > @EXPORT = qw( > &NewSubscription &ModSubscription &DelSubscription > &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber >- &SearchSubscriptions >+ &SearchSubscriptions &GetItemnumberFromSerialId > &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory > &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire > &GetSubscriptionHistoryFromSubscriptionId >@@ -183,6 +183,30 @@ sub GetSerialStatusFromSerialId { > return $dbh->prepare($query); > } > >+=head2 GetItemnumberFromSerialId >+ >+$itemnumber = GetSerialInformation($serialid); >+this function returns the itemnumber, given a serialid in parameter >+return : itemnumber >+ >+=cut >+ >+sub GetItemnumberFromSerialId { >+ my ($serialid) = @_; >+ my $dbh = C4::Context->dbh; >+ my $query = qq| >+ SELECT itemnumber >+ FROM serialitems >+ WHERE serialid = ? >+ |; >+ my $sth = $dbh->prepare($query); >+ $sth->execute($serialid); >+ my ($result) = $sth->fetchrow; >+ return ($result); >+} >+ >+ >+ > =head2 GetSerialInformation > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >index f68df59..76c89a8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref >@@ -55,4 +55,4 @@ Serials: > choices: > yes: Make > no: Do not make >- - previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item. >+ - previous serial automatically available when receiving a new serial issue. The previous issue can also be set to another item type when receiving a new one. Please note that the item-level_itypes syspref must be set to specific item. >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 44d55c2..ff918b0 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 >@@ -666,7 +666,7 @@ $(document).ready(function() { > </li> > [%IF makePreviousSerialAvailable %] > <li> >- <label for="previousitemtype">Previous item type:</label> >+ <label for="previousitemtype">item type for older issues:</label> > <select name="previousitemtype" id="previousitemtype"> > <option value=""></option> > [% FOREACH previous IN previoustypeloop %] >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index e28fd59..125c701 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -256,13 +256,7 @@ if ( $op and $op eq 'serialchangestatus' ) { > my $previous = GetPreviousSerialid($subscriptionids[$i]); > if ($previous) { > >- # Getting the itemnumber matching the serialid >- my $query = "SELECT itemnumber FROM serialitems WHERE serialid=?"; >- my $sth = $dbh->prepare($query); >- $sth->execute($previous); >- my @row = $sth->fetchrow_array; >- if ($row[0]) { >- my $itemnumber = $row[0]; >+ if (my $itemnumber = GetItemnumberFromSerialId($previous)) { > > # Getting the itemtype to set from the database > my $subscriptioninfos = GetSubscription($subscriptionids[$i]); >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7677
:
16339
|
16425
|
16456
|
20537
|
20538
|
24099
|
24635
|
25980
|
25981
|
25983
|
27774
|
28950
|
28951
|
28952
|
28953
|
29570
|
29571
|
29572
|
34220
|
34221
|
34222
|
34223
|
34665
|
36389
|
36446
|
36448
|
36449
|
36450
|
36451
|
36452
|
36453
|
36679
|
36680
|
36681
|
36682
|
36683
|
42923
|
42924
|
45938
|
45939
|
45940
|
45941
|
45942
|
45943
|
46216
|
47475
|
52010
|
54876
|
55000
|
55323
|
55466
|
55467
|
55468
|
55469
| 55470 |
55471
|
55472
|
55473
|
55474
|
55475