Lines 1890-1895
sub _get_tt_params {
Link Here
|
1890 |
}, |
1890 |
}, |
1891 |
}; |
1891 |
}; |
1892 |
|
1892 |
|
|
|
1893 |
my $dbh = C4::Context->dbh; |
1893 |
foreach my $table ( keys %$tables ) { |
1894 |
foreach my $table ( keys %$tables ) { |
1894 |
next unless $config->{$table}; |
1895 |
next unless $config->{$table}; |
1895 |
|
1896 |
|
Lines 1910-1921
sub _get_tt_params {
Link Here
|
1910 |
my $objects = $module->search( |
1911 |
my $objects = $module->search( |
1911 |
{ $key => $values }, |
1912 |
{ $key => $values }, |
1912 |
{ |
1913 |
{ |
1913 |
# We want to retrieve the data in the same order |
1914 |
# We want to retrieve the data in the same order |
1914 |
# FIXME MySQLism |
1915 |
# FIXME MySQLism |
1915 |
# field is a MySQLism, but they are no other way to do it |
1916 |
# field is a MySQLism, but they are no other way to do it |
1916 |
# To be generic we could do it in perl, but we will need to fetch |
1917 |
# To be generic we could do it in perl, but we will need to fetch |
1917 |
# all the data then order them |
1918 |
# all the data then order them |
1918 |
@$values ? ( order_by => \[ "field($key, " . join( ', ', @$values ) . ")" ] ) : () |
1919 |
@$values |
|
|
1920 |
? ( |
1921 |
order_by => \[ |
1922 |
sprintf "field(%s, %s)", $dbh->quote($key), |
1923 |
map { $dbh->quote($_) } join( ', ', @$values ) |
1924 |
] |
1925 |
) |
1926 |
: () |
1919 |
} |
1927 |
} |
1920 |
); |
1928 |
); |
1921 |
$params->{ $config->{$table}->{plural} } = $objects; |
1929 |
$params->{ $config->{$table}->{plural} } = $objects; |
1922 |
- |
|
|