Bugzilla – Attachment 170310 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), 18.35 KB, created by
Jonathan Druart
on 2024-08-14 09:21:15 UTC
(
hide
)
Description:
Bug 20411: Remove StaffDetailItemSelection system preference
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-08-14 09:21:15 UTC
Size:
18.35 KB
patch
obsolete
>From 745dbf108bca8ce9e2f7e8e3211aba08adefd2c3 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> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 fe3b092da29..7a5e952c8ff 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 dd0802c0252..7f6ed6ef071 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 00000000000..7590d2d99c9 >--- /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 1a7cd033e90..5e68f8fc398 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 7c6d1d3fc55..c6bcac119b3 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,36 +51,34 @@ > <button class="btn btn-link show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</button> > <button class="btn btn-link hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</button> > </span> >- [% IF (StaffDetailItemSelection) %] >- <button class="btn btn-link SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</button> >- <button class="btn btn-link ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</button> >- <span class="itemselection_actions"> >- | Actions: >- [% IF CAN_user_tools_items_batchdel %] >- <form class="itemselection_action_delete_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input name='src' type='hidden' value='CATALOGUING' /> >- <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" /> >- <input name='op' type='hidden' value='cud-show' /> >- <input name='del' type='hidden' value='1' /> >- <button type="submit" class="itemselection_action_delete btn btn-link" /><i class="fa fa-trash-can"></i> Delete selected items</button> >- </form> >- [% END %] >- [% IF CAN_user_tools_items_batchmod %] >- <form class="itemselection_action_modify_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl"> >- [% INCLUDE 'csrf-token.inc' %] >- <input name='src' type='hidden' value='CATALOGUING' /> >- <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" /> >- <input name='op' type='hidden' value='cud-show' /> >- <button type="submit" class="itemselection_action_modify btn btn-link" /><i class="fa-solid fa-pencil"></i> Modify selected items</button> >- </form> >- [% 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 %] >+ <button class="btn btn-link SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</button> >+ <button class="btn btn-link ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</button> >+ <span class="itemselection_actions"> >+ | Actions: >+ [% IF CAN_user_tools_items_batchdel %] >+ <form class="itemselection_action_delete_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input name='src' type='hidden' value='CATALOGUING' /> >+ <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" /> >+ <input name='op' type='hidden' value='cud-show' /> >+ <input name='del' type='hidden' value='1' /> >+ <button type="submit" class="itemselection_action_delete btn btn-link" /><i class="fa fa-trash-can"></i> Delete selected items</button> >+ </form> >+ [% END %] >+ [% IF CAN_user_tools_items_batchmod %] >+ <form class="itemselection_action_modify_form" method="post" action="/cgi-bin/koha/tools/batchMod.pl"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input name='src' type='hidden' value='CATALOGUING' /> >+ <input name='biblionumber' type='hidden' value="[% biblionumber | html %]" /> >+ <input name='op' type='hidden' value='cud-show' /> >+ <button type="submit" class="itemselection_action_modify btn btn-link" /><i class="fa-solid fa-pencil"></i> Modify selected items</button> >+ </form> >+ [% 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 %] >@@ -91,67 +89,64 @@ > <script> > > let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %]; >- [% IF StaffDetailItemSelection %] > >- let items_selection = {}; >+ let items_selection = {}; > >- function _itemSelectionBuildLink(tab_id, link_class) { >+ function _itemSelectionBuildLink(tab_id, link_class) { > >- let itemnumbers = items_selection[tab_id]; >- let tab = $("#" + tab_id + "_panel" ); >- let form = tab.find(link_class); >- $(form).find("input[name='itemnumber']").remove(); >+ let itemnumbers = items_selection[tab_id]; >+ let tab = $("#" + tab_id + "_panel" ); >+ let form = tab.find(link_class); >+ $(form).find("input[name='itemnumber']").remove(); > >- $(itemnumbers).each(function() { >- $(form).append("<input name='itemnumber' type='hidden' value='%s'/>".format(this)); >- }); >- return !!itemnumbers.length >- } >- function itemSelectionBuildDeleteLink(tab_id) { >- return _itemSelectionBuildLink(tab_id, '.itemselection_action_delete_form'); >- } >- function itemSelectionBuildModifyLink(tab_id) { >- return _itemSelectionBuildLink(tab_id, '.itemselection_action_modify_form'); >- } >+ $(itemnumbers).each(function() { >+ $(form).append("<input name='itemnumber' type='hidden' value='%s'/>".format(this)); >+ }); >+ return !!itemnumbers.length >+ } >+ function itemSelectionBuildDeleteLink(tab_id) { >+ return _itemSelectionBuildLink(tab_id, '.itemselection_action_delete_form'); >+ } >+ function itemSelectionBuildModifyLink(tab_id) { >+ return _itemSelectionBuildLink(tab_id, '.itemselection_action_modify_form'); >+ } > >- 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 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(); > } >+ } > >- $(document).ready(function() { >- >- $(".SelectAll").on("click",function(e){ >- e.preventDefault(); >- let tab_id = $(this).data("tab"); >- let tab = $("#" + tab_id + "_panel" ); >- items_selection[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); >- }); >+ $(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 + "_panel" ); >+ items_selection[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 + "_panel" ); >+ items_selection[tab_id] = []; >+ $("input[name='itemnumber'][type='checkbox']", tab).prop('checked', false); >+ itemSelectionBuildActionLinks(tab_id); > }); >- [% END %] > >+ }); > > $(document).ready(function() { > $(".show_filters").on("click",function(e){ >@@ -162,9 +157,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){ >@@ -175,9 +168,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); > }); > }); > >@@ -278,15 +269,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, >@@ -300,7 +288,6 @@ > autoWidth: false, > bKohaColumnsUseNames: true, > columns: [ >- [% IF (StaffDetailItemSelection) %] > { > data: "me.item_id", > searchable: false, >@@ -317,7 +304,6 @@ > } > } > }, >- [% END %] > [% IF Koha.Preference('LocalCoverImages') %] > { > data: "", >@@ -797,11 +783,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( >@@ -841,7 +824,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 97f0298614c..c8f3f5e1e7a 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.34.1
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