[Advance Search] Remove duplicate modes

Think this handles sub modes correctly now although you still see USB / LSB listed if its in the main MODE window. not sure whether to make a migration to change those.
This commit is contained in:
Peter Goodhall
2022-12-27 16:57:09 +00:00
parent 54c31a6b3f
commit e16e7ed18a
2 changed files with 21 additions and 8 deletions

View File

@@ -35,18 +35,18 @@ class Logbookadvanced extends CI_Controller {
}
ksort($deOptions);
$deOptions = array_keys($deOptions);
$modes = [];
if ($stationIds !== []) {
foreach ($this->logbookadvanced_model->get_worked_modes($stationIds) as $mode) {
$key = $mode['mode'];
if ($mode['submode'] !== null) {
if ($mode['submode'] != null) {
$key .= "|" . $mode['submode'];
}
if ($mode['submode'] == null) {
$modes[$key] = $mode['mode'];
} else {
$modes[$key] = $mode['submode'];
$modes[$key] = $mode['mode'] . " | ".$mode['submode'];
}
}
}