From cf63992efd6843a38de948fc509cdcc3bf51f1b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 26 Sep 2014 15:38:23 +0200 Subject: [PATCH] PriceSource: Nur den Namen des Moduls anzeigen, nicht den vollen Namen --- SL/PriceSource/Price.pm | 8 ++++++++ bin/mozilla/io.pl | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/SL/PriceSource/Price.pm b/SL/PriceSource/Price.pm index b753e0c6a..1e8f0a299 100644 --- a/SL/PriceSource/Price.pm +++ b/SL/PriceSource/Price.pm @@ -26,6 +26,14 @@ sub full_description { : $self->description } +sub source_description { + my ($self) = @_; + + $self->price_source + ? $self->price_source->description + : $self->description +} + sub to_str { "source: @{[ $_[0]->source ]}, price: @{[ $_[0]->price]}, description: @{[ $_[0]->description ]}" } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 93d73949e..565b3c5fd 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -326,7 +326,7 @@ sub display_row { if ($form->{"id_${i}"} && !$is_delivery_order) { my $price_source = SL::PriceSource->new(record_item => $record_item, record => $record); my $price = $price_source->price_from_source($::form->{"active_price_source_$i"}); - $column_data{price_source} .= $cgi->button(-value => $price->full_description, -onClick => "kivi.io.price_chooser($i)"); + $column_data{price_source} .= $cgi->button(-value => $price->source_description, -onClick => "kivi.io.price_chooser($i)"); if ($price->source) { $column_data{price_source} .= ' ' . $cgi->img({src => 'image/flag-red.png', alt => $price->invalid, title => $price->invalid }) if $price->invalid; $column_data{price_source} .= ' ' . $cgi->img({src => 'image/flag-red.png', alt => $price->missing, title => $price->missing }) if $price->missing; -- 2.20.1