Revision 165a97b3
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
1848 | 1848 |
WHERE $where|; |
1849 | 1849 |
my $sth = prepare_execute_query($form, $dbh, $query, @values); |
1850 | 1850 |
|
1851 |
my @translation_queries = ( [ qq|SELECT tr.translation, tr.longdescription |
|
1852 |
FROM translation tr |
|
1853 |
WHERE tr.language_id = ? AND tr.parts_id = ?| ], |
|
1854 |
[ qq|SELECT tr.translation, tr.longdescription |
|
1855 |
FROM translation tr |
|
1856 |
WHERE tr.language_id IN |
|
1857 |
(SELECT id |
|
1858 |
FROM language |
|
1859 |
WHERE article_code = (SELECT article_code FROM language WHERE id = ?)) |
|
1860 |
AND tr.parts_id = ? |
|
1861 |
LIMIT 1| ] ); |
|
1862 |
map { push @{ $_ }, prepare_query($form, $dbh, $_->[0]) } @translation_queries; |
|
1863 |
|
|
1851 | 1864 |
while (my $ref = $sth->fetchrow_hashref('NAME_lc')) { |
1852 | 1865 |
|
1853 | 1866 |
# In der Buchungsgruppe ist immer ein Bestandskonto verknuepft, auch wenn |
... | ... | |
1915 | 1928 |
|
1916 | 1929 |
$stw->finish; |
1917 | 1930 |
chop $ref->{taxaccounts}; |
1931 |
|
|
1918 | 1932 |
if ($form->{language_id}) { |
1919 |
$query = |
|
1920 |
qq|SELECT tr.translation, tr.longdescription |
|
1921 |
FROM translation tr |
|
1922 |
WHERE tr.language_id = ? AND tr.parts_id = ?|; |
|
1923 |
@values = (conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1924 |
my ($translation, $longdescription) = selectrow_query($form, $dbh, $query, @values); |
|
1925 |
if ($translation ne "") { |
|
1933 |
for my $spec (@translation_queries) { |
|
1934 |
do_statement($form, $spec->[1], $spec->[0], conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1935 |
my ($translation, $longdescription) = $spec->[1]->fetchrow_array; |
|
1936 |
next unless $translation; |
|
1926 | 1937 |
$ref->{description} = $translation; |
1927 | 1938 |
$ref->{longdescription} = $longdescription; |
1928 |
|
|
1929 |
} else { |
|
1930 |
$query = |
|
1931 |
qq|SELECT tr.translation, tr.longdescription |
|
1932 |
FROM translation tr |
|
1933 |
WHERE tr.language_id IN |
|
1934 |
(SELECT id |
|
1935 |
FROM language |
|
1936 |
WHERE article_code = (SELECT article_code FROM language WHERE id = ?)) |
|
1937 |
AND tr.parts_id = ? |
|
1938 |
LIMIT 1|; |
|
1939 |
@values = (conv_i($form->{language_id}), conv_i($ref->{id})); |
|
1940 |
my ($translation, $longdescription) = selectrow_query($form, $dbh, $query, @values); |
|
1941 |
if ($translation ne "") { |
|
1942 |
$ref->{description} = $translation; |
|
1943 |
$ref->{longdescription} = $longdescription; |
|
1944 |
} |
|
1939 |
last; |
|
1945 | 1940 |
} |
1946 | 1941 |
} |
1947 | 1942 |
|
... | ... | |
1964 | 1959 |
} |
1965 | 1960 |
} |
1966 | 1961 |
$sth->finish; |
1962 |
$_->[1]->finish for @translation_queries; |
|
1967 | 1963 |
|
1968 | 1964 |
foreach my $item (@{ $form->{item_list} }) { |
1969 | 1965 |
my $custom_variables = CVar->get_custom_variables(module => 'IC', |
Auch abrufbar als: Unified diff
In Einkaufsbelegen Übersetzungen von Artikeln berücksichtigen
Fix für Bug 1677.