Bugzilla – Attachment 123068 Details for
Bug 28743
With IndependentBranches block changes to biblio records shared with other libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed fix
0001-Bug-28743-block-changes-to-biblio-records-shared-wit.patch (text/plain), 4.24 KB, created by
Michael Hafen
on 2021-07-22 23:08:45 UTC
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Michael Hafen
Created:
2021-07-22 23:08:45 UTC
Size:
4.24 KB
patch
obsolete
>From 47ec435782c45f6d9f761afe94d58db7e9f250ba Mon Sep 17 00:00:00 2001 >From: Michael Hafen <michael.hafen@washk12.org> >Date: Thu, 22 Jul 2021 17:06:34 -0600 >Subject: [PATCH] Bug 28743 - block changes to biblio records shared with other > libraries >Content-Type: text/plain; charset="utf-8" > >With IndependentBranches block changes to biblio records shared with other >libraries. >Also removes the 'Replace record via z39.50'... button. >--- > cataloguing/addbiblio.pl | 14 +++++++++++++- > .../prog/en/modules/cataloguing/addbiblio.tt | 14 ++++++++++++++ > 2 files changed, 27 insertions(+), 1 deletion(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 138fceab44..ca831a0c2e 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -742,12 +742,21 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $block_mod = 0; > if ($biblionumber){ > my $does_bib_exist = Koha::Biblios->find($biblionumber); > if (!defined $does_bib_exist){ > $biblionumber = undef; > $template->param( bib_doesnt_exist => 1 ); > } >+ else { >+ if ( C4::Context->only_my_library() ) { >+ my $items_rs = $does_bib_exist->items->search({ "homebranch" => { '!=' => C4::Context->userenv->{branch} } }); >+ if ( $items_if->count ) { >+ $block_mod = 1; >+ } >+ } >+ } > } > > if ($frameworkcode eq 'FA'){ >@@ -838,6 +847,9 @@ if ($biblionumber) { > my $sth = $dbh->prepare("select biblioitemnumber from biblioitems where biblionumber=?"); > $sth->execute($biblionumber); > ($biblioitemnumber) = $sth->fetchrow; >+ >+ # notify the template if we are blocking modifs >+ $template->param( block_mod => $block_mod ); > } > > #------------------------------------------------------------------------------------- >@@ -859,7 +871,7 @@ if ( $op eq "addbiblio" ) { > if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { > my $oldbibitemnum; > if ( $is_a_modif ) { >- ModBiblio( $record, $biblionumber, $frameworkcode ); >+ ModBiblio( $record, $biblionumber, $frameworkcode ) unless ($block_mod); > } > else { > ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 00c6767d1a..f971f83b36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -769,6 +769,18 @@ function PopupMARCFieldDoc(field) { > </form> > </div> <!-- /.dialog.alert --> > [% END # /IF duplicatebiblionumber %] >+ >+ [% IF ( block_mod ) %] >+ <div class="dialog alert"> >+ <h3>Shared record</h3> >+ <p>This record is shared with other libraries. You will not be able to save any changes to this record.</p> >+ <form action="/cgi-bin/koha/catalogue/detail.pl" method="get"> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <input type="submit" value="Back to record details" /> >+ </form> >+ </div> <!-- /.dialog.alert --> >+ [% END # /IF block_mod %] >+ > [% END # /UNLESS number %] > > [% IF ( done ) %] >@@ -810,7 +822,9 @@ function PopupMARCFieldDoc(field) { > > [% UNLESS (circborrowernumber) %][%# Hide in fast cataloging %] > [% IF biblionumber %] >+ [% UNLESS block_mod %] > <div class="btn-group"><a class="btn btn-default" href="#" id="z3950search"><i class="fa fa-search"></i> Replace record via Z39.50/SRU search</a></div> >+ [% END %] > [% ELSE %] > <div class="btn-group"><a class="btn btn-default" href="#" id="z3950search"><i class="fa fa-search"></i> Z39.50/SRU search</a></div> > [% END %] >-- >2.25.1 >
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 28743
:
123068
|
123463