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 684-689 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
684
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
684
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
685
('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'),
685
('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'),
686
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
686
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
687
('SCOCheckinIfReservedMessage','', NULL,'Message to display if SCOCheckinIfReservedBehaviour is "Alert" or "Forbid"','Free'),
688
('SCOCheckinIfReservedBehaviour', 'Allow', 'Allow|Alert|Forbid', 'Behaviour of SCO checkin when the returned item is reserved', 'Choice'),
687
('SCOBatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch while logged into Self Checkout','Free'),
689
('SCOBatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch while logged into Self Checkout','Free'),
688
('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'),
690
('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'),
689
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
691
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +14 lines)
Lines 521-527 Circulation: Link Here
521
            - pref: ItemsDeniedRenewal
521
            - pref: ItemsDeniedRenewal
522
              type: textarea
522
              type: textarea
523
              syntax: text/x-yaml
523
              syntax: text/x-yaml
524
              class: code
524
              aslass: code
525
            - Define custom rules to deny specific items from renewal.
525
            - Define custom rules to deny specific items from renewal.
526
            - "<br />Can name any field in the items table followed by a colon then a space then"
526
            - "<br />Can name any field in the items table followed by a colon then a space then"
527
            - "a bracketed list of values separated by commas."
527
            - "a bracketed list of values separated by commas."
Lines 1212-1217 Circulation: Link Here
1212
              type: textarea
1212
              type: textarea
1213
              syntax: javascript
1213
              syntax: javascript
1214
              class: code
1214
              class: code
1215
        -
1216
            - "Message displayed when there are holds during a self checkin"
1217
            - pref: SCOCheckinIfReservedMessage
1218
              type: textarea
1219
        -
1220
            - "Behavior for the self checkin when there are holds on the returned item"
1221
            - pref: SCOCheckinIfReservedBehaviour
1222
              choices:
1223
                  Alert: Allow checkin & show message
1224
                  Allow: Allow checkin
1225
                  Forbid: Forbid checkin & show message
1226
            - "</br>The message shown can be configured in system preference SCOCheckinIfReservedMessage"
1227
1215
    Self check-out module:
1228
    Self check-out module:
1216
        -
1229
        -
1217
            - "Include the following JavaScript on all pages in the web-based self checkout:"
1230
            - "Include the following JavaScript on all pages in the web-based self checkout:"
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (+12 lines)
Lines 235-245 Link Here
235
                        <div class="alert alert-info">
235
                        <div class="alert alert-info">
236
                            <p>Item not checked in: please see circulation staff for assistance</p>
236
                            <p>Item not checked in: please see circulation staff for assistance</p>
237
                        </div>
237
                        </div>
238
                        [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Forbid' %]
239
                            <div class="alert alert-warning">
240
                                [% Koha.Preference('SCOCheckinIfReservedMessage') | html %]
241
                            </div>
242
                        [% END %]
243
238
                    [% ELSIF ( returned == 1 ) %]
244
                    [% ELSIF ( returned == 1 ) %]
239
                        <span class="sco-alert-success return"></span>
245
                        <span class="sco-alert-success return"></span>
240
                        <div class="alert alert-info">
246
                        <div class="alert alert-info">
241
                            <p>Item checked in <i>([% barcode | html %])</i></p>
247
                            <p>Item checked in <i>([% barcode | html %])</i></p>
242
                        </div>
248
                        </div>
249
                        [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Alert' %]
250
                            <div class="alert alert-warning">
251
                                [% Koha.Preference('SCOCheckinIfReservedMessage') | html %]
252
                            </div>
253
                        [% END %]
254
243
                    [% END %]
255
                    [% END %]
244
256
245
                    [% UNLESS ( hide_main ) %]
257
                    [% UNLESS ( hide_main ) %]
(-)a/opac/sco/sco-main.pl (-1 / +6 lines)
Lines 176-181 if ( $patron && $op eq "cud-returnbook" && $allowselfcheckreturns ) { Link Here
176
                unless $patron->checkouts->find( { itemnumber => $item->itemnumber } );
176
                unless $patron->checkouts->find( { itemnumber => $item->itemnumber } );
177
        }
177
        }
178
178
179
        if ($success && C4::Context->preference('SCOCheckinIfReservedBehaviour') eq 'Forbid') {
180
            my $holds_count = Koha::Holds->search({ itemnumber => $item->itemnumber });
181
            $success = 0 if $holds_count > 0;
182
        }
183
184
179
        if ($success) {
185
        if ($success) {
180
            ($success) = AddReturn( $barcode, $branch );
186
            ($success) = AddReturn( $barcode, $branch );
181
        }
187
        }
182
- 

Return to bug 31521