Bugzilla – Attachment 188701 Details for
Bug 17387
Add an undelete feature for items/biblios
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17387: add restore records permission as child of cataloguing perms
Bug-17387-add-restore-records-permission-as-child-.patch (text/plain), 4.62 KB, created by
Jacob O'Mara
on 2025-10-30 17:39:53 UTC
(
hide
)
Description:
Bug 17387: add restore records permission as child of cataloguing perms
Filename:
MIME Type:
Creator:
Jacob O'Mara
Created:
2025-10-30 17:39:53 UTC
Size:
4.62 KB
patch
obsolete
>From 78721596c6b4713544d1c8c440873f94c6e4ed45 Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <Jacob.omara@openfifth.co.uk> >Date: Thu, 30 Oct 2025 13:16:51 +0000 >Subject: [PATCH] Bug 17387: add restore records permission as child of > cataloguing perms > >--- > api/v1/swagger/paths/deleted_biblios.yaml | 2 +- > api/v1/swagger/paths/deleted_items.yaml | 2 +- > .../bug_17387-item_biblio-undelete.pl | 21 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/permissions.inc | 3 +++ > tools/restore-records.pl | 2 +- > 6 files changed, 28 insertions(+), 3 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_17387-item_biblio-undelete.pl > >diff --git a/api/v1/swagger/paths/deleted_biblios.yaml b/api/v1/swagger/paths/deleted_biblios.yaml >index f86913c8f53..a8943165a17 100644 >--- a/api/v1/swagger/paths/deleted_biblios.yaml >+++ b/api/v1/swagger/paths/deleted_biblios.yaml >@@ -171,4 +171,4 @@ > $ref: "../swagger.yaml#/definitions/error" > x-koha-authorization: > permissions: >- editcatalogue: edit_catalogue >+ editcatalogue: restore_records >diff --git a/api/v1/swagger/paths/deleted_items.yaml b/api/v1/swagger/paths/deleted_items.yaml >index 6b108b5a4c0..7bcde9dee1a 100644 >--- a/api/v1/swagger/paths/deleted_items.yaml >+++ b/api/v1/swagger/paths/deleted_items.yaml >@@ -164,4 +164,4 @@ > $ref: "../swagger.yaml#/definitions/error" > x-koha-authorization: > permissions: >- editcatalogue: edit_catalogue >+ editcatalogue: restore_records >diff --git a/installer/data/mysql/atomicupdate/bug_17387-item_biblio-undelete.pl b/installer/data/mysql/atomicupdate/bug_17387-item_biblio-undelete.pl >new file mode 100755 >index 00000000000..42275adc3a2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17387-item_biblio-undelete.pl >@@ -0,0 +1,21 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "17387", >+ description => "Add restore_records permission", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO permissions (module_bit, code, description) >+ VALUES (9, 'restore_records', 'Restore deleted records') >+ } >+ ); >+ >+ say_success( $out, "Added new permission 'editcatalogue:restore_records'" ); >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 509cfd79f38..f0934bb4b33 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -67,6 +67,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > ( 9, 'edit_any_item', 'Edit any item regardless of home library'), > ( 9, 'edit_locked_records', 'Edit locked records'), > ( 9, 'set_record_sources', 'Set record source'), >+ ( 9, 'restore_records', 'Restore deleted records'), > (10, 'payout', 'Perform account payout action'), > (10, 'refund', 'Perform account refund action'), > (10, 'discount', 'Perform account discount action'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 8cb47687a64..a698ca013c9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -266,6 +266,9 @@ > [%- CASE 'set_record_sources' -%] > <span class="sub_permission set_record_sources_subpermission"> Set record source </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'restore_records' -%] >+ <span class="sub_permission restore_records_subpermission"> Restore deleted records </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'advanced_editor' -%] > <span class="sub_permission advanced_editor_subpermission"> Use the advanced cataloging editor (requires edit_catalogue) </span> > <span class="permissioncode">([% name | html %])</span> >diff --git a/tools/restore-records.pl b/tools/restore-records.pl >index b3133f2cf18..56d83fec3e4 100755 >--- a/tools/restore-records.pl >+++ b/tools/restore-records.pl >@@ -29,7 +29,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > template_name => "tools/restore-records.tt", > query => $input, > type => "intranet", >- flagsrequired => { editcatalogue => 'edit_catalogue' }, >+ flagsrequired => { editcatalogue => 'restore_records' }, > } > ); > >-- >2.39.5
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 17387
:
188670
|
188671
|
188672
|
188673
|
188674
|
188675
|
188676
|
188677
|
188678
|
188679
|
188680
|
188681
|
188682
|
188683
|
188684
|
188685
|
188686
|
188687
|
188688
|
188689
|
188690
|
188691
|
188692
|
188693
|
188694
|
188695
|
188696
|
188697
|
188698
|
188699
|
188700
|
188701
|
188780
|
188781
|
188782
|
188783
|
188784
|
188785
|
188786
|
188787
|
188788
|
188789
|
188790
|
188791
|
188792
|
188793
|
188794
|
188795
|
189046
|
189047
|
189048
|
189049
|
189050
|
189051
|
189052
|
189053
|
189054
|
189055
|
189056
|
189057
|
189058
|
189059
|
189060
|
189061
|
189062
|
189082
|
189083
|
189084
|
189085
|
189086
|
189087
|
189088
|
189089
|
189090
|
189091
|
189092
|
189093
|
189094
|
189095
|
189096
|
189097
|
189098
|
189099
|
189100
|
189101
|
189102
|
189103
|
189104
|
189105
|
189106
|
189107
|
189108
|
189109
|
189110
|
189111
|
189112
|
189113
|
189114
|
189115
|
189116
|
189117
|
189118
|
189119