projects
/
koha_gimpoz
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 5549 : Handle datetimes on return
[koha_gimpoz]
/
C4
/
ImportExportFramework.pm
diff --git
a/C4/ImportExportFramework.pm
b/C4/ImportExportFramework.pm
old mode 100755
(executable)
new mode 100644
(file)
index
e518771
..
d85e64f
--- a/
C4/ImportExportFramework.pm
+++ b/
C4/ImportExportFramework.pm
@@
-762,7
+762,7
@@
sub _parseSQLLine
my $line;
my $numLines = 0;
while (<$dom>) {
my $line;
my $numLines = 0;
while (<$dom>) {
-
chomp $_
;
+
s/[\r\n]+$//
;
$line = $_;
# we don't want to execute any sql statement, only the ones dealing with frameworks
next unless ($line =~ /^\s*(?i:DELETE\s+FROM|INSERT\s+INTO)\s+(?:marc_tag_structure|marc_subfield_structure)/);
$line = $_;
# we don't want to execute any sql statement, only the ones dealing with frameworks
next unless ($line =~ /^\s*(?i:DELETE\s+FROM|INSERT\s+INTO)\s+(?:marc_tag_structure|marc_subfield_structure)/);
@@
-776,7
+776,7
@@
sub _parseSQLLine
my $stmt = SQL::Statement->new($line, $parser);
my $where = $stmt->where();
if ($where && $where->op() eq '=' && $line =~ /^\s*DELETE/) {
my $stmt = SQL::Statement->new($line, $parser);
my $where = $stmt->where();
if ($where && $where->op() eq '=' && $line =~ /^\s*DELETE/) {
- $line =~ s/frameworkcode='.
+
?'/frameworkcode='$frameworkcode';/ unless ($_ =~ /frameworkcode='$frameworkcode'/);
+ $line =~ s/frameworkcode='.
*
?'/frameworkcode='$frameworkcode';/ unless ($_ =~ /frameworkcode='$frameworkcode'/);
} else {
my @arrFields;
my @arrValues;
} else {
my @arrFields;
my @arrValues;
@@
-817,7
+817,7
@@
sub _parseSQLLine
if ($error) {
$line .= ';' unless ($line =~ /;$/);
if ($line =~ /^\s*DELETE/) {
if ($error) {
$line .= ';' unless ($line =~ /;$/);
if ($line =~ /^\s*DELETE/) {
- $line =~ s/frameworkcode='.
+
?'/frameworkcode='$frameworkcode'/ unless ($_ =~ /frameworkcode='$frameworkcode'/);
+ $line =~ s/frameworkcode='.
*
?'/frameworkcode='$frameworkcode'/ unless ($_ =~ /frameworkcode='$frameworkcode'/);
} elsif ($line =~ /^\s*INSERT\s+INTO\s+(.*?)\s+\((.*?frameworkcode.*?)\)\s+VALUES\s+\((.+)\)\s*;\s*$/) {
my $table = $1;
my $fields = $2;
} elsif ($line =~ /^\s*INSERT\s+INTO\s+(.*?)\s+\((.*?frameworkcode.*?)\)\s+VALUES\s+\((.+)\)\s*;\s*$/) {
my $table = $1;
my $fields = $2;
@@
-1161,7
+1161,7
@@
sub _import_table_csv
if ($row =~ /(?:".*?",?)+/) {
@arrData = split('","', $row);
$arrData[0] = substr($arrData[0], 1) if ($arrData[0] =~ /^"/);
if ($row =~ /(?:".*?",?)+/) {
@arrData = split('","', $row);
$arrData[0] = substr($arrData[0], 1) if ($arrData[0] =~ /^"/);
-
chomp $arrData[$#arrData]
;
+
$arrData[$#arrData] =~ s/[\r\n]+$//
;
chop $arrData[$#arrData] if ($arrData[$#arrData] =~ /"$/);
if (@arrData) {
if ($arrData[0] eq '#-#' && $arrData[$#arrData] eq '#-#') {
chop $arrData[$#arrData] if ($arrData[$#arrData] =~ /"$/);
if (@arrData) {
if ($arrData[0] eq '#-#' && $arrData[$#arrData] eq '#-#') {