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

(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 142-148 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
142
-- LDAP ? required fields?
142
-- LDAP ? required fields?
143
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo');
143
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WebBasedSelfCheck',0,'If ON, enables the web-based self-check system',NULL,'YesNo');
144
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer');
144
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckTimeout',120,'Define the number of seconds before the Web-based Self Checkout times out a patron','','Integer');
145
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns',0,'If enabled, patrons may return items through the Web-based Self Checkout','','YesNo');
145
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowSelfCheckReturns','none','If enabled, patrons may return items through the Web-based Self Checkout','all|nonblocked|none','Choice');
146
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea');
146
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea');
147
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
147
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
148
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
148
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 7036-7041 if ( CheckVersion($DBversion) ) { Link Here
7036
    SetVersion($DBversion);
7036
    SetVersion($DBversion);
7037
}
7037
}
7038
7038
7039
$DBversion = "3.13.00.XXX";
7040
if ( CheckVersion($DBversion) ) {
7041
7042
    #get current value
7043
    my $sth = $dbh->prepare("SELECT * from systempreferences where variable = 'AllowSelfCheckReturns'");
7044
    $sth->execute;
7045
    my $row = $sth->fetchrow_hashref;
7046
    my $val = $row->{value};
7047
    my $newval;
7048
7049
    if ($val =~ /1/ ) {
7050
        $newval =  'nonblocked';
7051
    } else {
7052
        $newval =  'none';
7053
    }
7054
7055
    # update syspref
7056
    my $sth_update = $dbh->prepare("UPDATE systempreferences
7057
     SET value=?, options='all|nonblocked|none', type='Choice' WHERE variable='AllowSelfCheckReturns'");
7058
    $sth_update->execute($newval);
7059
7060
    print "Upgrade to $DBversion done (added 'nonblocked' to AllowSelfCheckReturns syspref)\n";
7061
    SetVersion ($DBversion);
7062
}
7063
7039
=head1 FUNCTIONS
7064
=head1 FUNCTIONS
7040
7065
7041
=head2 TableExists($table)
7066
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 532-539 Circulation: Link Here
532
        -
532
        -
533
            - pref: AllowSelfCheckReturns
533
            - pref: AllowSelfCheckReturns
534
              choices:
534
              choices:
535
                  yes: Allow
535
                  all: "Allow all"
536
                  no: "Don't allow"
536
                  nonblocked: "Allow non-blocked"
537
                  none: "Don't allow"
537
            - patrons to return items through web-based self checkout system. 
538
            - patrons to return items through web-based self checkout system. 
538
        -
539
        -
539
            - "Include the following HTML in the Help page of the web-based self checkout system:"
540
            - "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 149-156 $(document).ready(function(){ Link Here
149
   [% END %]
149
   [% END %]
150
   Please see a member of the library staff.
150
   Please see a member of the library staff.
151
</p>
151
</p>
152
[% IF ( returnitem ) %]
152
[% IF  (AllowSelfCheckReturns == 'nonblocked' and returnitem ) or AllowSelfCheckReturns  == 'all' %]
153
[% IF ( AllowSelfCheckReturns ) %]
154
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
153
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
155
    <input type="hidden" name="op" value="returnbook" />
154
    <input type="hidden" name="op" value="returnbook" />
156
    <input type="hidden" name="patronid" value="[% patronid %]" />
155
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 158-164 $(document).ready(function(){ Link Here
158
    <input type="submit" name="returnbook" value="Return this item" class="return" />
157
    <input type="submit" name="returnbook" value="Return this item" class="return" />
159
</form>
158
</form>
160
[% END %]
159
[% END %]
161
[% END %]
162
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
160
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
163
    <input type="hidden" name="op" value="" />
161
    <input type="hidden" name="op" value="" />
164
    <input type="hidden" name="patronid" value="[% patronid %]" />
162
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 171-177 $(document).ready(function(){ Link Here
171
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
169
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
172
170
173
[% IF ( renew ) %]
171
[% IF ( renew ) %]
174
[% IF ( AllowSelfCheckReturns ) %]
172
[% IF  (AllowSelfCheckReturns == 'nonblocked' or AllowSelfCheckReturns  == 'all') %]
175
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
173
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
176
        <input type="hidden" name="op" value="returnbook" />
174
        <input type="hidden" name="op" value="returnbook" />
177
        <input type="hidden" name="patronid" value="[% patronid %]" />
175
        <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 120-126 my $return_only = 0; Link Here
120
if ($op eq "logout") {
120
if ($op eq "logout") {
121
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
121
    $query->param( patronid => undef, patronlogin => undef, patronpw => undef );
122
}
122
}
123
elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
123
elsif ( $op eq "returnbook" && $allowselfcheckreturns =~ /nonblocked|all/) {
124
    my ($doreturn) = AddReturn( $barcode, $branch );
124
    my ($doreturn) = AddReturn( $barcode, $branch );
125
    #warn "returnbook: " . $doreturn;
125
    #warn "returnbook: " . $doreturn;
126
    $borrower = GetMemberDetails(undef,$patronid);
126
    $borrower = GetMemberDetails(undef,$patronid);
Lines 152-157 elsif ( $op eq "checkout" ) { Link Here
152
            "circ_error_$issue_error" => 1,
152
            "circ_error_$issue_error" => 1,
153
            title                     => $item->{title},
153
            title                     => $item->{title},
154
            hide_main                 => 1,
154
            hide_main                 => 1,
155
            barcode                   => $barcode,
155
        );
156
        );
156
        if ($issue_error eq 'DEBT') {
157
        if ($issue_error eq 'DEBT') {
157
            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT});
158
            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT});
158
- 

Return to bug 10554