Bugzilla – Attachment 165048 Details for
Bug 31791
Add the ability to lock records to prevent modification through the Koha staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31791: Limit editing locked records
Bug-31791-Limit-editing-locked-records.patch (text/plain), 2.89 KB, created by
Arthur Suzuki
on 2024-04-18 08:06:33 UTC
(
hide
)
Description:
Bug 31791: Limit editing locked records
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2024-04-18 08:06:33 UTC
Size:
2.89 KB
patch
obsolete
>From 5045c189863ab046e285d7cc74910252ab717722 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 7 Feb 2024 11:06:32 -0300 >Subject: [PATCH] Bug 31791: Limit editing locked records > >Sponsored-by: ByWater Solutions >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> >--- > cataloguing/addbiblio.pl | 23 +++++++++++++++-------- > 1 file changed, 15 insertions(+), 8 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index a340c6ebbfd..ca12f84d769 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -537,13 +537,22 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $logged_in_patron = Koha::Patrons->find($loggedinuser); > my $biblio; >-if ($biblionumber){ >+ >+if ($biblionumber) { >+ > $biblio = Koha::Biblios->find($biblionumber); >- unless ( $biblio ) { >+ >+ unless ($biblio) { > $biblionumber = undef; > $template->param( bib_doesnt_exist => 1 ); > } >+ >+ unless ( $biblio->can_be_edited($logged_in_patron) ) { >+ print $input->redirect("/cgi-bin/koha/errors/403.pl"); # escape early >+ exit; >+ } > } > > if ($frameworkcode eq 'FA'){ >@@ -645,15 +654,14 @@ if ($biblionumber) { > $sth->execute($biblionumber); > ($biblioitemnumber) = $sth->fetchrow; > if (C4::Context->preference('MARCOverlayRules')) { >- my $member = Koha::Patrons->find($loggedinuser); > $record = ApplyMarcOverlayRules( > { > biblionumber => $biblionumber, > record => $record, > overlay_context => { > source => $z3950 ? 'z3950' : 'intranet', >- categorycode => $member->categorycode, >- userid => $member->userid >+ categorycode => $logged_in_patron->categorycode, >+ userid => $logged_in_patron->userid, > } > } > ); >@@ -679,7 +687,6 @@ if ( $op eq "cud-addbiblio" ) { > if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { > my $oldbibitemnum; > if ( $is_a_modif ) { >- my $member = Koha::Patrons->find($loggedinuser); > ModBiblio( > $record, > $biblionumber, >@@ -687,8 +694,8 @@ if ( $op eq "cud-addbiblio" ) { > { > overlay_context => { > source => $z3950 ? 'z3950' : 'intranet', >- categorycode => $member->categorycode, >- userid => $member->userid >+ categorycode => $logged_in_patron->categorycode, >+ userid => $logged_in_patron->userid, > } > } > ); >-- >2.30.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 31791
:
163371
|
163372
|
163373
|
163374
|
163375
|
163376
|
163377
|
163378
|
163405
|
163408
|
163410
|
163411
|
163413
|
163414
|
163415
|
163416
|
163426
|
163427
|
163428
|
163429
|
163430
|
163431
|
163432
|
163433
|
163434
|
163531
|
163532
|
163533
|
163534
|
163535
|
163536
|
163537
|
163538
|
163539
|
163545
|
164193
|
164194
|
164195
|
164196
|
164197
|
164696
|
164697
|
164698
|
164699
|
164700
|
164701
|
164702
|
164703
|
164704
|
164705
|
165044
|
165045
|
165046
|
165047
| 165048 |
165049
|
165050
|
165051
|
165052
|
165053
|
165697