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

(-)a/installer/data/mysql/atomicupdate/bug_21246.pl (+16 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(q{
11
            INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
12
            ('showLastPatronCount', '10', NULL, 'How many patrons should showLastPatron remember', 'Integer')
13
        });
14
        say $out "Added new system preference 'showLastPatronCount'";
15
    },
16
};
(-)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 patron 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 174-181 $(document).ready(function() { Link Here
174
            };
174
            };
175
175
176
            previous_patrons.unshift( previous_patron );
176
            previous_patrons.unshift( previous_patron );
177
            // Limit to last 10 patrons
177
            // Limit to number of patrons specified in showLastPatronCount
178
            if ( previous_patrons.length > 10 ) previous_patrons.pop();
178
            if ( previous_patrons.length > showLastPatronCount ) previous_patrons.pop();
179
            localStorage.setItem("previousPatrons", JSON.stringify(previous_patrons));
179
            localStorage.setItem("previousPatrons", JSON.stringify(previous_patrons));
180
        }
180
        }
181
181
182
- 

Return to bug 21246