From 54f34184cd376730642baa4fe9bbddeaca19a4f3 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 --- 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 | 163 ++++++++---------- .../admin/preferences/staff_interface.pref | 6 - 6 files changed, 93 insertions(+), 117 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 9a1306cf05..e20efb3b49 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -460,25 +460,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 59fc38ed46..eff90ab0de 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -732,7 +732,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 10a3cf0614..d4a8bc904a 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,23 +51,21 @@ Show filters - [% IF (StaffDetailItemSelection) %] - | Select all - | Clear all - - | Actions: - [% IF CAN_user_tools_items_batchdel %] - Delete selected items - [% END %] - [% IF CAN_user_tools_items_batchmod %] - Modify selected items - [% END %] - [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] - Add/move to item group - Remove from item group - [% END %] - - [% END %] + Select all + Clear all + + | Actions: + [% IF CAN_user_tools_items_batchdel %] + Delete selected items + [% END %] + [% IF CAN_user_tools_items_batchmod %] + Modify selected items + [% 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 %] @@ -78,73 +76,71 @@
Cover image