From: G. Richardson Date: Wed, 1 Aug 2012 10:03:07 +0000 (+0200) Subject: Merge branch 'master' of vc.linet-services.de:public/lx-office-erp X-Git-Tag: release-3.0.0beta1~307 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/93d494952f69bfad31e5d887b57609cbf8e41d43?hp=60e09e25d76ec7c0a4f8431df0bc7a3b25e9041a Merge branch 'master' of vc.linet-services.de:public/lx-office-erp --- diff --git a/SL/BackgroundJob/SelfTest/Base.pm b/SL/BackgroundJob/SelfTest/Base.pm index f790137d2..857de8a7a 100644 --- a/SL/BackgroundJob/SelfTest/Base.pm +++ b/SL/BackgroundJob/SelfTest/Base.pm @@ -1,5 +1,7 @@ package SL::BackgroundJob::SelfTest::Base; +use strict; + use Test::Builder; use parent qw(Rose::Object); diff --git a/SL/Controller/CsvImport/CustomerVendor.pm b/SL/Controller/CsvImport/CustomerVendor.pm index c0d9ca288..02d84836c 100644 --- a/SL/Controller/CsvImport/CustomerVendor.pm +++ b/SL/Controller/CsvImport/CustomerVendor.pm @@ -182,7 +182,6 @@ sub field_lengths { city => 75, country => 75, contact => 75, - phone => 30, fax => 30, account_number => 15, bank_code => 10, diff --git a/SL/Controller/CsvImport/Part.pm b/SL/Controller/CsvImport/Part.pm index d707aaafd..3be6f2a44 100644 --- a/SL/Controller/CsvImport/Part.pm +++ b/SL/Controller/CsvImport/Part.pm @@ -194,7 +194,10 @@ sub check_existing { my $object = $entry->{object}; - $entry->{part} = $self->parts_by->{partnumber}->{ $object->type }->{ $object->partnumber }; + $entry->{part} = SL::DB::Manager::Part->find_by( + SL::DB::Manager::Part->type_filter($object->type), + ( partnumber => $object->partnumber ) x!! $object->partnumber, + ); if ($self->settings->{article_number_policy} eq 'update_prices') { if ($entry->{part}) { diff --git a/SL/DB/MetaSetup/Customer.pm b/SL/DB/MetaSetup/Customer.pm index 8735268c0..722ff9df6 100644 --- a/SL/DB/MetaSetup/Customer.pm +++ b/SL/DB/MetaSetup/Customer.pm @@ -19,7 +19,7 @@ __PACKAGE__->meta->setup( city => { type => 'varchar', length => 75 }, country => { type => 'varchar', length => 75 }, contact => { type => 'text' }, - phone => { type => 'varchar', length => 30 }, + phone => { type => 'text' }, fax => { type => 'varchar', length => 30 }, homepage => { type => 'text' }, email => { type => 'text' }, diff --git a/SL/DB/MetaSetup/Vendor.pm b/SL/DB/MetaSetup/Vendor.pm index 6511ea286..387b2d857 100644 --- a/SL/DB/MetaSetup/Vendor.pm +++ b/SL/DB/MetaSetup/Vendor.pm @@ -19,7 +19,7 @@ __PACKAGE__->meta->setup( city => { type => 'varchar', length => 75 }, country => { type => 'varchar', length => 75 }, contact => { type => 'varchar', length => 75 }, - phone => { type => 'varchar', length => 30 }, + phone => { type => 'text' }, fax => { type => 'varchar', length => 30 }, homepage => { type => 'text' }, email => { type => 'text' }, diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index 3132b2846..5b629ee63 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -111,6 +111,14 @@ sub _check_header { ]) unless $header; } + # Special case: utf8 BOM. + # certain software (namely MS Office and notepad.exe insist on prefixing + # data with a discouraged but valid byte order mark + # if not removed, the first header field will not be recognized + if ($header && $header->[0] && $self->encoding =~ /utf-?8/i) { + $header->[0] =~ s/^\x{FEFF}//; + } + return unless $header; return $self->header([ map { lc } @$header ]); } diff --git a/sql/Pg-upgrade2/customer_vendor_phone_no_limits.sql b/sql/Pg-upgrade2/customer_vendor_phone_no_limits.sql new file mode 100644 index 000000000..30998eacb --- /dev/null +++ b/sql/Pg-upgrade2/customer_vendor_phone_no_limits.sql @@ -0,0 +1,7 @@ +-- @tag: customer_vendor_phone_no_limits +-- @description: Keine Längenbeschränkung für Spalte phone in den Tabellen customer und vendor. +-- @depends: release_2_7_0 +-- @charset: utf-8 + +ALTER TABLE customer ALTER COLUMN phone TYPE text; +ALTER TABLE vendor ALTER COLUMN phone TYPE text; diff --git a/t/helper/csv.t b/t/helper/csv.t index 4e7ef121c..63fc858c9 100644 --- a/t/helper/csv.t +++ b/t/helper/csv.t @@ -1,4 +1,4 @@ -use Test::More tests => 40; +use Test::More tests => 41; use lib 't'; @@ -285,11 +285,21 @@ is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive hea ##### $csv = SL::Helper::Csv->new( - file => \"Kaffee", - header => [ 'Description' ], - class => 'SL::DB::Part', +file => \"Kaffee", +header => [ 'Description' ], +class => 'SL::DB::Part', ); $csv->parse; is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'case insensitive header as param works'; +##### + +$csv = SL::Helper::Csv->new( + file => \"\x{FEFF}description\nKaffee", + class => 'SL::DB::Part', + encoding => 'utf8', +); +$csv->parse; +is_deeply $csv->get_data, [ { description => 'Kaffee' } ], 'utf8 BOM works (bug 1872)'; + # vim: ft=perl diff --git a/templates/webpages/ct/form_header.html b/templates/webpages/ct/form_header.html index 8263d873d..bdf22dfed 100644 --- a/templates/webpages/ct/form_header.html +++ b/templates/webpages/ct/form_header.html @@ -131,7 +131,7 @@ [% 'Phone' | $T8 %] - +