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

(-)a/tools/export.pl (-3 / +5 lines)
Lines 59-66 my ($template, $loggedinuser, $cookie, $flags) Link Here
59
    	$branch = C4::Context->userenv->{'branch'};
59
    	$branch = C4::Context->userenv->{'branch'};
60
	}
60
	}
61
61
62
my $backupdir = C4::Context->config('backupdir');
63
64
if ($op eq "export") {
62
if ($op eq "export") {
65
    my $charset  = 'utf-8';
63
    my $charset  = 'utf-8';
66
    my $mimetype = 'application/octet-stream';
64
    my $mimetype = 'application/octet-stream';
Lines 175-180 if ($op eq "export") { Link Here
175
        }
173
        }
176
    }
174
    }
177
    elsif ( $record_type eq 'db' ) {
175
    elsif ( $record_type eq 'db' ) {
176
        my $backupdir = C4::Context->config('backupdir');
178
        my $successful_export;
177
        my $successful_export;
179
        if ( $flags->{superlibrarian} && C4::Context->config('backup_db_via_tools') ) {
178
        if ( $flags->{superlibrarian} && C4::Context->config('backup_db_via_tools') ) {
180
            $successful_export = download_backup( { directory => "$backupdir", extension => 'sql', filename => "$filename" } )
179
            $successful_export = download_backup( { directory => "$backupdir", extension => 'sql', filename => "$filename" } )
Lines 187-192 if ($op eq "export") { Link Here
187
        exit;
186
        exit;
188
    }
187
    }
189
    elsif ( $record_type eq 'conf' ) {
188
    elsif ( $record_type eq 'conf' ) {
189
        my $backupdir = C4::Context->config('backupdir');
190
        my $successful_export;
190
        my $successful_export;
191
        if ( $flags->{superlibrarian} && C4::Context->config('backup_conf_via_tools') ) {
191
        if ( $flags->{superlibrarian} && C4::Context->config('backup_conf_via_tools') ) {
192
            $successful_export = download_backup( { directory => "$backupdir", extension => 'tar', filename => "$filename" } )
192
            $successful_export = download_backup( { directory => "$backupdir", extension => 'tar', filename => "$filename" } )
Lines 269-274 if ($op eq "export") { Link Here
269
269
270
else {
270
else {
271
271
272
    my $backupdir = C4::Context->config('backupdir');
272
    my $itemtypes = GetItemTypes;
273
    my $itemtypes = GetItemTypes;
273
    my @itemtypesloop;
274
    my @itemtypesloop;
274
    foreach my $thisitemtype (sort keys %$itemtypes) {
275
    foreach my $thisitemtype (sort keys %$itemtypes) {
Lines 328-333 sub getbackupfilelist { Link Here
328
    my $extension = $args->{extension};
329
    my $extension = $args->{extension};
329
    my @files;
330
    my @files;
330
331
332
    my $backupdir = C4::Context->config('backupdir');
333
331
    if ( opendir(my $dir, $directory) ) {
334
    if ( opendir(my $dir, $directory) ) {
332
        while (my $file = readdir($dir)) {
335
        while (my $file = readdir($dir)) {
333
            next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ );
336
            next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ );
334
- 

Return to bug 8437