Bugzilla – Attachment 20537 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]
Bug 7677: New areas in subscriptions and new functions when receiving.
Bug-7677-New-areas-in-subscriptions-and-new-functi.patch (text/plain), 28.31 KB, created by
Jonathan Druart
on 2013-08-21 12:40:53 UTC
(
hide
)
Description:
Bug 7677: New areas in subscriptions and new functions when receiving.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-08-21 12:40:53 UTC
Size:
28.31 KB
patch
obsolete
>From c40a9ac44893ee89288ef029eb2a861d58440ec7 Mon Sep 17 00:00:00 2001 >From: Matthias Meusburger <matthias.meusburger@biblibre.com> >Date: Tue, 19 Mar 2013 10:07:41 +0100 >Subject: [PATCH] Bug 7677: New areas in subscriptions and new functions when > receiving. > > When enabling the makePreviousSerialAvailable syspref, the previously > received serial's itemtype is set as defined in the subscription. > (Please note that the item-level_itypes syspref must be set to specific item.) > It is also made available. > > You can define the serialsFieldsToAV syspref to associate authorized > values to the domain, origin and/or support fields. > > 995$l is automatically prefilled when receiving. > >Signed-off-by: Frederic Durand <frederic.durand@unilim.fr> > >http://bugs.koha-community.org/show_bug.cgi?id=8435 >--- > C4/Biblio.pm | 1 - > C4/Items.pm | 9 +++ > C4/Serials.pm | 54 +++++++++++--- > installer/data/mysql/kohastructure.sql | 5 ++ > installer/data/mysql/sysprefs.sql | 2 + > installer/data/mysql/updatedatabase.pl | 36 ++++++++++ > .../prog/en/modules/admin/preferences/serials.pref | 9 +++ > .../prog/en/modules/serials/serials-edit.tt | 6 ++ > .../prog/en/modules/serials/subscription-add.tt | 73 +++++++++++++++++++ > serials/serials-edit.pl | 24 +++++++ > serials/subscription-add.pl | 76 +++++++++++++++++++- > t/db_dependent/Serials.t | 4 +- > 12 files changed, 287 insertions(+), 12 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index e94b0eb..801d025 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2714,7 +2714,6 @@ sub TransformMarcToKohaOneField { > return $result; > } > >- > #" > > # >diff --git a/C4/Items.pm b/C4/Items.pm >index 64db262..6a60b16 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2728,6 +2728,9 @@ sub PrepareItemrecordDisplay { > while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) { > push @authorised_values, $itemtype; > $authorised_lib{$itemtype} = $description; >+ >+ # If we have default value named itemtype or itemtypes, we use it >+ $defaultvalue = $itemtype if ($defaultvalues and ($defaultvalues->{'itemtypes'} eq $itemtype or $defaultvalues->{'itemtype'} eq $itemtype)); > } > #---- class_sources > } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { >@@ -2756,6 +2759,12 @@ sub PrepareItemrecordDisplay { > while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { > push @authorised_values, $value; > $authorised_lib{$value} = $lib; >+ >+ # If we have a default value that has the same name as the authorised value category of the field, >+ # we use it >+ $defaultvalue = $value if ($defaultvalues and $defaultvalues->{$tagslib->{$tag}->{$subfield}->{authorised_value}} and $defaultvalues->{$tagslib->{$tag}->{$subfield}->{authorised_value}} eq $value); >+ >+ > } > } > $subfield_data{marc_value} = CGI::scrolling_list( >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 0fd2695..46bc772 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -47,6 +47,7 @@ BEGIN { > &ReNewSubscription &GetLateIssues &GetLateOrMissingIssues > &GetSerialInformation &AddItem2Serial > &PrepareSerialsData &GetNextExpected &ModNextExpected >+ &GetPreviousSerialid > > &UpdateClaimdateIssues > &GetSuppliersWithLateIssues &getsupplierbyserialid >@@ -824,6 +825,39 @@ sub GetLatestSerials { > return \@serials; > } > >+=head2 GetPreviousSerialid >+ >+$serialid = GetPreviousSerialid($subscriptionid, $nth) >+get the $nth's previous serial for the given subscriptionid >+return : >+the serialid >+ >+=cut >+ >+sub GetPreviousSerialid { >+ my ( $subscriptionid, $nth ) = @_; >+ $nth ||= 1; >+ my $dbh = C4::Context->dbh; >+ my $return = undef; >+ >+ # Status 2: Arrived >+ my $strsth = "SELECT serialid >+ FROM serial >+ WHERE subscriptionid = ? >+ AND status = 2 >+ ORDER BY serialid DESC LIMIT $nth,1 >+ "; >+ my $sth = $dbh->prepare($strsth); >+ $sth->execute($subscriptionid); >+ my @serials; >+ my $line = $sth->fetchrow_hashref; >+ $return = $line->{'serialid'} if ($line); >+ >+ return $return; >+} >+ >+ >+ > =head2 GetDistributedTo > > $distributedto=GetDistributedTo($subscriptionid) >@@ -1225,7 +1259,8 @@ sub ModSubscription { > $whenmorethan1, $setto1, $lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, > $lastvalue2, $innerloop2, $add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, > $numberingmethod, $status, $biblionumber, $callnumber, $notes, $letter, $hemisphere, $manualhistory, >- $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid >+ $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, >+ $ccode, $origin, $domain, $previousitemtype, $subscriptionid > ) = @_; > > # warn $irregularity; >@@ -1239,7 +1274,7 @@ sub ModSubscription { > numberingmethod=?, status=?, biblionumber=?, callnumber=?, notes=?, > letter=?, hemisphere=?,manualhistory=?,internalnotes=?,serialsadditems=?, > staffdisplaycount = ?,opacdisplaycount = ?, graceperiod = ?, location = ? >- ,enddate=? >+ ,enddate=?, itemtype=?, ccode=?, origin=?, domain=?, previousitemtype = ? > WHERE subscriptionid = ?"; > > #warn "query :".$query; >@@ -1256,10 +1291,11 @@ sub ModSubscription { > $numberingmethod, $status, $biblionumber, $callnumber, > $notes, $letter, $hemisphere, ( $manualhistory ? $manualhistory : 0 ), > $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, >- $graceperiod, $location, $enddate, $subscriptionid >+ $graceperiod, $location, $enddate, $itemtype, >+ $ccode, $origin, $domain, $previousitemtype, >+ $subscriptionid > ); > my $rows = $sth->rows; >- > logaction( "SERIAL", "MODIFY", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); > return $rows; > } >@@ -1287,7 +1323,8 @@ sub NewSubscription { > $lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, > $add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, $status, > $notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, >- $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate >+ $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, >+ $ccode, $origin, $domain, $previousitemtype > ) = @_; > my $dbh = C4::Context->dbh; > >@@ -1301,8 +1338,8 @@ sub NewSubscription { > add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3, > numberingmethod, status, notes, letter,firstacquidate,irregularity, > numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems, >- staffdisplaycount,opacdisplaycount,graceperiod,location,enddate) >- VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) >+ staffdisplaycount,opacdisplaycount,graceperiod,location,enddate, itemtype, ccode, origin, domain, previousitemtype) >+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) > |; > my $sth = $dbh->prepare($query); > $sth->execute( >@@ -1311,7 +1348,8 @@ sub NewSubscription { > $lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, > $add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, "$status", > $notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, >- $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate >+ $internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, >+ $ccode, $origin, $domain, $previousitemtype > ); > > my $subscriptionid = $dbh->{'mysql_insertid'}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 7628983..39c056f 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2031,6 +2031,11 @@ CREATE TABLE `subscription` ( > `enddate` date default NULL, > `closed` INT(1) NOT NULL DEFAULT 0, > `reneweddate` date default NULL, >+ `itemtype` VARCHAR( 10 ) NULL, >+ `ccode` VARCHAR( 10 ) NULL, >+ `origin` VARCHAR( 80 ) NULL, >+ `domain` VARCHAR( 80 ) NULL, >+ `previousitemtype` VARCHAR( 10 ) NULL, > PRIMARY KEY (`subscriptionid`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 6bf7727..200ecc3 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -168,6 +168,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('LinkerOptions','','','A pipe-separated list of options for the linker.','free'), > ('LinkerRelink','1',NULL,'If ON the authority linker will relink headings that have previously been linked every time it runs.','YesNo'), > ('LocalCoverImages','0','1','Display local cover images on intranet details pages.','YesNo'), >+('makePreviousSerialAvailable','0','','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','YesNo'), > ('ManInvInNoissuesCharge','1',NULL,'MANUAL_INV charges block checkouts (added to noissuescharge).','YesNo'), > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,NULL,'Textarea'), > ('MARCOrgCode','OSt','','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','free'), >@@ -326,6 +327,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'), > ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'), > ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'), >+('serialsFieldsToAV','','','There are several fields from serials which can use authorised values. Those are support, origin, and domain. You can configure them like this: support:995$r|origin:995$s|domain:995$t','') > ('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'), > ('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'), > ('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 165aaa2..cc8ecc3 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7077,6 +7077,42 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+ >+ >+ >+ >+ >+ >+$DBversion = "3.13.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do(q{ >+ ALTER TABLE `subscription` ADD `itemtype` VARCHAR( 10 ) NULL, >+ ADD `ccode` VARCHAR( 10 ) NULL, >+ ADD `origin` VARCHAR( 80 ) NULL, >+ ADD `domain` VARCHAR( 80 ) NULL, >+ ADD `previousitemtype` VARCHAR( 10 ) NULL >+ }); >+ print "Upgrade to $DBversion done (Bug 7677: Adds fields to subscription table)\n"; >+ SetVersion($DBversion); >+} >+ >+$DBversion = "3.13.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do( >+ "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('makePreviousSerialAvailable','0','make previous serial automatically available when collecting a new serial. Please note that the item-level_itypes syspref must be set to specific item.','','YesNo');" >+ ); >+ >+ $dbh->do( >+ 'INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ("serialsFieldsToAV","","There are several fields from serials which can use authorised values. Those are support, origin, and domain. You can configure them like this: support:995$r|origin:995$s|domain:995$t","","");' >+ ); >+ >+ print "Upgrade to $DBversion done (Add makePreviousSerialAvailable and serialsFieldsToAV sysprefs)\n"; >+ SetVersion($DBversion); >+} >+ >+ >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 db727b6..677f4f8 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 >@@ -50,3 +50,12 @@ Serials: > - > - List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |) > - pref: SubscriptionDuplicateDroppedInput >+ - >+ - pref: makePreviousSerialAvailable >+ 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. >+ - >+ - pref: serialsFieldsToAV >+ - "There are several fields from serials which can use authorised values. Those are support, origin, and domain. You can configure them like this: support:995$r|origin:995$s|domain:995$t" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >index 8f9ea5f..5b5838b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt >@@ -59,6 +59,12 @@ function unHideItems(index,labelindex, serialId) { > // Setting text field > $(subfield_div).children("input[type='text'][name='field_value']").val($("#serialseq" + serialId).val()); > >+ // Also prefilling 995$l >+ subfieldid = "subfield" + itemid.substr(4) + "l"; >+ $("#" + subfieldid + " input[type='text']").val($("#serialseq" + serialId).val()); >+ // And prefilling for supplemental issue >+ $("#subfieldNEWl input[type='text']").val($("#serialseqNEW").val()); >+ > } > function HideItems(index,labelindex) { > subfield = document.getElementById(index); >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 14f01ef..c822baf 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 >@@ -1049,6 +1049,79 @@ $(document).ready(function() { > [% FOREACH locations_loo IN locations_loop %][% IF ( locations_loo.selected ) %]<option value="[% locations_loo.authorised_value %]" selected="selected">[% locations_loo.lib %]</option>[% ELSE %]<option value="[% locations_loo.authorised_value %]">[% locations_loo.lib %]</option>[% END %][% END %] > </select> > </li> >+ <li> >+ <label for="itemtype">Item type:</label> >+ <select name="itemtype" id="itemtype"> >+ <option value=""></option> >+ [% FOREACH type IN typeloop %] >+ [% IF ( type.selected ) %] >+ <option value="[% type.code %]" selected="selected">[% type.value %]</option> >+ [% ELSE %] >+ <option value="[% type.code %]">[% type.value %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ [%IF makePreviousSerialAvailable %] >+ <li> >+ <label for="previousitemtype">Previous serial Item type:</label> >+ <select name="previousitemtype" id="previousitemtype"> >+ <option value=""></option> >+ [% FOREACH previous IN previoustypeloop %] >+ [% IF ( previous.selected ) %] >+ <option value="[% previous.code %]" selected="selected">[% previous.value %]</option> >+ [% ELSE %] >+ <option value="[% previous.code %]">[% previous.value %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ [% END %] >+ [% IF supportloop %] >+ <li> >+ <label for="support">Support:</label> >+ <select name="support" id="support"> >+ <option value=""></option> >+ [% FOREACH support IN supportloop %] >+ [% IF ( support.selected ) %] >+ <option value="[% support.code %]" selected="selected">[% support.value %]</option> >+ [% ELSE %] >+ <option value="[% support.code %]">[% support.value %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ [% END %] >+ [% IF originloop %] >+ <li> >+ <label for="origin">Origin:</label> >+ <select name="origin" id="origin"> >+ <option value=""></option> >+ [% FOREACH origin IN originloop %] >+ [% IF ( origin.selected ) %] >+ <option value="[% origin.code %]" selected="selected">[% origin.value %]</option> >+ [% ELSE %] >+ <option value="[% origin.code %]">[% origin.value %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ [% END %] >+ [% IF domainloop %] >+ <li> >+ <label for="domain">Domain:</label> >+ <select name="domain" id="domain"> >+ <option value=""></option> >+ [% FOREACH domain IN domainloop %] >+ [% IF ( domain.selected ) %] >+ <option value="[% domain.code %]" selected="selected">[% domain.value %]</option> >+ [% ELSE %] >+ <option value="[% domain.code %]">[% domain.value %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ [% END %] > <li> > <label for="callnumber">Call number:</label> > <input type="text" name="callnumber" id="callnumber" value="[% callnumber %]" size="20" /> >diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl >index 8fb2e60..c49adb2 100755 >--- a/serials/serials-edit.pl >+++ b/serials/serials-edit.pl >@@ -90,6 +90,7 @@ if ( scalar(@subscriptionids) == 1 && index( $subscriptionids[0], q|,| ) > 0 ) { > } > my @errors; > my @errseq; >+my $dbh = C4::Context->dbh; > > # If user comes from subscription details > unless (@serialids) { >@@ -242,6 +243,29 @@ if ( $op and $op eq 'serialchangestatus' ) { > $notes[$i] > ); > } >+ my $makePreviousSerialAvailable = C4::Context->preference('makePreviousSerialAvailable'); >+ if ($makePreviousSerialAvailable && $serialids[$i] ne "NEW") { >+ # We already have created the new expected serial at this point, so we get the second previous serial >+ 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]; >+ >+ # Getting the itemtype to set from the database >+ my $subscriptioninfos = GetSubscription($subscriptionids[$i]); >+ >+ # Changing the status to "available" and the itemtype according to the previousitemtype db field >+ ModItem({notforloan => 0, itype => $subscriptioninfos->{'previousitemtype'} }, undef, $itemnumber); >+ } >+ } >+ } >+ > } > my @moditems = $query->param('moditem'); > if ( scalar(@moditems) ) { >diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl >index eaf5582..be2203f 100755 >--- a/serials/subscription-add.pl >+++ b/serials/subscription-add.pl >@@ -149,6 +149,65 @@ $template->param(branchloop => $branchloop, > locations_loop=>$locations_loop, > ); > # prepare template variables common to all $op conditions: >+my $shelflocations = GetKohaAuthorisedValues( 'items.location', '' ); >+ >+my @locationarg = >+ map { { code => $_, value => $shelflocations->{$_}, selected => ( ( $subs->{location} and $_ eq $subs->{location} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$shelflocations}; >+ >+my $typeloop = GetItemTypes(); >+ >+# Getting which field is mapped to which authorised value >+my $mapstring = C4::Context->preference('serialsFieldsToAV'); >+my %hashmap = split(/[:|]/, $mapstring); >+my $supportloop; >+my $originloop; >+my $domainloop; >+ >+if ($hashmap{'support'}) { >+ my ($field, $subfield) = split('\$', $hashmap{'support'}); >+ $supportloop = GetKohaAuthorisedValuesFromField($field, $subfield, ''); >+} >+ >+if ($hashmap{'origin'}) { >+ my ($field, $subfield) = split('\$', $hashmap{'origin'}); >+ $originloop = GetKohaAuthorisedValuesFromField($field, $subfield, ''); >+} >+ >+if ($hashmap{'domain'}) { >+ my ($field, $subfield) = split('\$', $hashmap{'domain'}); >+ $domainloop = GetKohaAuthorisedValuesFromField($field, $subfield, ''); >+} >+ >+ >+my @typearg = >+ map { { code => $_, value => $typeloop->{$_}{'description'}, selected => ( ( $subs->{itemtype} and $_ eq $subs->{itemtype} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$typeloop}; >+my @previoustypearg = >+ map { { code => $_, value => $typeloop->{$_}{'description'}, selected => ( ( $subs->{previousitemtype} and $_ eq $subs->{previousitemtype} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$typeloop}; >+my @supportarg = >+ map { { code => $_, value => $supportloop->{$_}, selected => ( ( $subs->{ccode} and $_ eq $subs->{ccode} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$supportloop}; >+my @originarg = >+ map { { code => $_, value => $originloop->{$_}, selected => ( ( $subs->{origin} and $_ eq $subs->{origin} ) ? "selected=\"selected\"" : "" ), } } sort { lc $originloop->{$a} cmp lc $originloop->{$b} } keys %{$originloop}; >+my @domainarg = >+ map { { code => $_, value => $domainloop->{$_}, selected => ( ( $subs->{domain} and $_ eq $subs->{domain} ) ? "selected=\"selected\"" : "" ), } } sort keys %{$domainloop}; >+ >+ >+ >+$template->param( shelflocations => \@locationarg ); >+ >+$template->param( >+ branchloop => $branchloop, >+ typeloop => \@typearg, >+ previoustypeloop => \@previoustypearg, >+ supportloop => \@supportarg, >+ originloop => \@originarg, >+ domainloop => \@domainarg, >+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), >+ locations_loop=>$locations_loop, >+); >+# prepare template variables common to all $op conditions: >+$template->param( 'dateformat_' . C4::Context->preference('dateformat') => 1 ); >+$template->param('makePreviousSerialAvailable' => 1) if (C4::Context->preference('makePreviousSerialAvailable')); >+ > if ($op!~/^mod/) { > letter_loop(q{}, $template); > } >@@ -254,6 +313,11 @@ sub redirect_add_subscription { > my $staffdisplaycount = $query->param('staffdisplaycount'); > my $opacdisplaycount = $query->param('opacdisplaycount'); > my $location = $query->param('location'); >+ my $itemtype = $query->param('itemtype'); >+ my $support = $query->param('support'); >+ my $origin = $query->param('origin'); >+ my $domain = $query->param('domain'); >+ my $previousitemtype = $query->param('previousitemtype'); > my $startdate = format_date_in_iso( $query->param('startdate') ); > my $enddate = format_date_in_iso( $query->param('enddate') ); > my $firstacquidate = format_date_in_iso($query->param('firstacquidate')); >@@ -270,7 +334,7 @@ sub redirect_add_subscription { > $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3, > $numberingmethod, $status, $notes,$letter,$firstacquidate,join(",",@irregularity), > $numberpattern, $callnumber, $hemisphere,($manualhistory?$manualhistory:0),$internalnotes, >- $serialsadditems,$staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate >+ $serialsadditems,$staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate, $itemtype, $support, $origin, $domain, $previousitemtype > ); > ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); > >@@ -326,6 +390,12 @@ sub redirect_mod_subscription { > my $letter = $query->param('letter'); > my $manualhistory = $query->param('manualhist'); > my $serialsadditems = $query->param('serialsadditems'); >+ my $itemtype = $query->param('itemtype'); >+ my $support = $query->param('support'); >+ my $origin = $query->param('origin'); >+ my $domain = $query->param('domain'); >+ my $previousitemtype = $query->param('previousitemtype'); >+ > # subscription history > my $histenddate = format_date_in_iso($query->param('histenddate')); > my $histstartdate = format_date_in_iso($query->param('histstartdate')); >@@ -356,9 +426,11 @@ sub redirect_mod_subscription { > $whenmorethan3, $setto3, $lastvalue3, $innerloop3, > $numberingmethod, $status, $biblionumber, $callnumber, > $notes, $letter, $hemisphere, $manualhistory,$internalnotes, >- $serialsadditems, $staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate,$subscriptionid >+ $serialsadditems, $staffdisplaycount,$opacdisplaycount,$graceperiod,$location,$enddate, $itemtype, $support, $origin, $domain, $previousitemtype, $subscriptionid > ); > ModSubscriptionHistory ($subscriptionid,$histstartdate,$histenddate,$recievedlist,$missinglist,$opacnote,$librariannote); >+ >+ > print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid"); > return; > } >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 424effc..1785dfa 100644 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -37,7 +37,9 @@ if ($subscriptioninformation->{periodicity} % 16==0){ > whenmorethan1, setto1, lastvalue1, innerloop1, add2, every2, whenmorethan2, setto2, > lastvalue2, innerloop2, add3, every3, whenmorethan3, setto3, lastvalue3, innerloop3, > numberingmethod, status, biblionumber, callnumber, notes, letter, hemisphere, manualhistory, >- internalnotes, serialsadditems, staffdisplaycount, opacdisplaycount, graceperiod, location, enddate, subscriptionid >+ internalnotes, serialsadditems, staffdisplaycount, opacdisplaycount, graceperiod, location, enddate, >+ itemtype, support, origin, domain, previousitemtype, >+ subscriptionid > )}); > } > my $expirationdate = GetExpirationDate(1) ; >-- >1.7.10.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