Skip to content

Commit

Permalink
2.40.4 Listeners report can now take a list of RXX IDs to match again…
Browse files Browse the repository at this point in the history
…st - thanks [S M O'Kelly] for producing the first update list that could take advantage of this
  • Loading branch information
classaxe committed Jul 4, 2022
1 parent 85620c6 commit d748297
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/Form/Listeners/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ public function buildForm(
'rxx_id',
TextType::class,
[
'attr' => [
'style' => 'width: 3em;'
],
'data' => $options['rxx_id'],
'label' => 'RXX ID',
'label' => 'RXX ID(s)',
'required' => false
]
);
Expand Down
10 changes: 7 additions & 3 deletions src/Repository/ListenerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,13 @@ private function addFilterRxxId(&$qb, $args)
if (empty($args['rxx_id'])) {
return;
}
$qb
->andWhere('(l.id = :rxx_id)')
->setParameter('rxx_id', $args['rxx_id']);
$in_arr = [];
$rxx_id_arr = explode(' ', str_replace(',', ' ', $args['rxx_id']));
foreach($rxx_id_arr as $idx => $value) {
$qb->setParameter('rxx_id_' . $idx, $value);
$in_arr[] = ':rxx_id_' . $idx;
}
$qb->andWhere('l.id IN(' . implode(',', $in_arr) . ')');
}

private function addFilterSearch(&$qb, $args)
Expand Down

0 comments on commit d748297

Please sign in to comment.