[Advanced Logbook] Added frequency to batch edit

This commit is contained in:
Andreas Kristiansen
2026-03-19 19:20:01 +01:00
parent d438563977
commit d59794d319
3 changed files with 38 additions and 1 deletions

View File

@@ -1126,6 +1126,7 @@ class Logbookadvanced_model extends CI_Model {
case "rsts": $column = 'COL_RST_SENT'; break; case "rsts": $column = 'COL_RST_SENT'; break;
case "qslsentmethod": $column = 'COL_QSL_SENT_VIA'; break; case "qslsentmethod": $column = 'COL_QSL_SENT_VIA'; break;
case "qslreceivedmethod": $column = 'COL_QSL_RCVD_VIA'; break; case "qslreceivedmethod": $column = 'COL_QSL_RCVD_VIA'; break;
case "frequency": $column = 'COL_FREQUENCY'; break;
default: return; default: return;
} }
@@ -1186,6 +1187,22 @@ class Logbookadvanced_model extends CI_Model {
$frequencyBandRx = $bandrx == '' ? null : $this->frequency->defaultFrequencies[$bandrx]['CW']; $frequencyBandRx = $bandrx == '' ? null : $this->frequency->defaultFrequencies[$bandrx]['CW'];
$query = $this->db->query($sql, array($value, $value2, $frequencyBand, $frequencyBandRx, json_decode($ids, true), $this->session->userdata('user_id'))); $query = $this->db->query($sql, array($value, $value2, $frequencyBand, $frequencyBandRx, json_decode($ids, true), $this->session->userdata('user_id')));
} else if ($column == 'COL_FREQUENCY') {
if ($value == '') return;
$value2 == '' ? '' : $value2;
$sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" .
" SET " . $this->config->item('table_name').".COL_FREQ = ?" .
", " . $this->config->item('table_name').".COL_FREQ_RX = ?" .
", " . $this->config->item('table_name').".COL_BAND = ?" .
", " . $this->config->item('table_name').".COL_BAND_RX = ?" .
" WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?";
$band = $this->frequency->GetBand($value);
$bandRx = $value2 == '' ? null : $this->frequency->GetBand($value2);
$query = $this->db->query($sql, array($value, $value2, $band, $bandRx, json_decode($ids, true), $this->session->userdata('user_id')));
} else if ($column == 'COL_GRIDSQUARE') { } else if ($column == 'COL_GRIDSQUARE') {
if ($value == '') { if ($value == '') {
$grid_value = null; $grid_value = null;

View File

@@ -4,6 +4,7 @@
<option value="">-</option> <option value="">-</option>
<optgroup label="<?= __("QSO details"); ?>"> <optgroup label="<?= __("QSO details"); ?>">
<option value="band"><?= __("Band"); ?></option> <option value="band"><?= __("Band"); ?></option>
<option value="frequency"><?= __("Frequency"); ?></option>
<option value="comment"><?= __("Comment"); ?></option> <option value="comment"><?= __("Comment"); ?></option>
<option value="contest"><?= __("Contest"); ?></option> <option value="contest"><?= __("Contest"); ?></option>
<option value="stxstring"><?= __("Contest Exch (S)"); ?></option> <option value="stxstring"><?= __("Contest Exch (S)"); ?></option>
@@ -133,6 +134,12 @@
?> ?>
</select> </select>
<label style="display:none" id="editFrequencyTxLabel" class="mx-2 w-auto" for="editFrequency"><?= __("Frequency TX (Hz)"); ?></label>
<input style="display:none" class="form-control form-control-sm w-auto" id="editFrequency" type="text" name="editFrequency" placeholder="" aria-label="editFrequency">
<label style="display:none" id="editFrequencyRxLabel" class="mx-2 w-auto" for="editFrequencyRx"><?= __("Frequency RX (Hz)"); ?></label>
<input style="display:none" class="form-control form-control-sm w-auto" id="editFrequencyRx" type="text" name="editFrequencyRx" placeholder="" aria-label="editFrequencyRx">
<select style="display:none" id="editMode" class="form-select mode form-select-sm w-auto" name="editMode"> <select style="display:none" id="editMode" class="form-select mode form-select-sm w-auto" name="editMode">
<?php <?php
foreach($modes->result() as $mode){ foreach($modes->result() as $mode){

View File

@@ -168,6 +168,10 @@ function saveBatchEditQsos(id_list) {
value = $("#editBand").val(); value = $("#editBand").val();
value2 = $("#editBandRx").val(); value2 = $("#editBandRx").val();
} }
if (column == 'frequency') {
value = $("#editFrequency").val();
value2 = $("#editFrequencyRx").val();
}
if (column == 'mode') { if (column == 'mode') {
value = $("#editMode").val(); value = $("#editMode").val();
} }
@@ -277,6 +281,10 @@ function changeEditType(type) {
$('#editDokInput').hide(); $('#editDokInput').hide();
$('#editGridsquareInput').hide(); $('#editGridsquareInput').hide();
$('#editQslMethod').hide(); $('#editQslMethod').hide();
$('#editFrequency').hide();
$('#editFrequencyRx').hide();
$('#editFrequencyTxLabel').hide();
$('#editFrequencyRxLabel').hide();
if (type == "dxcc") { if (type == "dxcc") {
$('#editDxcc').show(); $('#editDxcc').show();
} else if (type == "iota") { } else if (type == "iota") {
@@ -298,7 +306,7 @@ function changeEditType(type) {
$('#editBandTxLabel').show(); $('#editBandTxLabel').show();
$('#editBandRx').show(); $('#editBandRx').show();
$('#editBandRxLabel').show(); $('#editBandRxLabel').show();
}else if (type == "mode") { } else if (type == "mode") {
$('#editMode').show(); $('#editMode').show();
} else if (type == "date") { } else if (type == "date") {
$('#editDate').show(); $('#editDate').show();
@@ -341,6 +349,11 @@ function changeEditType(type) {
$('#editDistanceInputLabel').show(); $('#editDistanceInputLabel').show();
} else if (type == "qslsentmethod" || type == "qslreceivedmethod") { } else if (type == "qslsentmethod" || type == "qslreceivedmethod") {
$('#editQslMethod').show(); $('#editQslMethod').show();
} else if (type == "frequency") {
$('#editFrequency').show();
$('#editFrequencyRx').show();
$('#editFrequencyTxLabel').show();
$('#editFrequencyRxLabel').show();
} }
} }