@@ -, +, @@ --- 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 --- a/admin/columns_settings.yml +++ a/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 - --- a/installer/data/mysql/atomicupdate/bug_15461.pl +++ a/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'"; + }, +}; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/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'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -16,6 +16,9 @@ [% IF ( item_level_itypes ) %]Item type[% END %] Current library Home library + [% IF Koha.Preference('StaffLocationOnDetail') == 'column' %] + Shelving location + [% END %] Collection [% IF Koha.Preference('EnableItemGroups') %] Item group @@ -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 = '%s'.format(escape_str(row._strings.holding_library_id.str)); + [% IF ( Koha.Preference('StaffLocationOnDetail') == 'home' || Koha.Preference('StaffLocationOnDetail') == 'both' ) %] + nodes += '' + [%# 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 += ''; + return nodes; } }, { @@ -373,21 +391,30 @@ orderable: true, render: function (data, type, row, meta) { let nodes = '%s'.format(escape_str(row._strings.home_library_id.str)); - nodes += '' - [%# 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 += '' + 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 += ''; 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, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref +++ a/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.
Note: If on a separate column is selected, you still need to enable holdings_shelving location on the Table settings adminstration page.' - - pref: StaffHighlightedWords type: boolean --