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

(-)a/installer/data/mysql/sysprefs.sql (-1 / +3 lines)
Lines 22-28 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
22
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
22
('AllowPurchaseSuggestionBranchChoice','0','1','Allow user to choose branch when making a purchase suggestion','YesNo'),
23
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
23
('AllowRenewalLimitOverride','0',NULL,'if ON, allows renewal limits to be overridden on the circulation screen','YesNo'),
24
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
24
('AllowReturnToBranch','anywhere','anywhere|homebranch|holdingbranch|homeorholdingbranch','Where an item may be returned','Choice'),
25
('AllowSelfCheckReturns','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
25
('AllowSelfCheckReturns','none','If enabled, patrons may return items through the Web-based Self Checkout','all|nonblocked|none','Choice');
26
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
26
('AllowTooManyOverride','1','','If on, allow staff to override and check out items when the patron has reached the maximum number of allowed checkouts','YesNo'),
27
('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'),
27
('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'),
28
('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'),
28
('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 417-419 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
417
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
417
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
418
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
418
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
419
;
419
;
420
421
installer/data/mysql/sysprefs.sql
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 7104-7109 if ( CheckVersion($DBversion) ) { Link Here
7104
    SetVersion($DBversion);
7104
    SetVersion($DBversion);
7105
}
7105
}
7106
7106
7107
$DBversion = "3.13.00.XXX";
7108
if ( CheckVersion($DBversion) ) {
7109
7110
    #get current value
7111
    my $sth = $dbh->prepare("SELECT * from systempreferences where variable = 'AllowSelfCheckReturns'");
7112
    $sth->execute;
7113
    my $row = $sth->fetchrow_hashref;
7114
    my $val = $row->{value};
7115
    my $newval;
7116
7117
    if ($val =~ /1/ ) {
7118
        $newval =  'nonblocked';
7119
    } else {
7120
        $newval =  'none';
7121
    }
7122
7123
    # update syspref
7124
    my $sth_update = $dbh->prepare("UPDATE systempreferences
7125
     SET value=?, options='all|nonblocked|none', type='Choice' WHERE variable='AllowSelfCheckReturns'");
7126
    $sth_update->execute($newval);
7127
7128
    print "Upgrade to $DBversion done (added 'nonblocked' to AllowSelfCheckReturns syspref)\n";
7129
    SetVersion ($DBversion);
7130
}
7131
7107
=head1 FUNCTIONS
7132
=head1 FUNCTIONS
7108
7133
7109
=head2 TableExists($table)
7134
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 544-551 Circulation: Link Here
544
        -
544
        -
545
            - pref: AllowSelfCheckReturns
545
            - pref: AllowSelfCheckReturns
546
              choices:
546
              choices:
547
                  yes: Allow
547
                  all: "Allow all"
548
                  no: "Don't allow"
548
                  nonblocked: "Allow non-blocked"
549
                  none: "Don't allow"
549
            - patrons to return items through web-based self checkout system. 
550
            - patrons to return items through web-based self checkout system. 
550
        -
551
        -
551
            - "Include the following HTML in the Help page of the web-based self checkout system:"
552
            - "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 140-147 $(document).ready(function() { Link Here
140
   [% END %]
140
   [% END %]
141
   Please see a member of the library staff.
141
   Please see a member of the library staff.
142
</p>
142
</p>
143
[% IF ( returnitem ) %]
143
[% IF  (AllowSelfCheckReturns == 'nonblocked' and returnitem ) or AllowSelfCheckReturns  == 'all' %]
144
[% IF ( AllowSelfCheckReturns ) %]
145
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
144
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
146
    <input type="hidden" name="op" value="returnbook" />
145
    <input type="hidden" name="op" value="returnbook" />
147
    <input type="hidden" name="patronid" value="[% patronid %]" />
146
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 149-155 $(document).ready(function() { Link Here
149
    <input type="submit" name="returnbook" value="Return this item" class="return" />
148
    <input type="submit" name="returnbook" value="Return this item" class="return" />
150
</form>
149
</form>
151
[% END %]
150
[% END %]
152
[% END %]
153
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
151
<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
154
    <input type="hidden" name="op" value="" />
152
    <input type="hidden" name="op" value="" />
155
    <input type="hidden" name="patronid" value="[% patronid %]" />
153
    <input type="hidden" name="patronid" value="[% patronid %]" />
Lines 162-168 $(document).ready(function() { Link Here
162
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
160
<p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
163
161
164
[% IF ( renew ) %]
162
[% IF ( renew ) %]
165
[% IF ( AllowSelfCheckReturns ) %]
163
[% IF  (AllowSelfCheckReturns == 'nonblocked' or AllowSelfCheckReturns  == 'all') %]
166
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
164
    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
167
        <input type="hidden" name="op" value="returnbook" />
165
        <input type="hidden" name="op" value="returnbook" />
168
        <input type="hidden" name="patronid" value="[% patronid %]" />
166
        <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