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

(-)a/Koha/XSLT/Base.pm (+3 lines)
Lines 215-220 sub transform { Link Here
215
        $self->_set_error( XSLTH_ERR_5, $@ );
215
        $self->_set_error( XSLTH_ERR_5, $@ );
216
        return $retval;
216
        return $retval;
217
    }
217
    }
218
    warn $format;
218
    my $result = eval {
219
    my $result = eval {
219
        #$parameters is an optional hashref that contains
220
        #$parameters is an optional hashref that contains
220
        #key-value pairs to be sent to the XSLT.
221
        #key-value pairs to be sent to the XSLT.
Lines 224-229 sub transform { Link Here
224
225
225
        #NOTE: Parameters are not cached. They are provided for
226
        #NOTE: Parameters are not cached. They are provided for
226
        #each different transform.
227
        #each different transform.
228
        warn Data::Dumper::Dumper( $stsh );
227
        my $transformed = $stsh->transform($source, %$parameters);
229
        my $transformed = $stsh->transform($source, %$parameters);
228
        $format eq 'bytes'
230
        $format eq 'bytes'
229
            ? $stsh->output_as_bytes( $transformed )
231
            ? $stsh->output_as_bytes( $transformed )
Lines 314-319 sub _load { Link Here
314
            return $digest.$codelen;
316
            return $digest.$codelen;
315
        }
317
        }
316
    } elsif( $filename && exists $self->{xslt_hash}->{$filename} ) {
318
    } elsif( $filename && exists $self->{xslt_hash}->{$filename} ) {
319
        warn "Already";
317
          return $filename;
320
          return $filename;
318
    }
321
    }
319
322
(-)a/misc/cronjobs/cleanup_database.pl (-6 / +19 lines)
Lines 80-85 Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] Link Here
80
                      amountoutstanding is 0 or NULL.
80
                      amountoutstanding is 0 or NULL.
81
                      In the case of --fees, DAYS must be greater than
81
                      In the case of --fees, DAYS must be greater than
82
                      or equal to 1.
82
                      or equal to 1.
83
   --log_modules      Specify which action log modules to trim. Repeatable.
84
   --preserve_logs    Specify which action logs to exclude. Repeatable.
83
   --logs DAYS        purge entries from action_logs older than DAYS days.
85
   --logs DAYS        purge entries from action_logs older than DAYS days.
84
                      Defaults to 180 days if no days specified.
86
                      Defaults to 180 days if no days specified.
85
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
87
   --searchhistory DAYS  purge entries from search_history older than DAYS days.
Lines 148-153 my $pMessages; Link Here
148
my $lock_days = C4::Context->preference('LockExpiredDelay');
150
my $lock_days = C4::Context->preference('LockExpiredDelay');
149
my $labels;
151
my $labels;
150
my $cards;
152
my $cards;
153
my @log_modules;
154
my @preserve_logs;
151
155
152
GetOptions(
156
GetOptions(
153
    'h|help'            => \$help,
157
    'h|help'            => \$help,
Lines 161-166 GetOptions( Link Here
161
    'import:i'          => \$pImport,
165
    'import:i'          => \$pImport,
162
    'z3950'             => \$pZ3950,
166
    'z3950'             => \$pZ3950,
163
    'logs:i'            => \$pLogs,
167
    'logs:i'            => \$pLogs,
168
    'log_module:s'      => \@log_modules,
169
    'preserve_log:s'    => \@preserve_logs,
164
    'messages:i'        => \$pMessages,
170
    'messages:i'        => \$pMessages,
165
    'fees:i'            => \$fees_days,
171
    'fees:i'            => \$fees_days,
166
    'searchhistory:i'   => \$pSearchhistory,
172
    'searchhistory:i'   => \$pSearchhistory,
Lines 341-354 if ($pZ3950) { Link Here
341
347
342
if ($pLogs) {
348
if ($pLogs) {
343
    print "Purging records from action_logs.\n" if $verbose;
349
    print "Purging records from action_logs.\n" if $verbose;
344
    $sth = $dbh->prepare(
350
    my $log_query = q{
345
        q{
346
            DELETE FROM action_logs
351
            DELETE FROM action_logs
347
            WHERE timestamp < date_sub(curdate(), INTERVAL ? DAY)
352
            WHERE timestamp < date_sub(curdate(), INTERVAL ? DAY)
348
        }
353
    };
349
    );
354
    my @query_params = ();
355
    if( @preserve_logs ){
356
        $log_query .= " AND module NOT IN (" . join(',',('?') x @preserve_logs ) . ")";
357
        push @query_params, @preserve_logs;
358
    }
359
    if( @log_modules ){
360
        $log_query .= " AND module IN (" . join(',',('?') x @log_modules ) . ")";
361
        push @query_params, @log_modules;
362
    }
363
    $sth = $dbh->prepare( $log_query );
350
    if ( $confirm ) {
364
    if ( $confirm ) {
351
        $sth->execute($pLogs) or die $dbh->errstr;
365
        $sth->execute($pLogs, @query_params) or die $dbh->errstr;
352
    }
366
    }
353
    print "Done with purging action_logs.\n" if $verbose;
367
    print "Done with purging action_logs.\n" if $verbose;
354
}
368
}
355
- 

Return to bug 18631