From 5b9bcb5a67e252af99df5b5dc5bb9633e17f2e41 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Wed, 10 Jul 2024 17:03:04 +0000 Subject: [PATCH] Bug 20411: Remove StaffDetailItemSelection system preference This patch removes the 'StaffDetailItemSelection' along with any usages of it. Now, the checkboxes on an item details page are always there. To test: 1) Apply patch, restart_all, updatedatabase 2) In sys prefs, search for 'StaffDetailItemSelection', nothing should show up. 3) Visit an items details page, make sure there are checkboxes next each item that allow you to perform modification/deletion. Signed-off-by: Eric Garcia Signed-off-by: Heather Hernandez Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer --- C4/UsageStats.pm | 1 - catalogue/detail.pl | 19 -- .../data/mysql/atomicupdate/bug_20411.pl | 20 ++ installer/data/mysql/mandatory/sysprefs.sql | 1 - .../tables/items/catalogue_detail.inc | 172 ++++++++---------- .../admin/preferences/staff_interface.pref | 6 - 6 files changed, 97 insertions(+), 122 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_20411.pl diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index fe3b092da2..7a5e952c8f 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -358,7 +358,6 @@ sub _shared_preferences { yuipath HidePatronName intranetbookbag - StaffDetailItemSelection viewISBD viewLabeledMARC viewMARC diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 343146937e..7af8010343 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -497,25 +497,6 @@ my $illrequests = : []; $template->param( illrequests => $illrequests ); -my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection'); -if ($StaffDetailItemSelection) { - # Only enable item selection if user can execute at least one action - if ( - $flags->{superlibrarian} - || ( - ref $flags->{tools} eq 'HASH' && ( - $flags->{tools}->{items_batchmod} # Modify selected items - || $flags->{tools}->{items_batchdel} # Delete selected items - ) - ) - || ( ref $flags->{tools} eq '' && $flags->{tools} ) - ) - { - $template->param( - StaffDetailItemSelection => $StaffDetailItemSelection ); - } -} - # get biblionumbers stored in the cart my @cart_list; diff --git a/installer/data/mysql/atomicupdate/bug_20411.pl b/installer/data/mysql/atomicupdate/bug_20411.pl new file mode 100755 index 0000000000..7590d2d99c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20411.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "20411", + description => "Remove StaffDetailItemSelection system preference", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do( + q{ + DELETE FROM systempreferences WHERE variable='StaffDetailItemSelection' + } + ); + + say $out "Removed system preference 'StaffDetailItemSelection'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 2a4002a852..7ebb5b5699 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -738,7 +738,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SpineLabelFormat','','30|10','This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example .','Textarea'), ('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print label\" link will appear for each item on the bib details page in the staff interface.','YesNo'), ('staffClientBaseURL','',NULL,'Specify the base URL of the staff interface starting with http:// or https://. Do not include a trailing slash in the URL. (This must be filled in correctly for CAS, svc, and load_testing to work.)','free'), -('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'), ('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'), ('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'), ('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 295d976d7d..02b6edfa0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -9,7 +9,7 @@ [% BLOCK build_table %] - [% IF (StaffDetailItemSelection) %][% END %] + [% IF Koha.Preference('LocalCoverImages') %] [% END %] @@ -51,36 +51,34 @@ - [% IF (StaffDetailItemSelection) %] - - - - | Actions: - [% IF CAN_user_tools_items_batchdel %] -
- [% INCLUDE 'csrf-token.inc' %] - - - - - - - [% END %] - [% IF CAN_user_tools_items_batchmod %] -
- [% INCLUDE 'csrf-token.inc' %] - - - - - - [% END %] - [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] - Add/move to item group - Remove from item group - [% END %] -
- [% END %] + + + + | Actions: + [% IF CAN_user_tools_items_batchdel %] +
+ [% INCLUDE 'csrf-token.inc' %] + + + + + + + [% END %] + [% IF CAN_user_tools_items_batchmod %] +
+ [% INCLUDE 'csrf-token.inc' %] + + + + + + [% END %] + [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] + Add/move to item group + Remove from item group + [% END %] +
[% PROCESS build_table tab => tab %] @@ -91,67 +89,64 @@
Cover image