Bug 13423: Remove unused serials-recieve
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Sat, 25 Apr 2015 12:01:44 +0000 (09:01 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 14 May 2015 14:48:17 +0000 (11:48 -0300)
This patch removes two files, serials-recieve.pl and serial-recieve.tt
serials-recieve.pl is not called anyware
(it's recieve!)

Also removes the sub removeMissingIssue called only from serials-recieve.pl

git grep serials-recieve.pl .
C4/Serials.pm:called when a missing issue is found from the serials-recieve.pl file
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt:     <form method="post" name="f2" action="serials-recieve.pl">
serials/serials-recieve.pl:serials-recieve.pl

Just a POD entry and self reference.

After removing of files

git grep removeMissingIssue .
C4/Serials.pm:      &check_routing &updateClaim &removeMissingIssue
C4/Serials.pm:=head2 removeMissingIssue
C4/Serials.pm:removeMissingIssue($subscriptionid)
C4/Serials.pm:sub removeMissingIssue {
t/db_dependent/Serials.t:is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');

Not used anymore

To test:
1) Apply the patch
2) Check serials workflow, no changes must be noted

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

C4/Serials.pm
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt [deleted file]
serials/serials-recieve.pl [deleted file]
t/db_dependent/Serials.t

index 46d019d..807306d 100644 (file)
@@ -79,7 +79,7 @@ BEGIN {
       &GetDistributedTo   &SetDistributedTo
       &getroutinglist     &delroutingmember   &addroutingmember
       &reorder_members
-      &check_routing &updateClaim &removeMissingIssue
+      &check_routing &updateClaim
       &CountIssues
       HasItems
       &GetSubscriptionsFromBorrower
@@ -1941,47 +1941,6 @@ sub GetLateOrMissingIssues {
     return @issuelist;
 }
 
-=head2 removeMissingIssue
-
-removeMissingIssue($subscriptionid)
-
-this function removes an issue from being part of the missing string in 
-subscriptionlist.missinglist column
-
-called when a missing issue is found from the serials-recieve.pl file
-
-=cut
-
-sub removeMissingIssue {
-    my ( $sequence, $subscriptionid ) = @_;
-
-    return unless ($sequence and $subscriptionid);
-
-    my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("SELECT * FROM subscriptionhistory WHERE subscriptionid = ?");
-    $sth->execute($subscriptionid);
-    my $data              = $sth->fetchrow_hashref;
-    my $missinglist       = $data->{'missinglist'};
-    my $missinglistbefore = $missinglist;
-
-    # warn $missinglist." before";
-    $missinglist =~ s/($sequence)//;
-
-    # warn $missinglist." after";
-    if ( $missinglist ne $missinglistbefore ) {
-        $missinglist =~ s/\|\s\|/\|/g;
-        $missinglist =~ s/^\| //g;
-        $missinglist =~ s/\|$//g;
-        my $sth2 = $dbh->prepare(
-            "UPDATE subscriptionhistory
-                    SET missinglist = ?
-                    WHERE subscriptionid = ?"
-        );
-        $sth2->execute( $missinglist, $subscriptionid );
-    }
-    return;
-}
-
 =head2 updateClaim
 
 &updateClaim($serialid)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt
deleted file mode 100644 (file)
index f93c8c7..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Serials &rsaquo; Check in subscription for [% bibliotitle %]</title>
-[% INCLUDE 'doc-head-close.inc' %]
-<script language="JavaScript" type="text/javascript">
-//<![CDATA[
-function popup() {
-       window.open("subscription-renew.pl?subscriptionid=[% subscriptionid %]","subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
-}
-
-function barcode_check(){
-    [% IF ( count ) %]
-       var count = '[% count %]';
-       for(var i=1;i<=count;i++){
-
-               var barcodenum = "barcode"+i;
-               var statusnum = "status"+i;
-               var elembarcode = "document.getElementById('"+barcodenum+"')";
-               var elemstatus = "document.getElementById('"+statusnum+"')";
-// alert(elembarcode+"\n"+eval(elembarcode+".value));
-// alert(elemstatus+"\n"+eval(elemstatus+".value"));
-               if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
-                       var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
-                       if (answer){
-                               document.f.submit();
-                       } else {
-                               return false;
-                       }
-               }
-               if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
-                       var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
-                       if (answer){
-                               document.f.submit();
-                       } else {
-                               return false;
-                       }
-               }
-       }
-    [% END %]
-}
-//]]>
-</script>
-</head>
-<body id="ser_serials-recieve" class="ser">
-[% INCLUDE 'header.inc' %]
-[% INCLUDE 'serials-search.inc' %]
-
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Check in subscription for <i>[% bibliotitle %]</i></div>
-
-<div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
-
-<h1>Check In subscription for <i>[% bibliotitle %]</i></h1>
-<div id="action">
-    <a href="subscription-detail.pl?subscriptionid=[% subscriptionid %]" title="detail of the subscription">Subscription Details</a>
-    <!-- <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=[% biblionumber %]" class="button" title="all subscriptions on [% bibliotitle %]">Search all subscriptions</a> -->
-    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a>
-    [% IF ( routing ) %]
-    <a href="routing.pl?subscriptionid=[% subscriptionid %]" title="subscription routing list">Routing list</a>
-    [% END %]
-</div>
-
-<h2>Expected or late</h2>
-       <form method="post" name="f" action="serials-recieve.pl" onsubmit="return barcode_check()">
-               <input type="hidden" name="op" value="serialchangestatus" />
-               <input type="hidden" name="serial" value="[% serial %]" />
-               <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
-               <input type="hidden" name="user" value="[% user %]" />
-       <table>
-       <tr>
-               <th>Numbered</th>
-               <th>Published on</th>
-        <th>Planned for</th>
-               <th>Status</th>
-               <th>Notes</th>
-       </tr>
-       [% FOREACH serialslis IN serialslist %]
-               <tr>
-                       <td>
-                               Issue <input type="text" name="serialseq" value="[% serialslis.serialseq %]" size="20" maxlength="100" />
-                       [% IF ( serialslis.serialadditems ) %]
-                               <br /><br />
-                Call number <input type="text" name="itemcallnumber" value="[% serialslis.callnumber %]" size="15" maxlength="100" />
-                               Barcode <input type="text" name="barcode" value="[% serialslis.barcode %]" id="barcode[% serialslis.num %]" size="20" maxlength="20" />
-                       [% END %]
-                       </td>
-                       <td>
-                               <input type="text" name="publisheddate" value="[% serialslis.publisheddate %]" size="10" maxlength="15" />
-                       [% IF ( serialslis.serialadditems ) %]
-                               <br /><br />&nbsp;
-                       [% END %]
-                       </td>
-                       <td>
-                               <input type="text" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" />
-                       [% IF ( serialslis.serialadditems ) %]
-                               <br /><br />
-                               <select name="branch">
-                                               <option value="">Library</option>
-                       [% FOREACH branchloo IN serialslis.branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
-                               [% ELSE %]
-                               <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
-                               [% END %]
-                       [% END %]
-                               </select>
-                       [% END %]
-                       </td>
-                       <td>
-                               <input type="hidden" name="serialid" value="[% serialslis.serialid %]" />
-                               <select name="status" id="status[% serialslis.num %]">
-                                       [% IF ( serialslis.status1 ) %]
-                                               <option value="1" selected="selected">Expected</option>
-                                       [% END %]
-                                       [% IF ( serialslis.status2 ) %]
-                                               <option value="2" selected="selected">Arrived</option>
-                                       [% ELSE %]
-                                               <option value="2">Arrived</option>
-                                       [% END %]
-                                       [% IF ( serialslis.status3 ) %]
-                                               <option value="3" selected="selected">Late</option>
-                                       [% ELSE %]
-                                               <option value="3">Late</option>
-                                       [% END %]
-                                       [% IF ( serialslis.status4 ) %]
-                                               <option value="4" selected="selected">Missing</option>
-                                       [% ELSE %]
-                                               <option value="4">Missing</option>
-                                       [% END %]
-                    [% IF ( serialslis.status41 ) %]
-                      <option value="41" selected="selected">Missing (never received)</option>
-                    [% ELSE %]
-                      <option value="41">Missing (never received)</option>
-                    [% END %]
-                    [% IF ( serialslis.status42 ) %]
-                      <option value="42" selected="selected">Missing (sold out)</option>
-                    [% ELSE %]
-                      <option value="42">Missing (sold out)</option>
-                    [% END %]
-                    [% IF ( serialslis.status43 ) %]
-                      <option value="43" selected="selected">Missing (damaged)</option>
-                    [% ELSE %]
-                      <option value="43">Missing (damaged)</option>
-                    [% END %]
-                    [% IF ( serialslis.status44 ) %]
-                      <option value="44" selected="selected">Missing (lost)</option>
-                    [% ELSE %]
-                      <option value="44">Missing (lost)</option>
-                    [% END %]
-                                       [% IF ( serialslis.status5 ) %]
-                        <option value="5" selected="selected">Not available</option>
-                                       [% ELSE %]
-                        <option value="5">Not available</option>
-                                       [% END %]
-                                       [% IF ( serialslis.status6 ) %]
-                                               <option value="6" selected="selected">Delete</option>
-                                       [% ELSE %]
-                                               <option value="6">Delete</option>
-                                       [% END %]
-                    [% IF serialslis.status8 %]
-                        <option value="8" selected="selected">Stopped</option>
-                    [% END %]
-                               </select>
-                       [% IF ( serialslis.serialadditems ) %]
-                               <br /><br />
-                               [% IF ( serialslis.itemstatus ) %]
-                                   [% IF ( serialslis.choice ) %]
-                                               [% FOREACH itemstatusloo IN serialslis.itemstatusloop %]
-                                                       [% itemstatusloo.itemlib %]: 
-                                                       [% IF ( itemstatusloo.selected ) %]
-                                                       <input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" checked="checked" />
-                                                       [% ELSE %]
-                                                       <input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" />
-                                                       [% END %]
-                                               [% END %]
-                                   [% ELSE %]
-                                       <select name="itemstatus">
-                        <option value="">Item status</option>
-                                               [% FOREACH itemstatusloo IN serialslis.itemstatusloop %]
-                                               [% IF ( itemstatusloo.selected ) %]
-                                                       <option value="[% itemstatusloo.itemval %]" selected="selected">[% itemstatusloo.itemlib %]</option>
-                                                       [% ELSE %]
-                                                       <option value="[% itemstatusloo.itemval %]">[% itemstatusloo.itemlib %]</option>
-                                                       [% END %]
-                                               [% END %]
-                                       </select>
-                                   [% END %]
-                               [% ELSE %]
-                               &nbsp;
-                               [% END %]
-                       [% END %]
-
-                       </td>
-                       <td>
-                               <input type="text" name="notes" value="[% serialslis.notes %]" size="20" maxlength="255" />
-                       [% IF ( serialslis.serialadditems ) %]
-                               <br /><br />
-                               [% IF ( serialslis.itemlocation ) %]
-                                       <select name="location">
-                                               <option value="">Location</option>
-                                               [% FOREACH itemlocationloo IN serialslis.itemlocationloop %]
-                                               [% IF ( itemlocationloo.selected ) %]
-                                                       <option value="[% itemlocationloo.value %]" selected="selected">[% itemlocationloo.itemlocationname %]</option>
-                                                       [% ELSE %]
-                                                       <option value="[% itemlocationloo.value %]">[% itemlocationloo.itemlocationname %]</option>
-                                               [% END %]
-                                               [% END %]
-                                       </select>
-                               [% ELSE %]
-                               &nbsp;
-                               [% END %]
-                       [% END %]
-                       </td>
-               </tr>
-       [% END %]
-       [% UNLESS ( hassubscriptionexpired ) %]
-               <tr>
-                       <td>
-                               Manual issue <input type="text" name="serialseq" size="30" maxlength="100" value="[% missingseq %]" />
-                       [% IF ( serialadditems ) %]
-                               <br /><br />
-                Call number <input type="text" name="itemcallnumber" value="" size="10" maxlength="15" />
-                               Barcode <input type="text" name="barcode" value="" size="20" maxlength="20" />
-                       [% END %]
-                       </td>
-                       <td>
-                               <input type="text" name="publisheddate" value="[% publisheddate %]" size="10" maxlength="15" />
-                       [% IF ( serialadditems ) %]
-                               <br /><br />&nbsp;
-                       [% END %]
-                       </td>
-                       <td>
-                               <input type="text" name="planneddate" size="10" maxlength="15" value="[% missingdate %]" />
-                       [% IF ( serialadditems ) %]
-                               <br /><br />
-                               <select name="branch">
-                                               <option value="">Library</option>
-                       [% FOREACH branchloo IN branchloop %]
-                               [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
-                               [% ELSE %]
-                               <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
-                               [% END %]
-                       [% END %]
-                               </select>
-                       [% END %]
-                       </td>
-                       <td>
-                               [% IF ( frommissing ) %]
-                               <input type="hidden" name="serialid" value="[% missingid %]" />
-                               [% ELSE %]
-                               <input type="hidden" name="serialid" value="0" />
-                               [% END %]
-                               <select name="status">
-                                               [% IF ( frommissing ) %]
-                                               <option value="2" selected="selected">Arrived</option>
-                                               [% ELSE %]
-                                               <option value="2">Arrived</option>
-                               
-                                               [% END %]
-                                               [% IF ( frommissing ) %]
-                                               <option value="3">Late</option>
-                                               [% ELSE %]
-                                               <option value="3" selected="selected">Late</option>
-                                               [% END %]
-                                               <option value="4">Missing</option>
-                        <option value="5">Not available</option>
-
-
-                               </select>
-                       [% IF ( serialadditems ) %]
-                               <br /><br />
-                               [% IF ( itemstatus ) %]
-                                   [% IF ( choice ) %]
-                                               [% FOREACH itemstatusloo IN itemstatusloop %]
-                                                       [% itemstatusloo.itemlib %]: 
-                                                       [% IF ( itemstatusloo.selected ) %]
-                                                       <input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" checked="checked" />
-                                                       [% ELSE %]
-                                                       <input type="checkbox" name="itemstatus" value="[% itemstatusloo.itemval %]" />
-                                                       [% END %]
-                                               [% END %]
-                                   [% ELSE %]
-                                       <select name="itemstatus">
-                        <option value="">Item status</option>
-                                               [% FOREACH itemstatusloo IN itemstatusloop %]
-                                               [% IF ( itemstatusloo.selected ) %]
-                                                       <option value="[% itemstatusloo.itemval %]" selected="selected">[% itemstatusloo.itemlib %]</option>
-                                               [% ELSE %]
-                                                       <option value="[% itemstatusloo.itemval %]">[% itemstatusloo.itemlib %]</option>
-[% END %]
-                                               [% END %]
-                                       </select>
-                                   [% END %]
-                               [% ELSE %]
-                               &nbsp;
-                               [% END %]
-                       [% END %]
-                       </td>
-                       <td>
-                               &nbsp;
-                       [% IF ( serialadditems ) %]
-                               <br /><br />
-                               [% IF ( itemlocation ) %]
-                                       <select name="location">
-                                               <option value="">Location</option>
-                                               [% FOREACH itemlocationloo IN itemlocationloop %]
-                                               [% IF ( itemlocationloo.selected ) %]
-                                                       <option value="[% itemlocationloo.value %]" selected="selected">[% itemlocationloo.itemlocationname %]</option>
-                                               [% ELSE %]
-                                                       <option value="[% itemlocationloo.value %]">[% itemlocationloo.itemlocationname %]</option>
-                                       [% END %]
-                                               [% END %]
-                                       </select>
-                               [% ELSE %]
-                               &nbsp;
-                               [% END %]
-                       [% END %]
-                       </td>
-               </tr>
-       [% END %]
-       </table>
-       <input type="submit" value="Save changes" accesskey="w" class="button" />
-       [% IF ( hassubscriptionexpired ) %]
-               <h3>Subscription has expired.</h3>
-               <p><b>Expected issue status can't be changed. <a href="#" onclick="popup()" class="button">Renew</a> your subscription</b></p>
-       [% END %]
-       [% IF ( abouttoexpire ) %]
-               <h3>Note: Subscription is about to expire next issue.</h3>
-               <script type="text/javascript">
-               <!--
-               alert(_("Subscription is about to expire next issue"));
-               //-->
-               </script>
-       [% END %]       
-       </form>
-
-       <h2>Subscription summary</h2>
-       <form method="post" name="f2" action="serials-recieve.pl">
-               <input type="hidden" name="op" value="modsubscriptionhistory" />
-               <input type="hidden" name="serial" value="[% serial %]" />
-               <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
-               <input type="hidden" name="user" value="[% user %]" />
-               <p><label>Librarian</label>[% user %]</p>
-               <p><label>Starting date:</label><input type="text" name="histstartdate" value="[% histstartdate %]" /> (the date of the 1st subscription)</p>
-               <p><label>Ending date:</label><input type="text" name="enddate" value="[% enddate %]" />(if empty subscription is still active)</p>
-               <p>Received issues</p>
-               <p><textarea name="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea></p>
-               <p>Missing issues</p>
-               <p><textarea name="missinglist" cols="60" rows="2">[% missinglist %]</textarea></p>
-               <p>OPAC note</p>
-               <p><textarea name="opacnote" cols="60" rows="5">[% opacnote %]</textarea></p>
-               <input type="submit" value="Save changes" class="button" />
-       </form>
-
-
-</div>
-</div>
-
-<div class="yui-b">
-[% INCLUDE 'serials-menu.inc' %]
-</div>
-</div>
-[% INCLUDE 'intranet-bottom.inc' %]
diff --git a/serials/serials-recieve.pl b/serials/serials-recieve.pl
deleted file mode 100755 (executable)
index 13fa361..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright 2000-2002 Katipo Communications
-#
-# 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>.
-
-
-=head1 NAME
-
-serials-recieve.pl
-
-=head1 Parameters
-
-=over 4
-
-=item op
-op can be :
-    * modsubscriptionhistory :to modify the subscription history
-    * serialchangestatus     :to modify the status of this subscription
-
-=item subscriptionid
-
-=item user
-
-=item histstartdate
-
-=item enddate
-
-=item recievedlist
-
-=item missinglist
-
-=item opacnote
-
-=item librariannote
-
-=item serialid
-
-=item serialseq
-
-=item planneddate
-
-=item notes
-
-=item status
-
-=back
-
-=cut
-
-
-use strict;
-use warnings;
-use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Dates qw/format_date format_date_in_iso/;
-use C4::Biblio;
-use C4::Items;
-use C4::Koha;
-use C4::Output;
-use C4::Context;
-use C4::Serials;
-use C4::Branch; # GetBranches
-
-my $query = new CGI;
-my $op = $query->param('op') || q{};
-my $dbh = C4::Context->dbh;
-my $subscriptionid = $query->param('subscriptionid');
-# my $auser = $query->param('user');
-my $histstartdate = format_date_in_iso($query->param('histstartdate'));
-my $enddate = format_date_in_iso($query->param('enddate'));
-my $recievedlist = $query->param('recievedlist');
-my $missinglist = $query->param('missinglist');
-my $opacnote = $query->param('opacnote');
-my $librariannote = $query->param('librariannote');
-my @serialids = $query->param('serialid');
-my @serialseqs = $query->param('serialseq');
-my @planneddates = $query->param('planneddate');
-my @publisheddates = $query->param('publisheddate');
-my @status = $query->param('status');
-my @notes = $query->param('notes');
-my @barcodes = $query->param('barcode');
-my @itemcallnumbers = $query->param('itemcallnumber');
-my @locations = $query->param('location');
-my @itemstatus = $query->param('itemstatus');
-my @homebranches = $query->param('branch');
-my $hassubscriptionexpired = HasSubscriptionExpired($subscriptionid);
-my $abouttoexpire = abouttoexpire($subscriptionid);
-
-my $subscription=GetSubscription($subscriptionid);
-
-
-my $auser = $subscription->{'librarian'}; # bob
-my $routing = check_routing($subscriptionid); # to see if routing list exists
-my $manualdate ='';
-my $manualissue ='';
-my $manualstatus =0;
-my $manualid ='';
-if ($op eq 'found'){
-    $manualdate = $query->param('planneddate');
-    $manualissue = $query->param('missingissue');
-    $manualstatus = 1;
-    my $sth = $dbh->prepare("select serialid from serial where subscriptionid = ? AND serialseq = ? AND planneddate = ?");
-    $sth->execute($subscriptionid,$manualissue,format_date_in_iso($manualdate));
-    $manualid = $sth->fetchrow;
-}
-if ($op eq 'modsubscriptionhistory') {
-    ModSubscriptionHistory($subscriptionid,$histstartdate,$enddate,$recievedlist,$missinglist,$opacnote,$librariannote);
-}
-
-# change status except, if subscription has expired, for the "waited" issue.
-if ($op eq 'serialchangestatus') {
-    my $sth = $dbh->prepare("select status from serial where serialid=?");
-    for (my $i=0;$i<=$#serialids;$i++) {
-        $sth->execute($serialids[$i]);
-
-        my ($oldstatus) = $sth->fetchrow;
-        if ($serialids[$i]) {
-            ModSerialStatus($serialids[$i],$serialseqs[$i],format_date_in_iso($planneddates[$i]),format_date_in_iso($publisheddates[$i]),$status[$i],$notes[$i]) unless ($hassubscriptionexpired && $oldstatus == 1);
-            if (($status[$i]==2) && C4::Context->preference("serialsadditems")){
-                my %info;
-                $info{branch}=$homebranches[$i];
-                $info{barcode}=$barcodes[$i];
-                $info{itemcallnumber}=$itemcallnumbers[$i];
-                $info{location}=$locations[$i];
-                $info{status}=$itemstatus[$i];
-                $info{notes}=$serialseqs[$i]." (".$planneddates[$i].")";
-                my ($status2, @errors)= ItemizeSerials($serialids[$i],\%info);
-                my $sth2 = $dbh->prepare("UPDATE subscriptionhistory SET lastbranch = ? WHERE subscriptionid = ?");
-                $sth2->execute($homebranches[$i],$subscriptionid);
-                $sth2->finish;
-                # remove from missing list if item being checked in is on it
-                if ($status2 ==1){
-                removeMissingIssue($serialseqs[$i],$subscriptionid);
-                }
-            }
-        } else {
-            # add a special issue
-            if ($serialseqs[$i]) {
-                NewIssue($serialseqs[$i],$subscriptionid,$subscription->{biblionumber},$status[$i] ,format_date_in_iso($publisheddates[$i]),format_date_in_iso($planneddates[$i]));
-            }
-            if (($status[$i]==2) && C4::Context->preference("serialsadditems") && !hassubscriptionexpired($subscriptionid)){
-                my %info;
-                $info{branch}=$homebranches[$i];
-                $info{barcode}=$barcodes[$i];
-                $info{itemcallnumber}=$itemcallnumbers[$i];
-                $info{location}=$locations[$i];
-                $info{status}=$itemstatus[$i];
-                $info{notes}=$serialseqs[$i]." (".$planneddates[$i].")";
-                my ($status2, @errors)= ItemizeSerials($serialids[$i],\%info);
-                my $sth2 = $dbh->prepare("UPDATE subscriptionhistory SET lastbranch = ? WHERE subscriptionid = ?");
-                $sth2->execute($homebranches[$i],$subscriptionid);
-                $sth2->finish;
-                # remove from missing list if item being checked in is on it
-                if ($status2 ==1){
-                 removeMissingIssue($serialseqs[$i],$subscriptionid);
-                }
-            }
-
-        }
-    }
-}
-my ($template, $loggedinuser, $cookie)
-= get_template_and_user({template_name => "serials/serials-recieve.tt",
-                query => $query,
-                type => "intranet",
-                authnotrequired => 0,
-                flagsrequired => {serials => 1},
-                debug => 1,
-                });
-
-my $subs = &GetSubscription($subscriptionid);
-my ($totalissues,@serialslist) = GetSerials($subscriptionid);
-my $count = @serialslist;
-for(my $i=0;$i<$count;$i++){
-    #warn "la : $i";
-    $serialslist[$i]->{'callnumber'} = $subscription->{'callnumber'};
-    my $temp = rand(10000000);
-    $serialslist[$i]->{'barcode'} = "TEMP" . sprintf("%.0f",$temp);
-}
-
-my $solhistory = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
-
-$subs = &GetSubscription($subscriptionid);
-($totalissues,@serialslist) = GetSerials($subscriptionid);
-
-if (C4::Context->preference("serialsadditems")){
-    my $fwk=GetFrameworkCode($subscription->{biblionumber});
-
-    my $branches = GetBranches;
-    my @branchloop;
-    foreach my $thisbranch (keys %$branches) {
-        my $selected = 0;
-        if($thisbranch eq $solhistory->{'lastbranch'}){
-        $selected = 1;
-        }
-        my %row =(value => $thisbranch,
-            branchname => $branches->{$thisbranch}->{'branchname'},
-                selected => $selected,
-                );
-        push @branchloop, \%row;
-    }
-    my $itemstatushash = GetItemStatus($fwk);
-    my @itemstatusloop;
-       my $itemstatusloopcount=0;
-    foreach my $thisitemstatus (keys %$itemstatushash) {
-        my %row =(itemval => $thisitemstatus,
-                    itemlib => $itemstatushash->{$thisitemstatus},
-                );
-#              warn "".$row{'itemval'}.", ". $row{"itemlib"};
-               $itemstatusloopcount++;
-        push @itemstatusloop, \%row;
-    }
-    my $itemlocationhash = GetItemLocation($fwk);
-    my @itemlocationloop;
-    foreach my $thisitemlocation (keys %$itemlocationhash) {
-        my %row =(value => $thisitemlocation,
-                    itemlocationname => $itemlocationhash->{$thisitemlocation},
-                );
-        push @itemlocationloop, \%row;
-    }
-
-       my $choice = ($itemstatusloopcount == 1) ? 1 : 0;
-       foreach my $data (@serialslist){
-               $data->{"itemstatusloop"}   = (scalar(@itemstatusloop  )) ? \@itemstatusloop   : [];
-               $data->{"itemlocationloop"} = (scalar(@itemlocationloop)) ? \@itemlocationloop : [];
-               $data->{"branchloop"} = \@branchloop ;
-       }
-# warn "Choice: $choice";
-    $template->param(choice => $choice);
-    $template->param(serialadditems =>C4::Context->preference("serialsadditems"),
-                    branchloop => \@branchloop,
-                    ) ;
-       $template->param(  itemstatus=>1,  itemstatusloop=>\@itemstatusloop  ) if (scalar(@itemstatusloop  ));
-       $template->param(itemlocation=>1,itemlocationloop=>\@itemlocationloop) if (scalar(@itemlocationloop));
-} else {
-    $template->param(branchloop=>[],itemstatusloop=>[],itemlocationloop=>[]) ;
-}
-
-$solhistory = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
-
-$template->param(
-            user => $auser,
-            serialslist => \@serialslist,
-            count => $count,
-            biblionumber => $subscription->{biblionumber},
-            histstartdate => format_date($solhistory->{'histstartdate'}),
-            enddate => format_date($solhistory->{'enddate'}),
-            recievedlist => $solhistory->{'recievedlist'},
-            missinglist => $solhistory->{'missinglist'},
-            opacnote => $solhistory->{'opacnote'},
-            librariannote => $solhistory->{'librariannote'},
-            subscriptionid => $subscriptionid,
-            bibliotitle => $subs->{bibliotitle},
-            biblionumber => $subs->{biblionumber},
-            hassubscriptionexpired =>$hassubscriptionexpired,
-            abouttoexpire =>$abouttoexpire,
-            routing => $routing,
-            missingseq => $manualissue,
-            frommissing => $manualstatus,
-            missingdate => $manualdate,
-            missingid => $manualid,
-            (uc(C4::Context->preference("marcflavour"))) => 1
-        );
-output_html_with_http_headers $query, $cookie, $template->output;
index a156b94..6ad66e5 100644 (file)
@@ -182,8 +182,6 @@ is(C4::Serials::HasSubscriptionExpired(), undef, 'test if the subscriptions has
 
 is(C4::Serials::GetLateOrMissingIssues(), undef, 'test getting last or missing issues');
 
-is(C4::Serials::removeMissingIssue(), undef, 'test removing a missing issue');
-
 is(C4::Serials::updateClaim(),undef, 'test updating claim');
 
 is(C4::Serials::getsupplierbyserialid(),undef, 'test getting supplier idea');