Bugzilla – Attachment 165805 Details for
Bug 15461
Add staff equivalent for OpacLocationOnDetail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15461: Add StaffLocationOnDetail system preference
Bug-15461-Add-StaffLocationOnDetail-system-prefere.patch (text/plain), 10.47 KB, created by
Lucas Gass (lukeg)
on 2024-04-29 20:18:42 UTC
(
hide
)
Description:
Bug 15461: Add StaffLocationOnDetail system preference
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-04-29 20:18:42 UTC
Size:
10.47 KB
patch
obsolete
>From bfd3be6c4c4e03918f1c6d353ccfff19a9e8c0b7 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 8 Mar 2024 21:04:53 +0000 >Subject: [PATCH] Bug 15461: Add StaffLocationOnDetail system preference > >To test; >1. APPLY patch, updatedatabase, restart services >2. Search for the new system preference 'StaffLocationOnDetail' >3. Read the description and make sure it makes sense. Check that the 'Table settings' link works. >4. By default it should be set to 'below the home library'. >5. Check to make sure that is where it displays. >6. Try 'below the holding library' and 'below both home and holding libraries', making sure each works properly. >7. Try 'on a sperate column', in which case you need to make sure that 'holdings_shelvinglocation' is properly checked under Administration > Table settings >8. Play with other Table settings to make sure they all work as they should. > >Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org> >--- > admin/columns_settings.yml | 4 ++ > .../data/mysql/atomicupdate/bug_15461.pl | 18 +++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../tables/items/catalogue_detail.inc | 51 ++++++++++++++----- > .../admin/preferences/staff_interface.pref | 9 ++++ > 5 files changed, 71 insertions(+), 12 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_15461.pl > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 3aa182a6b9..551921ee90 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -384,6 +384,8 @@ modules: > columnname: holdings_holdingbranch > - > columnname: holdings_homebranch >+ - >+ columnname: holdings_shelvinglocation > - > columnname: holdings_ccode > - >@@ -450,6 +452,8 @@ modules: > columnname: otherholdings_holdingbranch > - > columnname: otherholdings_homebranch >+ - >+ columnname: otherholdings_shelvinglocation > - > columnname: otherholdings_ccode > - >diff --git a/installer/data/mysql/atomicupdate/bug_15461.pl b/installer/data/mysql/atomicupdate/bug_15461.pl >new file mode 100755 >index 0000000000..d7ed32ee0c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15461.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "15461", >+ description => "Add system preference StaffLocationOnDetail", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) >+ VALUES ('StaffLocationOnDetail','home','holding|home|both|column','In the staff interface, display the shelving location on its own column or under a library columns.','Choice') >+ }); >+ >+ say $out "Added new system preference 'StaffLocationOnDetail'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 4c372bad78..9d985c3dc1 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -730,6 +730,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('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'), >+('StaffLocationOnDetail','home','holding|home|both|column','In the staff interface detail, display the shelving location on its own column or under a library columns.', 'Choice'), > ('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'), > ('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), > ('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'), >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 3c08fe3ec7..88c2e010b0 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 >@@ -16,6 +16,9 @@ > [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %] > <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th> > <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th> >+ [% IF Koha.Preference('StaffLocationOnDetail') == 'column' %] >+ <th id="[% tab | html %]_shelvingloction" data-colname="[% tab | html %]_shelvinglocation">Shelving location</th> >+ [% END %] > <th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th> > [% IF Koha.Preference('EnableItemGroups') %] > <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th> >@@ -363,7 +366,22 @@ > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return escape_str(row._strings.holding_library_id.str); >+ let nodes = '<span class="holdingbranchdesc">%s</span>'.format(escape_str(row._strings.holding_library_id.str)); >+ [% IF ( Koha.Preference('StaffLocationOnDetail') == 'home' || Koha.Preference('StaffLocationOnDetail') == 'both' ) %] >+ nodes += '<span class="shelvingloc">' >+ [%# If permanent location is defined, show description or code and %] >+ [%# display current location in parentheses. If not, display current location. %] >+ [%# Note that permanent location is a code, and location may be an authval. %] >+ let loc_str = row._strings.location.str; >+ if ( row.permanent_location && row.permanent_location != row.location ) { >+ let permanent_loc_str = av_loc.get(row.permanent_location); >+ nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str)); >+ } else { >+ nodes += escape_str(loc_str); >+ } >+ [% END %] >+ nodes += '</span>'; >+ return nodes; > } > }, > { >@@ -373,21 +391,30 @@ > orderable: true, > render: function (data, type, row, meta) { > let nodes = '<span class="homebranchdesc">%s</span>'.format(escape_str(row._strings.home_library_id.str)); >- nodes += '<span class="shelvingloc">' >- [%# If permanent location is defined, show description or code and %] >- [%# display current location in parentheses. If not, display current location. %] >- [%# Note that permanent location is a code, and location may be an authval. %] >- let loc_str = row._strings.location.str; >- if ( row.permanent_location && row.permanent_location != row.location ) { >- let permanent_loc_str = av_loc.get(row.permanent_location); >- nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str)); >- } else { >- nodes += escape_str(loc_str); >- } >+ [% IF ( Koha.Preference('StaffLocationOnDetail') == 'home' || Koha.Preference('StaffLocationOnDetail') == 'both' ) %] >+ nodes += '<span class="shelvingloc">' >+ let loc_str = row._strings.location.str; >+ if ( row.permanent_location && row.permanent_location != row.location ) { >+ let permanent_loc_str = av_loc.get(row.permanent_location); >+ nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str)); >+ } else { >+ nodes += escape_str(loc_str); >+ } >+ [% END %] > nodes += '</span>'; > return nodes; > } > }, >+ [% IF Koha.Preference('StaffLocationOnDetail') == 'column' %] >+ { >+ data: "me.location", >+ searchable: true, >+ orderable: true, >+ render: function (data, type, row, meta) { >+ return escape_str(row._strings.collection_code.str); >+ } >+ }, >+ [% END %] > { > data: "me.collection_code", > searchable: true, >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 62dca5a673..526956641d 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 >@@ -125,6 +125,15 @@ Staff interface: > type: textarea > syntax: text/html > class: code >+ - >+ - 'Display the shelving location ' >+ - pref: StaffLocationOnDetail >+ choices: >+ home: "below the home library" >+ holding: "below the holding library" >+ both: "below both home and holding libraries" >+ column: "on a separate column" >+ - 'for items on the staff interface record details page. <br/> Note: If on a separate column is selected, you still need to enable holdings_shelving location on the <a href="/cgi-bin/koha/admin/columns_settings.pl">Table settings</a> adminstration page.' > - > - pref: StaffHighlightedWords > type: boolean >-- >2.30.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 15461
:
162980
|
162981
|
162982
|
162987
|
162990
|
162991
|
162992
|
162993
|
165804
|
165805
|
165806
|
170238
|
170268
|
170269
|
170270
|
174011
|
174012
|
174013