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

(-)a/installer/data/mysql/updatedatabase.pl (-19 / +18 lines)
Lines 7130-7136 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')");
Lines 7139-7162 if ( CheckVersion($DBversion) ) { Link Here
7139
    SetVersion($DBversion);
7138
    SetVersion($DBversion);
7140
}
7139
}
7141
7140
7142
7143
$DBversion = "3.13.00.XXX";
7144
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
7145
    $dbh->do("
7146
        INSERT INTO systempreferences (variable,value,explanation,options,type)
7147
        VALUES (
7148
            'BlockExpiredPatronOpacActions',
7149
            '1',
7150
            'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis',
7151
            NULL,
7152
            'YesNo'
7153
        )
7154
    ");
7155
    $dbh->do("ALTER TABLE `categories` ADD COLUMN `BlockExpiredPatronOpacActions` TINYINT(1) DEFAULT -1 NOT NULL AFTER category_type");
7156
    print "Upgraded to $DBversion done (Bug 6739 - expired patrons not blocked from opac actions)\n";
7157
    SetVersion ($DBversion);
7158
}
7159
7160
$DBversion ="3.13.00.021";
7141
$DBversion ="3.13.00.021";
7161
if ( CheckVersion($DBversion) ) {
7142
if ( CheckVersion($DBversion) ) {
7162
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('ConfirmFutureHolds','0','Number of days for confirming future holds','','Integer');");
7143
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('ConfirmFutureHolds','0','Number of days for confirming future holds','','Integer');");
Lines 8101-8106 if ( CheckVersion($DBversion) ) { Link Here
8101
    SetVersion($DBversion);
8082
    SetVersion($DBversion);
8102
}
8083
}
8103
8084
8085
$DBversion = "3.15.00.XXX";
8086
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
8087
    $dbh->do("
8088
        INSERT INTO systempreferences (variable,value,explanation,options,type)
8089
        VALUES (
8090
            'BlockExpiredPatronOpacActions',
8091
            '1',
8092
            'Set whether an expired patron can perform opac actions such as placing holds or renew books, can be overridden on a per patron-type basis',
8093
            NULL,
8094
            'YesNo'
8095
        )
8096
    ");
8097
    $dbh->do("ALTER TABLE `categories` ADD COLUMN `BlockExpiredPatronOpacActions` TINYINT(1) DEFAULT -1 NOT NULL AFTER category_type");
8098
    print "Upgraded to $DBversion done (Bug 6739 - expired patrons not blocked from opac actions)\n";
8099
    SetVersion ($DBversion);
8100
}
8101
8102
8104
=head1 FUNCTIONS
8103
=head1 FUNCTIONS
8105
8104
8106
=head2 TableExists($table)
8105
=head2 TableExists($table)
(-)a/opac/opac-user.pl (-6 / +12 lines)
Lines 64-70 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
64
    }
64
    }
65
);
65
);
66
66
67
my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
67
my $show_priority;
68
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
69
    m/priority/ and $show_priority = 1;
70
}
71
68
my $patronupdate = $query->param('patronupdate');
72
my $patronupdate = $query->param('patronupdate');
69
my $canrenew = 1;
73
my $canrenew = 1;
70
74
Lines 106-111 if ( C4::Context->preference( 'OpacRenewalAllowed' ) && $borr->{amountoutstandi Link Here
106
    $canrenew = 0;
110
    $canrenew = 0;
107
    $template->param(
111
    $template->param(
108
        renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ),
112
        renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ),
113
        renewal_blocked_fines_amountoutstanding => sprintf( '%.02f', $borr->{amountoutstanding} ),
109
    );
114
    );
110
}
115
}
111
116
Lines 158-164 my $issues = GetPendingIssues($borrowernumber); Link Here
158
if ($issues){
163
if ($issues){
159
    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
164
    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
160
        # check for reserves
165
        # check for reserves
161
        my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
166
        my $restype = GetReserveStatus( $issue->{'itemnumber'} );
162
        if ( $restype ) {
167
        if ( $restype ) {
163
            $issue->{'reserved'} = 1;
168
            $issue->{'reserved'} = 1;
164
        }
169
        }
Lines 170-175 if ($issues){ Link Here
170
                $charges += $ac->{'amountoutstanding'}
175
                $charges += $ac->{'amountoutstanding'}
171
                  if $ac->{'accounttype'} eq 'F';
176
                  if $ac->{'accounttype'} eq 'F';
172
                $charges += $ac->{'amountoutstanding'}
177
                $charges += $ac->{'amountoutstanding'}
178
                  if $ac->{'accounttype'} eq 'FU';
179
                $charges += $ac->{'amountoutstanding'}
173
                  if $ac->{'accounttype'} eq 'L';
180
                  if $ac->{'accounttype'} eq 'L';
174
            }
181
            }
175
        }
182
        }
Lines 259-266 foreach my $res (@reserves) { Link Here
259
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
266
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
260
    my $biblioData = GetBiblioData($res->{'biblionumber'});
267
    my $biblioData = GetBiblioData($res->{'biblionumber'});
261
    $res->{'reserves_title'} = $biblioData->{'title'};
268
    $res->{'reserves_title'} = $biblioData->{'title'};
262
    if ($OPACDisplayRequestPriority) {
269
    if ($show_priority) {
263
        $res->{'priority'} = '' if $res->{'priority'} eq '0';
270
        $res->{'priority'} ||= '';
264
    }
271
    }
265
    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
272
    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
266
}
273
}
Lines 270-276 foreach my $res (@reserves) { Link Here
270
277
271
$template->param( RESERVES       => \@reserves );
278
$template->param( RESERVES       => \@reserves );
272
$template->param( reserves_count => $#reserves+1 );
279
$template->param( reserves_count => $#reserves+1 );
273
$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
280
$template->param( showpriority=>$show_priority );
274
281
275
my @waiting;
282
my @waiting;
276
my $wcount = 0;
283
my $wcount = 0;
277
- 

Return to bug 6739