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

(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 29-35 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
29
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
29
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
30
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
30
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
31
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
31
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
32
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
32
('AllowSelfCheckReturns','none','If enabled, patrons may return items through the Web-based Self Checkout','all|nonblocked|none','Choice');
33
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
33
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
34
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
34
('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z',NULL,'Alphabet than can be expanded into browse links, e.g. on Home > Patrons','free'),
35
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
35
('AlternateHoldingsField','',NULL,'The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).','free'),
Lines 445-447 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
445
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
445
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
446
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
446
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
447
;
447
;
448
449
installer/data/mysql/sysprefs.sql
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 8551-8556 if (CheckVersion($DBversion)) { Link Here
8551
    SetVersion($DBversion);
8551
    SetVersion($DBversion);
8552
}
8552
}
8553
8553
8554
$DBversion = "3.15.00.XXX";
8555
if ( CheckVersion($DBversion) ) {
8556
8557
    #get current value
8558
    my $sth = $dbh->prepare("SELECT * from systempreferences where variable = 'AllowSelfCheckReturns'");
8559
    $sth->execute;
8560
    my $row = $sth->fetchrow_hashref;
8561
    my $val = $row->{value};
8562
    my $newval;
8563
8564
    if ($val =~ /1/ ) {
8565
        $newval =  'nonblocked';
8566
    } else {
8567
        $newval =  'none';
8568
    }
8569
8570
    # update syspref
8571
    my $sth_update = $dbh->prepare("UPDATE systempreferences
8572
     SET value=?, options='all|nonblocked|none', type='Choice' WHERE variable='AllowSelfCheckReturns'");
8573
    $sth_update->execute($newval);
8574
8575
    print "Upgrade to $DBversion done (added 'nonblocked' to AllowSelfCheckReturns syspref)\n";
8576
    SetVersion ($DBversion);
8577
}
8578
8554
=head1 FUNCTIONS
8579
=head1 FUNCTIONS
8555
8580
8556
=head2 TableExists($table)
8581
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 593-600 Circulation: Link Here
593
        -
593
        -
594
            - pref: AllowSelfCheckReturns
594
            - pref: AllowSelfCheckReturns
595
              choices:
595
              choices:
596
                  yes: Allow
596
                  all: "Allow all"
597
                  no: "Don't allow"
597
                  nonblocked: "Allow non-blocked"
598
                  none: "Don't allow"
598
            - patrons to return items through web-based self checkout system. 
599
            - patrons to return items through web-based self checkout system. 
599
        -
600
        -
600
            - "Include the following HTML in the Help page of the web-based self checkout system:"
601
            - "Include the following HTML in the Help page of the web-based self checkout system:"
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt (-4 / +2 lines)
Lines 153-160 $(document).ready(function() { Link Here
153
   [% END %]
153
   [% END %]
154
   Please see a member of the library staff.
154
   Please see a member of the library staff.
155
</p>
155
</p>
156
[% IF ( returnitem ) %]
156
[% IF  (AllowSelfCheckReturns == 'nonblocked' and returnitem ) or AllowSelfCheckReturns  == 'all' %]
157
[% IF ( AllowSelfCheckReturns ) %]
158
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
157
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
159
    <input type="hidden" name="op" value="returnbook" />
158
    <input type="hidden" name="op" value="returnbook" />
160
    <input type="hidden" name="patronid" value="[% patronid %]" />
159
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 162-168 $(document).ready(function() { Link Here
162
    <input type="submit" name="returnbook" value="Return this item" class="return" />
161
    <input type="submit" name="returnbook" value="Return this item" class="return" />
163
</form>
162
</form>
164
[% END %]
163
[% END %]
165
[% END %]
166
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
164
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
167
    <input type="hidden" name="op" value="" />
165
    <input type="hidden" name="op" value="" />
168
    <input type="hidden" name="patronid" value="[% patronid %]" />
166
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 175-181 $(document).ready(function() { Link Here
175
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
173
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
176
174
177
[% IF ( renew ) %]
175
[% IF ( renew ) %]
178
[% IF ( AllowSelfCheckReturns ) %]
176
[% IF  (AllowSelfCheckReturns == 'nonblocked' or AllowSelfCheckReturns  == 'all') %]
179
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
177
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
180
        <input type="hidden" name="op" value="returnbook" />
178
        <input type="hidden" name="op" value="returnbook" />
181
        <input type="hidden" name="patronid" value="[% patronid %]" />
179
        <input type="hidden" name="patronid" value="[% patronid %]" />
(-)a/opac/sco/sco-main.pl (-3 / +3 lines)
Lines 83-89 if (C4::Context->preference('SelfCheckTimeout')) { Link Here
83
$template->param(SelfCheckTimeout => $selfchecktimeout);
83
$template->param(SelfCheckTimeout => $selfchecktimeout);
84
84
85
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
85
# Checks policy laid out by AllowSelfCheckReturns, defaults to 'on' if preference is undefined
86
my $allowselfcheckreturns = 1;
86
my $allowselfcheckreturns = 'nonblocked';
87
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
87
if (defined C4::Context->preference('AllowSelfCheckReturns')) {
88
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
88
    $allowselfcheckreturns = C4::Context->preference('AllowSelfCheckReturns');
89
}
89
}
Lines 124-130 my $return_only = 0; Link Here
124
if ($op eq "logout") {
124
if ($op eq "logout") {
125
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
125
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
126
}
126
}
127
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
127
elsif ( $op eq "returnbook" && $allowselfcheckreturns =~ /nonblocked|all/) {
128
    my ($doreturn) = AddReturn( $barcode, $branch );
128
    my ($doreturn) = AddReturn( $barcode, $branch );
129
    #warn "returnbook: " . $doreturn;
129
    #warn "returnbook: " . $doreturn;
130
    $borrower = GetMemberDetails(undef,$patronid);
130
    $borrower = GetMemberDetails(undef,$patronid);
Lines 156-161 elsif ( $op eq "checkout" ) { Link Here
156
            "circ_error_$issue_error" => 1,
156
            "circ_error_$issue_error" => 1,
157
            title                     => $item->{title},
157
            title                     => $item->{title},
158
            hide_main                 => 1,
158
            hide_main                 => 1,
159
            barcode                   => $barcode,
159
        );
160
        );
160
        if ($issue_error eq 'DEBT') {
161
        if ($issue_error eq 'DEBT') {
161
            $template->param(amount => $currencySymbol.$impossible->{DEBT});
162
            $template->param(amount => $currencySymbol.$impossible->{DEBT});
162
- 

Return to bug 10554