From 8fac1ef383937e6a3470d06b7827b330861de4b3 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Wed, 22 Dec 2021 13:34:13 +0100 Subject: [PATCH] Revert "TT#144300 accept Windows .csv file uploads" This reverts commit 5445c72cc7df196c21d8a07970711e8c55c91a0d. Reason for revert: not needed to support windows line terminator Change-Id: I00f22993e17ec7c9bcb6ee331d07b6da0495586a --- lib/NGCP/Panel/Utils/Billing.pm | 3 --- lib/NGCP/Panel/Utils/Phonebook.pm | 2 -- lib/NGCP/Panel/Utils/ProvisioningTemplates.pm | 3 --- 3 files changed, 8 deletions(-) diff --git a/lib/NGCP/Panel/Utils/Billing.pm b/lib/NGCP/Panel/Utils/Billing.pm index fc6bba3b34..2ae69f1da9 100644 --- a/lib/NGCP/Panel/Utils/Billing.pm +++ b/lib/NGCP/Panel/Utils/Billing.pm @@ -8,7 +8,6 @@ use NGCP::Schema; use NGCP::Panel::Utils::Preferences qw(); use NGCP::Panel::Utils::DateTime; use DateTime::Format::Strptime qw(); -use NGCP::Panel::Utils::Generic qw(trim); use NGCP::Panel::Utils::IntervalTree::Simple; @@ -236,13 +235,11 @@ sub process_billing_fees{ my $linenum = 0; my @fees = (); my %zones = (); - local $/ = "/n"; open(my $fh, '<:encoding(utf8)', $data); #to don't stop on first failed parse - don't use "while($csv->getline)" while ( my $line = <$fh> ){ ++$linenum; next unless length $line; - $line = trim($line); unless($csv->parse($line)) { push @fails, $linenum; next; diff --git a/lib/NGCP/Panel/Utils/Phonebook.pm b/lib/NGCP/Panel/Utils/Phonebook.pm index 6e9dc2eab6..b102117114 100644 --- a/lib/NGCP/Panel/Utils/Phonebook.pm +++ b/lib/NGCP/Panel/Utils/Phonebook.pm @@ -166,13 +166,11 @@ sub upload_csv { $c->model('DB')->txn_do(sub { - local $/ = "/n"; open(my $fh, '<:encoding(utf8)', $data); while ( my $line = <$fh> ){ ++$linenum; next unless length $line; - $line = trim($line); unless($csv->parse($line)) { push @fails, $linenum; next; diff --git a/lib/NGCP/Panel/Utils/ProvisioningTemplates.pm b/lib/NGCP/Panel/Utils/ProvisioningTemplates.pm index 1604bd2bce..5675a8be83 100644 --- a/lib/NGCP/Panel/Utils/ProvisioningTemplates.pm +++ b/lib/NGCP/Panel/Utils/ProvisioningTemplates.pm @@ -28,7 +28,6 @@ use NGCP::Panel::Utils::ProfilePackages qw(); use NGCP::Panel::Utils::Subscriber qw(); use NGCP::Panel::Utils::Preferences qw(); use NGCP::Panel::Utils::Kamailio qw(); -use NGCP::Panel::Utils::Generic qw(trim); use JE::Destroyer qw(); use JE qw(); @@ -317,12 +316,10 @@ sub process_csv { c => $c, purge => $purge, ); - local $/ = "/n"; open(my $fh, '<:encoding(utf8)', $data); while ( my $line = <$fh> ){ ++$linenum; next unless length $line; - $line = trim($line); unless($csv->parse($line)) { push(@fails,{ linenum => $linenum, }); next;