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

(-)a/Koha/XSLT/Base.pm (+3 lines)
Lines 216-221 sub transform { Link Here
216
        $self->_set_error( XSLTH_ERR_5, $@ );
216
        $self->_set_error( XSLTH_ERR_5, $@ );
217
        return $retval;
217
        return $retval;
218
    }
218
    }
219
    warn $format;
219
    my $result = eval {
220
    my $result = eval {
220
        #$parameters is an optional hashref that contains
221
        #$parameters is an optional hashref that contains
221
        #key-value pairs to be sent to the XSLT.
222
        #key-value pairs to be sent to the XSLT.
Lines 225-230 sub transform { Link Here
225
226
226
        #NOTE: Parameters are not cached. They are provided for
227
        #NOTE: Parameters are not cached. They are provided for
227
        #each different transform.
228
        #each different transform.
229
        warn Data::Dumper::Dumper( $stsh );
228
        my $transformed = $stsh->transform($source, %$parameters);
230
        my $transformed = $stsh->transform($source, %$parameters);
229
        $format eq 'bytes'
231
        $format eq 'bytes'
230
            ? $stsh->output_as_bytes( $transformed )
232
            ? $stsh->output_as_bytes( $transformed )
Lines 315-320 sub _load { Link Here
315
            return $digest.$codelen;
317
            return $digest.$codelen;
316
        }
318
        }
317
    } elsif( $filename && exists $self->{xslt_hash}->{$filename} ) {
319
    } elsif( $filename && exists $self->{xslt_hash}->{$filename} ) {
320
        warn "Already";
318
          return $filename;
321
          return $filename;
319
    }
322
    }
320
323
(-)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