diff -rc koha-2.2.5-orig/intranet-cgi/acqui.simple/addbiblio.pl koha-2.2.5-patch/intranet-cgi/acqui.simple/addbiblio.pl *** koha-2.2.5-orig/intranet-cgi/acqui.simple/addbiblio.pl 2006-01-13 14:24:18.000000000 -0700 --- koha-2.2.5-patch/intranet-cgi/acqui.simple/addbiblio.pl 2006-05-23 16:19:52.000000000 -0600 *************** *** 445,450 **** --- 447,457 ---- } else { ($bibid,$oldbibnum,$oldbibitemnum) = NEWnewbiblio($dbh,$record,$frameworkcode); } + + if ($breedingid) { # came from breeding table. delete! + my $sth = $dbh->prepare("DELETE FROM marc_breeding WHERE id=?"); + $sth->execute($breedingid); + } # now, redirect to additem page print $input->redirect("additem.pl?bibid=$bibid&frameworkcode=$frameworkcode"); exit; *************** *** 525,530 **** --- 532,538 ---- $template->param( frameworkcode => $frameworkcode, itemtype => $frameworkcode, # HINT: if the library has itemtype = framework, itemtype is auto filled ! + breedingid => $breedingid, hide_marc => C4::Context->preference('hide_marc'), ); output_html_with_http_headers $input, $cookie, $template->output; Only in koha-2.2.5-patch/intranet-cgi/export: deletebreeding.pl # File Follows ... export/deletebreeding.pl #!/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 2 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., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA use strict; use CGI; use C4::Auth; use C4::Interface::CGI::Output; use C4::Breeding; use C4::Context; my $dbh = C4::Context->dbh; my $input = new CGI; my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => "export/deletebreeding.tmpl", query => $input, type => "intranet", authnotrequired => 0, flagsrequired => {editcatalogue => 1}, debug => 1, }); # remove records my $op = $input->param('op'); if ($op eq 'Delete') { my @params=$input->param(); my $count=0; my $sth = $dbh->prepare("DELETE FROM marc_breeding WHERE id=?"); foreach (@params) { my $breedingid = $1 if ($_ =~ /d_(\d+)/); if ($breedingid) { $sth->execute($breedingid); $count++; } } $template->param( deleted => $count, ); } # fill with books in breeding farm my $toggle=0; my $sth = $dbh->prepare("SELECT * FROM marc_breeding ORDER BY title, file"); $sth->execute; my @resultsbr = @{ $sth->fetchall_arrayref({}) }; my @breeding_loop = (); for ( my $i = 0 ; $i <= $#resultsbr ; $i++ ) { my %row_data; $toggle = ! $toggle; $row_data{toggle} = $toggle; $row_data{id} = $resultsbr[$i]->{'id'}; $row_data{isbn} = $resultsbr[$i]->{'isbn'}; $row_data{file} = $resultsbr[$i]->{'file'}; $row_data{title} = $resultsbr[$i]->{'title'}; $row_data{author} = $resultsbr[$i]->{'author'}; push ( @breeding_loop, \%row_data ); } $template->param( breeding_loop => \@breeding_loop, ); output_html_with_http_headers $input, $cookie, $template->output; File Follows ... intranet-tmpl/npl-ish/en/export/deletebreeding.tmpl <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Koha -- Cataloging: Reservoir Management<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> <!-- TMPL_INCLUDE NAME="masthead.inc" --> <!-- TMPL_INCLUDE NAME="intranet-nav.inc" --> <div id="main"> <h1>MARC acquisition system</h1> <h4>Delete from the reservoir</h4> <!-- TMPL_IF NAME="deleted" --> <p>Results :</p> <ul> <li><!-- TMPL_VAR NAME="deleted" --> records deleted</li> </ul> <!-- /TMPL_IF --> <!-- TMPL_IF name="breeding_loop" --> <p> <form action="deletebreeding.pl" method="post"> <table> <caption>Information about MARC records in the reservoir</caption> <tr><th>Title</th><th>Author</th><th>ISBN</th><th>Coming From</th><th> </th></tr> <!-- TMPL_LOOP name="breeding_loop" --> <tr<!-- TMPL_IF NAME="toggle" --> class="highlight"<!-- /TMPL_IF -->> <td><!-- TMPL_VAR name="title" --></td> <td><!-- TMPL_VAR name="author" --></td> <td><!-- TMPL_VAR name="isbn" --></td> <td><!-- TMPL_VAR name="file" --></td> <td><input type="checkbox" name="d_<!-- TMPL_VAR NAME="id" -->" value="y" /></td> </tr> <!-- /TMPL_LOOP --> </table> <input type="hidden" name="op" value="Delete"/> <input type="submit" name="button" class="submit" value="Delete Checked"/> </form> </p> <!-- TMPL_ELSE --> <p> There are no records in the Reservoir </p> <!-- /TMPL_IF --> </div> <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->