Lines 193-199
Functions for handling import/export.
Link Here
|
193 |
|
193 |
|
194 |
=head2 ExportFramework |
194 |
=head2 ExportFramework |
195 |
|
195 |
|
196 |
Export all the information of a MARC or Authority Type Framework to an excel "xml" file, comma separated values "csv" file or OpenDocument SpreadSheet "ods" file. |
196 |
Export all information of a bibliographic or authority MARC framework to an Excel "xml" file, comma separated values "csv" or OpenDocument SpreadSheet "ods". |
197 |
|
197 |
|
198 |
return : |
198 |
return : |
199 |
succes |
199 |
succes |
Lines 647-652
sub ImportFramework
Link Here
|
647 |
my $tempdir; |
647 |
my $tempdir; |
648 |
my $ok = -1; |
648 |
my $ok = -1; |
649 |
my $dbh = C4::Context->dbh; |
649 |
my $dbh = C4::Context->dbh; |
|
|
650 |
$frameworktype ||= ''; |
650 |
if (-r $filename && $dbh) { |
651 |
if (-r $filename && $dbh) { |
651 |
my $extension = ''; |
652 |
my $extension = ''; |
652 |
if ($filename =~ /\.(csv|ods|xml)$/i) { |
653 |
if ($filename =~ /\.(csv|ods|xml)$/i) { |
Lines 821-826
sub _import_table
Link Here
|
821 |
my %fields2Delete; |
822 |
my %fields2Delete; |
822 |
my $query; |
823 |
my $query; |
823 |
my @fields; |
824 |
my @fields; |
|
|
825 |
$frameworktype ||= ''; |
824 |
# Create hash with all elements defined by primary key to know which ones to delete after parsing the spreadsheet |
826 |
# Create hash with all elements defined by primary key to know which ones to delete after parsing the spreadsheet |
825 |
eval { |
827 |
eval { |
826 |
@fields = @$PKArray; |
828 |
@fields = @$PKArray; |
Lines 1115-1120
sub _getDataFields
Link Here
|
1115 |
|
1117 |
|
1116 |
my $dataFields = {}; |
1118 |
my $dataFields = {}; |
1117 |
my @dataFieldsA = (); |
1119 |
my @dataFieldsA = (); |
|
|
1120 |
$frameworktype ||= ''; |
1118 |
if ($node && $node->hasChildNodes()) { |
1121 |
if ($node && $node->hasChildNodes()) { |
1119 |
my $node2 = $node->firstChild; |
1122 |
my $node2 = $node->firstChild; |
1120 |
my ($data, $repeated); |
1123 |
my ($data, $repeated); |