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

(-)a/admin/import_export_authtype.pl (-3 / +13 lines)
Lines 76-81 if ($action eq 'export' && $input->request_method() eq 'GET') { Link Here
76
} elsif ($input->request_method() eq 'POST') {
76
} elsif ($input->request_method() eq 'POST') {
77
    my $ok = -1;
77
    my $ok = -1;
78
    my $fieldname = 'file_import_' . $authtypecode;
78
    my $fieldname = 'file_import_' . $authtypecode;
79
    if ($authtypecode eq 'default'){
80
        $fieldname = 'file_import_';
81
    }
79
    my $filename = $input->param($fieldname);
82
    my $filename = $input->param($fieldname);
80
    # upload the input file
83
    # upload the input file
81
    if ($filename && $filename =~ /\.(csv|ods|xml)$/i) {
84
    if ($filename && $filename =~ /\.(csv|ods|xml)$/i) {
Lines 84-94 if ($action eq 'export' && $input->request_method() eq 'GET') { Link Here
84
        if ($uploadFd && !$input->cgi_error) {
87
        if ($uploadFd && !$input->cgi_error) {
85
            my $tmpfilename = $input->tmpFileName(scalar $input->param($fieldname));
88
            my $tmpfilename = $input->tmpFileName(scalar $input->param($fieldname));
86
            $filename = $tmpfilename . '.' . $extension; # rename the tmp file with the extension
89
            $filename = $tmpfilename . '.' . $extension; # rename the tmp file with the extension
87
            $ok = ImportFramework($filename, $authtypecode, 1, 'authority') if (rename($tmpfilename, $filename));
90
            if ($authtypecode eq 'default') {
91
                $ok = ImportFramework($filename, '', 1, 'authority') if (rename($tmpfilename, $filename));
92
            } else {
93
                $ok = ImportFramework($filename, $authtypecode, 1, 'authority') if (rename($tmpfilename, $filename));
94
            }
88
        }
95
        }
89
    }
96
    }
90
    if ($ok >= 0) { # If everything went ok go to the authority type marc structure
97
    if ($ok >= 0) { # If everything went ok go to the authority type marc structure
91
        print $input->redirect( -location => '/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=' . $authtypecode);
98
        if ($authtypecode eq 'default'){
99
            print $input->redirect( -location => '/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=');
100
        } else {
101
            print $input->redirect( -location => '/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=' . $authtypecode);
102
        }
92
    } else {
103
    } else {
93
        # If something failed go to the list of authority types and show message
104
        # If something failed go to the list of authority types and show message
94
        print $input->redirect( -location => '/cgi-bin/koha/admin/authtypes.pl?error_import_export=' . $authtypecode);
105
        print $input->redirect( -location => '/cgi-bin/koha/admin/authtypes.pl?error_import_export=' . $authtypecode);
95
- 

Return to bug 13952