View | Details | Raw Unified | Return to bug 15461
Collapse All | Expand All

(-)a/admin/columns_settings.yml (+4 lines)
Lines 423-428 modules: Link Here
423
              columnname: holdings_holdingbranch
423
              columnname: holdings_holdingbranch
424
            -
424
            -
425
              columnname: holdings_homebranch
425
              columnname: holdings_homebranch
426
            -
427
              columnname: holdings_shelvinglocation
426
            -
428
            -
427
              columnname: holdings_ccode
429
              columnname: holdings_ccode
428
            -
430
            -
Lines 490-495 modules: Link Here
490
              columnname: otherholdings_holdingbranch
492
              columnname: otherholdings_holdingbranch
491
            -
493
            -
492
              columnname: otherholdings_homebranch
494
              columnname: otherholdings_homebranch
495
            -
496
              columnname: otherholdings_shelvinglocation
493
            -
497
            -
494
              columnname: otherholdings_ccode
498
              columnname: otherholdings_ccode
495
            -
499
            -
(-)a/installer/data/mysql/atomicupdate/bug_15461.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "15461",
5
    description => "Add system preference StaffLocationOnDetail",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(q{
12
            INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`)
13
            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')
14
        });
15
16
        say $out "Added new system preference 'StaffLocationOnDetail'";
17
    },
18
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 751-756 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
751
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
751
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
752
('StaffInterfaceLanguages','en',NULL,'Set the default language in the staff interface.','Languages'),
752
('StaffInterfaceLanguages','en',NULL,'Set the default language in the staff interface.','Languages'),
753
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
753
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
754
('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'),
754
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
755
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
755
('StaffLoginLibraryBasedOnIP', '1','', 'Set the logged in library for the user based on their current IP','YesNo'),
756
('StaffLoginLibraryBasedOnIP', '1','', 'Set the logged in library for the user based on their current IP','YesNo'),
756
('StaffLoginRestrictLibraryByIP','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses based on branch','YesNo'),
757
('StaffLoginRestrictLibraryByIP','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses based on branch','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-13 / +40 lines)
Lines 16-21 Link Here
16
            [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
16
            [% IF ( item_level_itypes ) %]<th id="[% tab | html %]_itype" data-colname="[% tab | html %]_itype">Item type</th>[% END %]
17
            <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
17
            <th id="[% tab | html %]_holdingbranch" data-colname="[% tab | html %]_holdingbranch">Current library</th>
18
            <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
18
            <th id="[% tab | html %]_homebranch" data-colname="[% tab | html %]_homebranch">Home library</th>
19
            [% IF Koha.Preference('StaffLocationOnDetail') == 'column' %]
20
                 <th id="[% tab | html %]_shelvingloction" data-colname="[% tab | html %]_shelvinglocation">Shelving location</th>
21
            [% END %]
19
            <th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>
22
            <th id="[% tab | html %]_ccode" data-colname="[% tab | html %]_ccode">Collection</th>
20
            [% IF Koha.Preference('EnableItemGroups') %]
23
            [% IF Koha.Preference('EnableItemGroups') %]
21
                <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
24
                <th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
Lines 377-383 Link Here
377
                searchable: true,
380
                searchable: true,
378
                orderable: true,
381
                orderable: true,
379
                render: function (data, type, row, meta) {
382
                render: function (data, type, row, meta) {
380
                    return escape_str(row._strings.holding_library_id ? row._strings.holding_library_id.str : row.holding_library_id);
383
                    let nodes = '<span class="holdingbranchdesc">%s</span>'.format(escape_str(row._strings.holding_library_id.str));
384
                    [% IF ( Koha.Preference('StaffLocationOnDetail') == 'home' || Koha.Preference('StaffLocationOnDetail') == 'both' ) %]
385
                        nodes += '<span class="shelvingloc">'
386
                        [%# If permanent location is defined, show description or code and             %]
387
                        [%# display current location in parentheses. If not, display current location. %]
388
                        [%# Note that permanent location is a code, and location may be an authval.    %]
389
                        let loc_str = row._strings.location.str;
390
                        if ( row.permanent_location && row.permanent_location != row.location ) {
391
                            let permanent_loc_str = av_loc.get(row.permanent_location);
392
                            nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str));
393
                        } else {
394
                            nodes += escape_str(loc_str);
395
                        }
396
                    [% END %]
397
                    nodes += '</span>';
398
                    return nodes;
381
                }
399
                }
382
            },
400
            },
383
            {
401
            {
Lines 386-407 Link Here
386
                searchable: true,
404
                searchable: true,
387
                orderable: true,
405
                orderable: true,
388
                render: function (data, type, row, meta) {
406
                render: function (data, type, row, meta) {
389
                    let nodes = '<span class="homebranchdesc">%s</span>'.format(escape_str(row._strings.home_library_id ? row._strings.home_library_id.str : row.home_library_id));
407
                    let nodes = '<span class="homebranchdesc">%s</span>'.format(escape_str(row._strings.home_library_id.str));
390
                    nodes += '<span class="shelvingloc">'
408
                    [% IF ( Koha.Preference('StaffLocationOnDetail') == 'home' || Koha.Preference('StaffLocationOnDetail') == 'both' ) %]
391
                    [%# If permanent location is defined, show description or code and             %]
409
                        nodes += '<span class="shelvingloc">'
392
                    [%# display current location in parentheses. If not, display current location. %]
410
                        let loc_str = row._strings.location.str;
393
                    [%# Note that permanent location is a code, and location may be an authval.    %]
411
                        if ( row.permanent_location && row.permanent_location != row.location ) {
394
                    let loc_str = row._strings.location ? row._strings.location.str : row.location;
412
                            let permanent_loc_str = av_loc.get(row.permanent_location);
395
                    if ( row.permanent_location && row.permanent_location != row.location ) {
413
                            nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str));
396
                        let permanent_loc_str = av_loc.get(row.permanent_location);
414
                        } else {
397
                        nodes += '%s (%s)'.format(escape_str(permanent_loc_str), escape_str(loc_str));
415
                            nodes += escape_str(loc_str);
398
                    } else {
416
                        }
399
                        nodes += escape_str(loc_str);
417
                        [% END %]
400
                    }
401
                    nodes += '</span>';
418
                    nodes += '</span>';
402
                    return nodes;
419
                    return nodes;
403
                }
420
                }
404
            },
421
            },
422
            [% IF Koha.Preference('StaffLocationOnDetail') == 'column' %]
423
            {
424
                data: "me.location",
425
                searchable: true,
426
                orderable: true,
427
                render: function (data, type, row, meta) {
428
                    return escape_str(row._strings.collection_code.str);
429
                }
430
            },
431
            [% END %]
405
            {
432
            {
406
                data: "me.collection_code",
433
                data: "me.collection_code",
407
                searchable: true,
434
                searchable: true,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-1 / +9 lines)
Lines 124-129 Staff interface: Link Here
124
              type: textarea
124
              type: textarea
125
              syntax: text/html
125
              syntax: text/html
126
              class: code
126
              class: code
127
        -
128
            - 'Display the shelving location '
129
            - pref: StaffLocationOnDetail
130
              choices:
131
                  home: "below the home library"
132
                  holding: "below the holding library"
133
                  both: "below both home and holding libraries"
134
                  column: "on a separate column"
135
            - '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.'
127
        -
136
        -
128
            - pref: StaffHighlightedWords
137
            - pref: StaffHighlightedWords
129
              type: boolean
138
              type: boolean
130
- 

Return to bug 15461