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 419-421 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
419
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
419
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
420
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
420
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo')
421
;
421
;
422
423
installer/data/mysql/sysprefs.sql
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +25 lines)
Lines 7130-7141 if ( CheckVersion($DBversion) ) { Link Here
7130
    SetVersion($DBversion);
7130
    SetVersion($DBversion);
7131
}
7131
}
7132
7132
7133
7134
$DBversion = "3.13.00.020";
7133
$DBversion = "3.13.00.020";
7135
if ( CheckVersion($DBversion) ) {
7134
if ( CheckVersion($DBversion) ) {
7136
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
7135
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
7137
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
7136
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
7138
    print "Upgrade to $DBversion done (Bug 7639: system preferences to forgive fines on lost items)\n";
7137
    print "Upgrade to $DBversion done (Bug 7639: system preferences to forgive fines on lost items)\n";
7138
    SetVersion($DBversion);
7139
}
7140
7141
$DBversion = "3.13.00.XXX";
7142
if ( CheckVersion($DBversion) ) {
7143
7144
    #get current value
7145
    my $sth = $dbh->prepare("SELECT * from systempreferences where variable = 'AllowSelfCheckReturns'");
7146
    $sth->execute;
7147
    my $row = $sth->fetchrow_hashref;
7148
    my $val = $row->{value};
7149
    my $newval;
7150
7151
    if ($val =~ /1/ ) {
7152
        $newval =  'nonblocked';
7153
    } else {
7154
        $newval =  'none';
7155
    }
7156
7157
    # update syspref
7158
    my $sth_update = $dbh->prepare("UPDATE systempreferences
7159
     SET value=?, options='all|nonblocked|none', type='Choice' WHERE variable='AllowSelfCheckReturns'");
7160
    $sth_update->execute($newval);
7161
7162
    print "Upgrade to $DBversion done (added 'nonblocked' to AllowSelfCheckReturns syspref)\n";
7139
    SetVersion ($DBversion);
7163
    SetVersion ($DBversion);
7140
}
7164
}
7141
7165
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +3 lines)
Lines 556-563 Circulation: Link Here
556
        -
556
        -
557
            - pref: AllowSelfCheckReturns
557
            - pref: AllowSelfCheckReturns
558
              choices:
558
              choices:
559
                  yes: Allow
559
                  all: "Allow all"
560
                  no: "Don't allow"
560
                  nonblocked: "Allow non-blocked"
561
                  none: "Don't allow"
561
            - patrons to return items through web-based self checkout system. 
562
            - patrons to return items through web-based self checkout system. 
562
        -
563
        -
563
            - "Include the following HTML in the Help page of the web-based self checkout system:"
564
            - "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