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

(-)a/installer/data/mysql/atomicupdate/bug_21246.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "21246",
5
    description => "A preference to specify how many previous patrons to show for showLastPatron",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
13
            ('showLastPatronCount', '10', NULL, 'How many patrons should showLastPatron remember', 'Integer')
14
        }
15
        );
16
        say $out "Added new system preference 'showLastPatronCount'";
17
    },
18
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 671-676 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
671
('MaxComponentRecords', '300', '','Max number of component records to display','Integer'),
671
('MaxComponentRecords', '300', '','Max number of component records to display','Integer'),
672
('ShowHeadingUse', '0', NULL, 'Show whether authority record contains an established heading that conforms to descriptive cataloguing rules, and can therefore be used as a main/added entry, or subject, or series title', 'YesNo'),
672
('ShowHeadingUse', '0', NULL, 'Show whether authority record contains an established heading that conforms to descriptive cataloguing rules, and can therefore be used as a main/added entry, or subject, or series title', 'YesNo'),
673
('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo'),
673
('showLastPatron','0','','If ON, enables the last patron feature in the intranet','YesNo'),
674
('showLastPatronCount', '10', '', 'How many patrons should showLastPatron remember', 'Integer'),
674
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
675
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
675
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
676
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
676
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
677
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/last-borrower.inc (+3 lines)
Lines 1-3 Link Here
1
<script>
2
   var showLastPatronCount = "[% Koha.Preference('showLastPatronCount') | html %]";
3
</script>
1
<div id="lastborrower-window">
4
<div id="lastborrower-window">
2
    <div class="btn-group">
5
    <div class="btn-group">
3
        <a class="btn btn-default navbar-btn lastborrower" id="lastborrowerlink" href="#" title=""><i class="fa fa-arrow-right"></i> Last patron</a>
6
        <a class="btn btn-default navbar-btn lastborrower" id="lastborrowerlink" href="#" title=""><i class="fa fa-arrow-right"></i> Last patron</a>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-1 / +4 lines)
Lines 162-168 Staff interface: Link Here
162
              choices:
162
              choices:
163
                  0: "Don't show"
163
                  0: "Don't show"
164
                  1: Show
164
                  1: Show
165
            - a link to the last searched patron in the staff interface.
165
            - a link to the last
166
            - pref: showLastPatronCount
167
              class: integer
168
            - searched patrons in the staff interface.
166
        -
169
        -
167
            - pref: intranetbookbag
170
            - pref: intranetbookbag
168
              choices:
171
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-3 / +2 lines)
Lines 177-184 $(document).ready(function() { Link Here
177
            };
177
            };
178
178
179
            previous_patrons.unshift( previous_patron );
179
            previous_patrons.unshift( previous_patron );
180
            // Limit to last 10 patrons
180
            // Limit to number of patrons specified in showLastPatronCount
181
            if ( previous_patrons.length > 10 ) previous_patrons.pop();
181
            if ( previous_patrons.length > showLastPatronCount ) previous_patrons.pop();
182
            localStorage.setItem("previousPatrons", JSON.stringify(previous_patrons));
182
            localStorage.setItem("previousPatrons", JSON.stringify(previous_patrons));
183
        }
183
        }
184
184
185
- 

Return to bug 21246