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

(-)a/installer/data/mysql/atomicupdate/bug-31521.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "31521",
5
    description => "Add sysprefs SCOCheckinIfReservedBehaviour and SCOCheckinIfReservedMessage",
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`)
12
            VALUES ('SCOCheckinIfReservedMessage','', NULL,'Message to display if SCOCheckinIfReservedBehaviour is "Alert" or "Forbid"','Free')
13
        });
14
15
        $dbh->do(q{
16
            INSERT IGNORE INTO systempreferences (`variable`, `value`,`options`,`explanation`, `type`)
17
            VALUES ('SCOCheckinIfReservedBehaviour', 'Allow', 'Allow|Alert|Forbid', 'Behaviour of SCO checkin when the returned item is reserved', 'Choice')
18
        });
19
    },
20
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 615-620 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
615
('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'),
615
('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'),
616
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
616
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
617
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
617
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
618
('SCOCheckinIfReservedMessage','', NULL,'Message to display if SCOCheckinIfReservedBehaviour is "Alert" or "Forbid"','Free'),
619
('SCOCheckinIfReservedBehaviour', 'Allow', 'Allow|Alert|Forbid', 'Behaviour of SCO checkin when the returned item is reserved', 'Choice'),
618
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
620
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
619
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
621
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
620
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
622
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 1163-1168 Circulation: Link Here
1163
              type: textarea
1163
              type: textarea
1164
              syntax: css
1164
              syntax: css
1165
              class: code
1165
              class: code
1166
        -
1167
            - "Message displayed when there are holds during a self checkin"
1168
            - pref: SCOCheckinIfReservedMessage
1169
              type: textarea
1170
        -
1171
            - "Behavior for the self checkin when there are holds on the returned item"
1172
            - pref: SCOCheckinIfReservedBehaviour
1173
              choices:
1174
                  Alert: Allow checkin & show message
1175
                  Allow: Allow checkin
1176
                  Forbid: Forbid checkin & show message
1177
            - "</br>The message shown can be configured in system preference SCOCheckinIfReservedMessage"
1166
        -
1178
        -
1167
            - pref: ShowPatronImageInWebBasedSelfCheck
1179
            - pref: ShowPatronImageInWebBasedSelfCheck
1168
              choices:
1180
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (+10 lines)
Lines 214-224 Link Here
214
                        <div class="alert alert-info">
214
                        <div class="alert alert-info">
215
                            <p>Item not checked in: please see circulation staff for assistance</p>
215
                            <p>Item not checked in: please see circulation staff for assistance</p>
216
                        </div>
216
                        </div>
217
                        [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Forbid' %]
218
                            <div class="alert alert-warning">
219
                                [% Koha.Preference('SCOCheckinIfReservedMessage') | html %]
220
                            </div>
221
                        [% END %]
217
                    [% ELSIF ( returned == 1 ) %]
222
                    [% ELSIF ( returned == 1 ) %]
218
                        <span class="sco-alert-success return"></span>
223
                        <span class="sco-alert-success return"></span>
219
                        <div class="alert alert-info">
224
                        <div class="alert alert-info">
220
                            <p>Item checked in</p>
225
                            <p>Item checked in</p>
221
                        </div>
226
                        </div>
227
                        [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Alert' %]
228
                            <div class="alert alert-warning">
229
                                [% Koha.Preference('SCOCheckinIfReservedMessage') | html %]
230
                            </div>
231
                        [% END %]
222
                    [% END %]
232
                    [% END %]
223
233
224
234
(-)a/opac/sco/sco-main.pl (-1 / +5 lines)
Lines 158-163 if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { Link Here
158
          unless $patron->checkouts->find( { itemnumber => $item->itemnumber } );
158
          unless $patron->checkouts->find( { itemnumber => $item->itemnumber } );
159
    }
159
    }
160
160
161
    if ($success && C4::Context->preference('SCOCheckinIfReservedBehaviour') eq 'Forbid') {
162
        my $holds_count = Koha::Holds->search({ itemnumber => $item->itemnumber });
163
        $success = 0 if $holds_count > 0;
164
    }
165
161
    if ( $success ) {
166
    if ( $success ) {
162
        ($success) = AddReturn( $barcode, $branch )
167
        ($success) = AddReturn( $barcode, $branch )
163
    }
168
    }
164
- 

Return to bug 31521