[Advanced Logbook] Added continent fix and distance fix

This commit is contained in:
Andreas Kristiansen
2025-11-06 08:43:35 +01:00
parent 6e255eee06
commit 5c84220bd3
5 changed files with 156 additions and 77 deletions

View File

@@ -713,6 +713,10 @@ class Logbookadvanced extends CI_Controller {
$this->load->view('logbookadvanced/help');
}
public function continentDialog() {
$this->load->view('logbookadvanced/continentdialog');
}
public function fixCqZones() {
if(!clubaccess_check(9)) return;

View File

@@ -0,0 +1,5 @@
<div class="container-fluid">
Update all QSOs with the continent based on the DXCC country of the QSO.
This is useful if you have imported QSOs without continent information.<br /><br />
Update will only set the continent for QSOs where the continent is empty or invalid (not AF, AN, AS, EU, NA, OC or SA).
</div>

View File

@@ -1,18 +1,20 @@
<?= __("In the text input searches, you can search in the following way:"); ?><br />
<li><?= __("* - means search for everything."); ?></li>
<li><?= __("Remove star and leave blank, means to search where column is empty."); ?></li>
<li><?= __("!empty - means to search where column is not empty."); ?></li>
<br />
<?= __("The dupe search checks for duplicate QSOs with the same callsign, mode, submode, station callsign, band and satellite within 1500 seconds."); ?>
<br /><br />
<?= __("The invalid search checks for the following conditions:"); ?>
<li><?= __("Mode is blank or set to 0."); ?></li>
<li><?= __("Band is blank."); ?></li>
<li><?= __("Callsign is blank."); ?></li>
<li><?= __("Time and date is not set."); ?></li>
<li><?= __("Date is set to 1970-01-01."); ?></li>
<li><?= __("Continent different from AF, AN, AS, EU, NA, OC or SA."); ?></li>
<br />
<?= __("The map uses the same search criteria as the normal search. All QSOs in the search result will be mapped, unless you have checked one or more QSOs."); ?>
<br /><br />
<?= __("The ADIF export uses the same search criteria as the normal search. All QSOs will be exported (all for selected location), unless you have checked one or more QSOs."); ?>
<div class="container-fluid">
<?= __("In the text input searches, you can search in the following way:"); ?><br />
<li><?= __("* - means search for everything."); ?></li>
<li><?= __("Remove star and leave blank, means to search where column is empty."); ?></li>
<li><?= __("!empty - means to search where column is not empty."); ?></li>
<br />
<?= __("The dupe search checks for duplicate QSOs with the same callsign, mode, submode, station callsign, band and satellite within 1500 seconds."); ?>
<br /><br />
<?= __("The invalid search checks for the following conditions:"); ?>
<li><?= __("Mode is blank or set to 0."); ?></li>
<li><?= __("Band is blank."); ?></li>
<li><?= __("Callsign is blank."); ?></li>
<li><?= __("Time and date is not set."); ?></li>
<li><?= __("Date is set to 1970-01-01."); ?></li>
<li><?= __("Continent different from AF, AN, AS, EU, NA, OC or SA."); ?></li>
<br />
<?= __("The map uses the same search criteria as the normal search. All QSOs in the search result will be mapped, unless you have checked one or more QSOs."); ?>
<br /><br />
<?= __("The ADIF export uses the same search criteria as the normal search. All QSOs will be exported (all for selected location), unless you have checked one or more QSOs."); ?>
</div>

View File

@@ -1,28 +1,56 @@
<script type="text/javascript">
var user_id = <?php echo $this->session->userdata('user_id'); ?>;
let user_id = <?php echo $this->session->userdata('user_id'); ?>;
/*
* Custom user settings
*/
var custom_date_format = "<?php echo $custom_date_format ?>";
let custom_date_format = "<?php echo $custom_date_format ?>";
let user_map_custom = JSON.parse('<?php echo $user_map_custom; ?>');
var lang_gen_hamradio_latitude = '<?= __("Latitude"); ?>';
var lang_gen_hamradio_longitude = '<?= __("Longitude"); ?>';
var lang_gen_hamradio_gridsquare = '<?= __("Gridsquare"); ?>';
var lang_gen_hamradio_gridsquares = '<?= _pgettext("Map Options", "Gridsquares"); ?>';
var lang_gen_hamradio_distance = '<?= __("Distance"); ?>';
var lang_gen_hamradio_bearing = '<?= __("Bearing"); ?>';
var lang_gen_hamradio_pathlines = '<?= _pgettext("Map Options", "Path lines"); ?>';
var lang_gen_hamradio_callsigns = '<?= __("Show Callsigns"); ?>';
var lang_gen_hamradio_cq_zones = '<?= _pgettext("Map Options", "CQ Zones"); ?>';
var lang_gen_hamradio_itu_zones = '<?= _pgettext("Map Options", "ITU Zones"); ?>';
var lang_gen_hamradio_nightshadow = '<?= _pgettext("Map Options", "Night Shadow"); ?>';
var lang_gen_hamradio_ituzone = '<?= __("ITU Zone"); ?>';
var lang_gen_hamradio_cqzone = '<?= __("CQ Zone"); ?>';
var lang_gen_advanced_logbook_help = '<?= __("Advanced Logbook Help"); ?>';
let lang_gen_hamradio_latitude = '<?= __("Latitude"); ?>';
let lang_gen_hamradio_longitude = '<?= __("Longitude"); ?>';
let lang_gen_hamradio_gridsquare = '<?= __("Gridsquare"); ?>';
let lang_gen_hamradio_gridsquares = '<?= _pgettext("Map Options", "Gridsquares"); ?>';
let lang_gen_hamradio_distance = '<?= __("Distance"); ?>';
let lang_gen_hamradio_bearing = '<?= __("Bearing"); ?>';
let lang_gen_hamradio_pathlines = '<?= _pgettext("Map Options", "Path lines"); ?>';
let lang_gen_hamradio_callsigns = '<?= __("Show Callsigns"); ?>';
let lang_gen_hamradio_cq_zones = '<?= _pgettext("Map Options", "CQ Zones"); ?>';
let lang_gen_hamradio_itu_zones = '<?= _pgettext("Map Options", "ITU Zones"); ?>';
let lang_gen_hamradio_nightshadow = '<?= _pgettext("Map Options", "Night Shadow"); ?>';
let lang_gen_hamradio_ituzone = '<?= __("ITU Zone"); ?>';
let lang_gen_hamradio_cqzone = '<?= __("CQ Zone"); ?>';
let lang_gen_advanced_logbook_help = '<?= __("Advanced Logbook Help"); ?>';
let lang_gen_advanced_logbook_continent_fix = '<?= __("Continent fix"); ?>';
let lang_gen_advanced_logbook_problem_fixing_itu_zones = '<?= __("There was a problem fixing ITU Zones."); ?>';
let lang_gen_advanced_logbook_problem_fixing_cq_zones = '<?= __("There was a problem fixing CQ Zones."); ?>';
let lang_gen_advanced_logbook_itu_zones_updated = '<?= __("ITU Zones updated successfully!"); ?>';
let lang_gen_advanced_logbook_cq_zones_updated = '<?= __("CQ Zones updated successfully!"); ?>';
let lang_gen_advanced_logbook_select_row_itu_zones = '<?= __("You need to select at least 1 row to fix ITU Zones!"); ?>';
let lang_gen_advanced_logbook_select_row_cq_zones = '<?= __("You need to select at least 1 row to fix CQ Zones!"); ?>';
let lang_gen_advanced_logbook_select_only_one_row_quickfilter = '<?= __("Only 1 row can be selected for Quickfilter!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_quickfilter = '<?= __("You need to select a row to use the Quickfilters!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_qslcard = '<?= __("You need to select a least 1 row to display a QSL card!"); ?>';
let lang_gen_advanced_logbook_error = '<?= __("ERROR"); ?>';
let lang_gen_advanced_logbook_success = '<?= __("SUCCESS"); ?>';
let lang_gen_advanced_logbook_info = '<?= __("INFO"); ?>';
let lang_gen_advanced_logbook_warning = '<?= __("WARNING"); ?>';
let lang_gen_advanced_logbook_qsl_card = '<?= __("QSL Card"); ?>';
let lang_gen_advanced_logbook_close = '<?= __("Close"); ?>';
let lang_gen_advanced_logbook_save = '<?= __("Save"); ?>';
let lang_gen_advanced_logbook_options = '<?= __("'Options for the Advanced Logbook'"); ?>';
let lang_gen_advanced_logbook_label_print_error = '<?= __("Something went wrong with label print. Go to labels and check if you have defined a label, and that it is set for print!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row = '<?= __("You need to select a least 1 row!"); ?>';
let lang_gen_advanced_logbook_start_printing_at_which_label = '<?= __("Start printing at which label?"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_label = '<?= __("You need to select at least 1 row to print a label!"); ?>';
let lang_gen_advanced_logbook_error_saving_options = '<?= __("An error occurred while saving options: "); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_delete = '<?= __("You need to select a least 1 row to delete!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_callbook = '<?= __("You need to select a least 1 row to update from callbook!"); ?>';
let lang_gen_advanced_logbook_an_error_ocurred_while_making_request = '<?= __("An error ocurred while making the request"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_location = '<?= __("You need to select at least 1 location to do a search!"); ?>';
let homegrid ='<?php echo strtoupper($homegrid[0]); ?>';
<?php
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
if (!isset($options)) {
$options = "{
\"datetime\":{\"show\":\"true\"},
@@ -699,6 +727,8 @@ $options = json_decode($options);
<button type="button" class="btn btn-sm btn-info dropdown-action" id="qslSlideshow"><?= __("QSL Slideshow"); ?></button>
<button type="button" class="btn btn-sm btn-success dropdown-action" id="fixCqZones"><?= __("Fix CQ Zones"); ?></button>
<button type="button" class="btn btn-sm btn-success dropdown-action" id="fixItuZones"><?= __("Fix ITU Zones"); ?></button>
<button type="button" class="btn btn-sm btn-success dropdown-action" id="fixContinent"><?= __("Fix Continent"); ?></button>
<button type="button" class="btn btn-sm btn-success dropdown-action" id="updateDistances"><?= __("Update Distances"); ?></button>
</div>
</div>
</div>

View File

@@ -574,8 +574,8 @@ $(document).ready(function () {
let qsoids = '';
if (Array.isArray(selectedlocations) && selectedlocations.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select at least 1 location to do a search!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_location,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -671,8 +671,8 @@ $(document).ready(function () {
error: function (data) {
$('#searchButton').prop("disabled", false).removeClass("running");
BootstrapDialog.alert({
title: 'ERROR',
message: 'An error ocurred while making the request',
title: lang_gen_advanced_logbook_error,
message: lang_gen_advanced_logbook_an_error_ocurred_while_making_request,
type: BootstrapDialog.TYPE_DANGER,
closable: false,
draggable: false,
@@ -699,8 +699,8 @@ $(document).ready(function () {
var nElements = elements.length;
if (nElements == 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a least 1 row to update from callbook!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row_callbook,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -742,7 +742,7 @@ $(document).ready(function () {
buttons: [
{
label: lang_admin_close,
cssClass: 'btn-sm',
cssClass: 'btn-sm btn-secondary',
id: 'closeButton',
action: function (dialogItself) {
$('#optionButton').prop("disabled", false);
@@ -763,8 +763,8 @@ $(document).ready(function () {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a least 1 row to delete!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row_delete,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -970,7 +970,7 @@ $(document).ready(function () {
type: 'post',
success: function (html) {
BootstrapDialog.show({
title: 'Options for the Advanced Logbook',
title: lang_gen_advanced_logbook_options,
size: BootstrapDialog.SIZE_NORMAL,
cssClass: 'options',
nl2br: false,
@@ -978,7 +978,7 @@ $(document).ready(function () {
onshown: function(dialog) {
},
buttons: [{
label: 'Save',
label: lang_gen_advanced_logbook_save,
cssClass: 'btn-primary btn-sm',
id: 'saveButton',
action: function (dialogItself) {
@@ -989,11 +989,11 @@ $(document).ready(function () {
location.reload();
}).catch(error => {
BootstrapDialog.alert({
title: 'Error',
message: 'An error occurred while saving options: ' + error,
title: lang_gen_advanced_logbook_error,
message: lang_gen_advanced_logbook_error_saving_options + error,
type: BootstrapDialog.TYPE_DANGER, // Sets the dialog style to "danger"
closable: true,
buttonLabel: 'Close'
buttonLabel: lang_gen_advanced_logbook_close
});
});
}
@@ -1020,8 +1020,8 @@ $(document).ready(function () {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a least 1 row to display a QSL card!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row_qslcard,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1040,7 +1040,7 @@ $(document).ready(function () {
},
success: function (html) {
BootstrapDialog.show({
title: 'QSL Card',
title: lang_gen_advanced_logbook_qsl_card,
size: BootstrapDialog.SIZE_WIDE,
cssClass: 'lookup-dialog',
nl2br: false,
@@ -1068,8 +1068,8 @@ $(document).ready(function () {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select at least 1 row to fix CQ Zones!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_row_cq_zones,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1091,28 +1091,66 @@ $(document).ready(function () {
});
}
BootstrapDialog.alert({
title: 'SUCCESS',
message: 'CQ Zones updated successfully!',
title: lang_gen_advanced_logbook_success,
message: lang_gen_advanced_logbook_cq_zones_updated,
type: BootstrapDialog.TYPE_SUCCESS
});
},
error: function () {
BootstrapDialog.alert({
title: 'ERROR',
message: 'There was a problem fixing CQ Zones.',
title: lang_gen_advanced_logbook_error,
message: lang_gen_advanced_logbook_problem_fixing_cq_zones,
type: BootstrapDialog.TYPE_DANGER
});
}
});
});
$('#fixContinent').click(function (event) {
$.ajax({
url: base_url + 'index.php/logbookadvanced/continentDialog',
type: 'post',
success: function (html) {
BootstrapDialog.show({
title: lang_gen_advanced_logbook_continent_fix,
size: BootstrapDialog.SIZE_NORMAL,
cssClass: 'options',
nl2br: false,
message: html,
buttons: [
{
label: 'Update now',
cssClass: 'btn btn-sm btn-primary',
id: 'closeButton',
action: function (dialogItself) {
$('#optionButton').prop("disabled", false);
dialogItself.close();
}
},
{
label: lang_admin_close,
cssClass: 'btn btn-sm btn-secondary',
id: 'closeButton',
action: function (dialogItself) {
$('#optionButton').prop("disabled", false);
dialogItself.close();
}
}],
onhide: function(dialogRef){
$('#optionButton').prop("disabled", false);
},
});
}
});
});
$('#fixItuZones').click(function (event) {
const id_list = getSelectedIds();
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select at least 1 row to fix ITU Zones!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_row_itu_zones,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1136,15 +1174,15 @@ $(document).ready(function () {
});
}
BootstrapDialog.alert({
title: 'SUCCESS',
message: 'ITU Zones updated successfully!',
title: lang_gen_advanced_logbook_success,
message: lang_gen_advanced_logbook_itu_zones_updated,
type: BootstrapDialog.TYPE_SUCCESS
});
},
error: function () {
BootstrapDialog.alert({
title: 'ERROR',
message: 'There was a problem fixing ITU Zones.',
title: lang_gen_advanced_logbook_error,
message: lang_gen_advanced_logbook_problem_fixing_itu_zones,
type: BootstrapDialog.TYPE_DANGER
});
}
@@ -1174,8 +1212,8 @@ $(document).ready(function () {
var nElements = elements.length;
if (nElements == 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a row to use the Quickfilters!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row_quickfilter,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1186,8 +1224,8 @@ $(document).ready(function () {
}
if (nElements > 1) {
BootstrapDialog.alert({
title: 'WARNING',
message: 'Only 1 row can be selected for Quickfilter!',
title: lang_gen_advanced_logbook_warning,
message: lang_gen_advanced_logbook_select_only_one_row_quickfilter,
type: BootstrapDialog.TYPE_WARNING,
closable: false,
draggable: false,
@@ -1314,8 +1352,8 @@ $(document).ready(function () {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select at least 1 row to print a label!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row_label,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1331,7 +1369,7 @@ $(document).ready(function () {
type: 'post',
success: function (html) {
BootstrapDialog.show({
title: 'Start printing at which label?',
title: lang_gen_advanced_logbook_start_printing_at_which_label,
size: BootstrapDialog.SIZE_NORMAL,
cssClass: 'qso-dialog',
nl2br: false,
@@ -1396,8 +1434,8 @@ function handleQsl(sent, method, tag) {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a least 1 row!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1433,8 +1471,8 @@ function handleQslReceived(sent, method, tag) {
if (id_list.length === 0) {
BootstrapDialog.alert({
title: 'INFO',
message: 'You need to select a least 1 row!',
title: lang_gen_advanced_logbook_info,
message: lang_gen_advanced_logbook_select_at_least_one_row,
type: BootstrapDialog.TYPE_INFO,
closable: false,
draggable: false,
@@ -1502,8 +1540,8 @@ function printlabel(id_list) {
},
error: function (data) {
BootstrapDialog.alert({
title: 'ERROR',
message: 'Something went wrong with label print. Go to labels and check if you have defined a label, and that it is set for print!',
title: lang_gen_advanced_logbook_error,
message: lang_gen_advanced_logbook_label_print_error,
type: BootstrapDialog.TYPE_DANGER,
closable: false,
draggable: false,