Bugzilla – Attachment 29950 Details for
Bug 12625
Batch delete component parts when deleting the parent from detailed-view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12625 - (KD-153) Batch delete component parts when deleting the parent from detailed-view
Bug-12625---KD-153-Batch-delete-component-parts-wh.patch (text/plain), 1.79 KB, created by
Olli-Antti Kivilahti
on 2014-07-22 09:53:04 UTC
(
hide
)
Description:
Bug 12625 - (KD-153) Batch delete component parts when deleting the parent from detailed-view
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2014-07-22 09:53:04 UTC
Size:
1.79 KB
patch
obsolete
>From 5306178eae6b78d6be993ddaa58fb766bcb8201a Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Tue, 22 Jul 2014 12:48:38 +0300 >Subject: [PATCH] Bug 12625 - (KD-153) Batch delete component parts when > deleting the parent from detailed-view > >See Bug 11175 for explanation of component parts. >This feature automatically deletes all linked component parts when the component parent is deleted using > "catalogue/detail.pl -> Edit -> Delete record" > >Generalizing this to C4::Biblio::DelBiblio() is not a good idea because we don't wan't to delete all >component parts when we are for example, merging records :) >--- > cataloguing/addbiblio.pl | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 387522c..41827f8 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -966,6 +966,20 @@ elsif ( $op eq "delete" ) { > exit; > } > >+ #Check if there are component part records to delete >+ my @removalErrors; >+ foreach my $componentPartBiblionumber ( @{C4::Biblio::getComponentBiblionumbers( $record )} ) { >+ my $error = &DelBiblio($componentPartBiblionumber); >+ my $html = "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber=$componentPartBiblionumber'>$componentPartBiblionumber</a>"; >+ push(@removalErrors, $html.' : '.$error) if $error; >+ } >+ if (@removalErrors) { >+ warn "ERROR when DELETING COMPONENT PART BIBLIOS: \n" . join("\n",@removalErrors); >+ print "Content-Type: text/html\n\n<html><body><h1>ERROR when DELETING COMPONENT PART BIBLIOS:</h1>" . join("<br />",@removalErrors)."</body></html>"; >+ exit; >+ } >+ #I think we got them all! >+ > print $input->redirect('/cgi-bin/koha/catalogue/search.pl'); > exit; > >-- >1.8.1.2
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 12625
: 29950