Bugzilla – Attachment 168859 Details for
Bug 20411
Remove StaffDetailItemSelection system preference and make the feature always on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20411: Remove StaffDetailItemSelection system preference
Bug-20411-Remove-StaffDetailItemSelection-system-p.patch (text/plain), 16.65 KB, created by
ByWater Sandboxes
on 2024-07-11 17:58:55 UTC
(
hide
)
Description:
Bug 20411: Remove StaffDetailItemSelection system preference
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2024-07-11 17:58:55 UTC
Size:
16.65 KB
patch
obsolete
>From fe234f9d1f3133df250f64df2d12f5aaea5e7273 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >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 <cubingguy714@gmail.com> >Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov> >--- > 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 94acbe3e1c..773f37da5d 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -736,7 +736,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SpineLabelFormat','<itemcallnumber><copynumber>','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 <itemcallnumber>.','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 18a2c36630..d6d69e2afe 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 %] > <table class="items_table" id="[% tab | html %]_table"> > <thead> >- [% IF (StaffDetailItemSelection) %]<th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th>[% END %] >+ <th id="[% tab | html %]_checkbox" data-colname="[% tab | html %]_checkbox" class="NoSort"></th> > [% IF Koha.Preference('LocalCoverImages') %] > <th id="[% tab | html %]_cover_image" data-colname="[% tab | html %]_cover_image">Cover image</th> > [% END %] >@@ -51,23 +51,21 @@ > <a href="#" class="show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</a> > <a href="#" class="hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</a> > </span> >- [% IF (StaffDetailItemSelection) %] >- | <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> >- | <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a> >- <span class="itemselection_actions"> >- | Actions: >- [% IF CAN_user_tools_items_batchdel %] >- <a class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a> >- [% END %] >- [% IF CAN_user_tools_items_batchmod %] >- <a class="itemselection_action_modify"><i class="fa-solid fa-pencil"></i> Modify selected items</a> >- [% END %] >- [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] >- <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a> >- <a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a> >- [% END %] >- </span> >- [% END %] >+ <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a> >+ <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a> >+ <span class="itemselection_actions"> >+ | Actions: >+ [% IF CAN_user_tools_items_batchdel %] >+ <a class="itemselection_action_delete"><i class="fa fa-trash-can"></i> Delete selected items</a> >+ [% END %] >+ [% IF CAN_user_tools_items_batchmod %] >+ <a class="itemselection_action_modify"><i class="fa-solid fa-pencil"></i> Modify selected items</a> >+ [% END %] >+ [% IF CAN_user_editcatalogue_manage_item_groups && biblio.item_groups.count %] >+ <a class="itemselection_action_item_group_set" href="#"><i class="fa fa-book"></i> Add/move to item group</a> >+ <a class="itemselection_action_item_group_unset" href="#"><i class="fa fa-unlink"></i> Remove from item group</a> >+ [% END %] >+ </span> > </div> > > [% PROCESS build_table tab => tab %] >@@ -78,73 +76,71 @@ > <script> > > let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %]; >- [% IF StaffDetailItemSelection %] >- >- let items_selection = {}; >- function itemSelectionBuildDeleteLink(tab_id) { >- var itemnumbers = items_selection[tab_id]; >- if (itemnumbers.length > 0) { >- var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1'; >- url += '&itemnumber=' + itemnumbers.join('&itemnumber='); >- url += '&biblionumber=[% biblionumber | uri %]'; >- url += '&src=CATALOGUING'; >- $('a.itemselection_action_delete').attr('href', url); >- } else { >- return false; >- } >- return true >- } > >- function itemSelectionBuildModifyLink(tab_id) { >- var itemnumbers = items_selection[tab_id]; >- if (itemnumbers.length > 0) { >- var url = '/cgi-bin/koha/tools/batchMod.pl?op=show'; >- url += '&itemnumber=' + itemnumbers.join('&itemnumber='); >- url += '&biblionumber=[% biblionumber | uri %]'; >- url += '&src=CATALOGUING'; >- $('a.itemselection_action_modify').attr('href', url); >- } else { >- return false; >- } >- return true; >+ let items_selection = {}; >+ function itemSelectionBuildDeleteLink(tab_id) { >+ var itemnumbers = items_selection[tab_id]; >+ if (itemnumbers.length > 0) { >+ var url = '/cgi-bin/koha/tools/batchMod.pl?op=show&del=1'; >+ url += '&itemnumber=' + itemnumbers.join('&itemnumber='); >+ url += '&biblionumber=[% biblionumber | uri %]'; >+ url += '&src=CATALOGUING'; >+ $('a.itemselection_action_delete').attr('href', url); >+ } else { >+ return false; > } >+ return true >+ } > >- function itemSelectionBuildActionLinks(tab_id) { >- var delete_link_ok = itemSelectionBuildDeleteLink(tab_id); >- var modify_link_ok = itemSelectionBuildModifyLink(tab_id); >- var tab = $("#" + tab_id + "_panel" ); >- if (modify_link_ok || delete_link_ok) { >- $('.itemselection_actions', tab).show(); >- } else { >- $('.itemselection_actions', tab).hide(); >- } >+ function itemSelectionBuildModifyLink(tab_id) { >+ var itemnumbers = items_selection[tab_id]; >+ if (itemnumbers.length > 0) { >+ var url = '/cgi-bin/koha/tools/batchMod.pl?op=show'; >+ url += '&itemnumber=' + itemnumbers.join('&itemnumber='); >+ url += '&biblionumber=[% biblionumber | uri %]'; >+ url += '&src=CATALOGUING'; >+ $('a.itemselection_action_modify').attr('href', url); >+ } else { >+ return false; > } >+ return true; >+ } > >- $(document).ready(function() { >+ function itemSelectionBuildActionLinks(tab_id) { >+ var delete_link_ok = itemSelectionBuildDeleteLink(tab_id); >+ var modify_link_ok = itemSelectionBuildModifyLink(tab_id); >+ var tab = $("#" + tab_id); >+ if (modify_link_ok || delete_link_ok) { >+ $('.itemselection_actions', tab).show(); >+ } else { >+ $('.itemselection_actions', tab).hide(); >+ } >+ } > >- $(".SelectAll").on("click",function(e){ >- e.preventDefault(); >- let tab_id = $(this).data("tab"); >- let tab = $("#" + tab_id + "_panel" ); >- tab.find("input[name='itemnumber'][type='checkbox']").each( (i, input) => { >- let itemnumber = parseInt($(input).val()); >- items_selection[tab_id].push(itemnumber); >- $(input).prop('checked', true); >- }); >- itemSelectionBuildActionLinks(tab_id); >- }); >+ $(document).ready(function() { > >- $(".ClearAll").on("click",function(e){ >- e.preventDefault(); >- let tab_id = $(this).data("tab"); >- let tab = $("#" + tab_id + "_panel" ); >- items_selection[tab_id] = []; >- $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false); >- itemSelectionBuildActionLinks(tab_id); >+ $(".SelectAll").on("click",function(e){ >+ e.preventDefault(); >+ let tab_id = $(this).data("tab"); >+ let tab = $("#"+tab_id); >+ tab.find("input[name='itemnumber'][type='checkbox']").each( (i, input) => { >+ let itemnumber = parseInt($(input).val()); >+ items_selection[tab_id].push(itemnumber); >+ $(input).prop('checked', true); > }); >+ itemSelectionBuildActionLinks(tab_id); >+ }); > >+ $(".ClearAll").on("click",function(e){ >+ e.preventDefault(); >+ let tab_id = $(this).data("tab"); >+ let tab = $("#"+tab_id); >+ items_selection[tab_id] = []; >+ $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false); >+ itemSelectionBuildActionLinks(tab_id); > }); >- [% END %] >+ >+ }); > > > $(document).ready(function() { >@@ -156,9 +152,7 @@ > tab.find(".hide_filters").show(); > $("#"+tab_id+"_table thead tr:eq(1)").remove(); > build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); >- [% IF StaffDetailItemSelection %] >- itemSelectionBuildActionLinks(tab_id); >- [% END %] >+ itemSelectionBuildActionLinks(tab_id); > }); > > $(".hide_filters").on("click",function(e){ >@@ -169,9 +163,7 @@ > tab.find(".show_filters").show(); > $("#"+tab_id+"_table thead tr:eq(1)").remove(); > build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback ); >- [% IF StaffDetailItemSelection %] >- itemSelectionBuildActionLinks(tab_id); >- [% END %] >+ itemSelectionBuildActionLinks(tab_id); > }); > }); > >@@ -272,15 +264,12 @@ > [% IF hidden_count %] > default_filters.lost_status = "0"; > [% END %] >- [% IF StaffDetailItemSelection %] > if ( !items_selection.hasOwnProperty(tab_id) ){ > items_selection[tab_id] = []; > } >- [% END %] > > let offset = 2; > [% UNLESS Koha.Preference('LocalCoverImages') %]offset--;[% END %] >- [% UNLESS Koha.Preference('StaffDetailItemSelection') %]offset--;[% END %] > let filters_options = { > [offset] : () => all_item_types, > [offset+1] : () => all_libraries, >@@ -294,7 +283,6 @@ > autoWidth: false, > bKohaColumnsUseNames: true, > columns: [ >- [% IF (StaffDetailItemSelection) %] > { > data: "me.item_id", > searchable: false, >@@ -311,7 +299,6 @@ > } > } > }, >- [% END %] > [% IF Koha.Preference('LocalCoverImages') %] > { > data: "", >@@ -791,11 +778,8 @@ > table.columns(i).visible(false); > } > }); >- [% IF StaffDetailItemSelection %] > itemSelectionBuildActionLinks(tab_id); >- [% END %] > }, >- [% IF StaffDetailItemSelection %] > drawCallback: function(settings){ > var api = new $.fn.dataTable.Api(settings) > $.each( >@@ -835,7 +819,6 @@ > > if ( drawcallback ) { drawcallback(this); } > }, >- [% END %] > ...dt_options, > }, > items_table_settings[tab_id], >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >index 97f0298614..c8f3f5e1e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >@@ -166,12 +166,6 @@ Staff interface: > 1: Show > 0: "Don't show" > - the cart option in the staff interface. >- - >- - pref: StaffDetailItemSelection >- choices: >- 1: Enable >- 0: Disable >- - item selection in record detail page. > - > - pref: UseWYSIWYGinSystemPreferences > choices: >-- >2.39.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 20411
:
168755
|
168761
|
168831
|
168835
|
168859
|
170310
|
170311