Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quicklog Bug Fixes #2657

Merged
merged 11 commits into from
Nov 7, 2023
Merged
4 changes: 2 additions & 2 deletions application/views/interface_assets/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ function searchButtonPress(){

$(document).ready(function(){

<?php if($this->input->post('callsign') != "") { ?>
$('#partial_view').load("logbook/search_result/<?php echo str_replace("Ø","0",$this->input->post('callsign')); ?>", function() {
<?php if($this->input->post('searchBar') != "") { ?>
$('#partial_view').load("logbook/search_result/<?php echo str_replace("Ø","0",$this->input->post('searchBar')); ?>", function() {
$('[data-toggle="tooltip"]').tooltip()
});
<?php } ?>
Expand Down
23 changes: 12 additions & 11 deletions application/views/interface_assets/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,16 @@ function submitForm(action) {
if (action === 'search') {
form.action = "<?php echo site_url('search'); ?>";
form.method = "post";
} else if (action === 'qso') {
form.action = "<?php echo site_url('qso'); ?>";
form.method = "get";
input.name = "manual";
input.value = "0"; // Set to 1 if go to "Post-QSO" logging
}
form.submit();
}
function logQuicklog() {
if (localStorage.getItem("quicklogCallsign") !== "") {
localStorage.removeItem("quicklogCallsign");
}
localStorage.setItem("quicklogCallsign", $("input[name='searchBar']").val());
window.open("<?php echo site_url('qso?manual=0'); ?>", "_self");
}
</script>
<?php if ($this->session->userdata('user_quicklog_enter') == 1) { ?>
<script>
Expand All @@ -258,26 +260,25 @@ function handleKeyPress(event) {
<script>
function handleKeyPress(event) {
if (event.key === 'Enter') {
submitForm('qso'); // Treat Enter key press as clicking the 'quicksearch-log' button
logQuicklog(); // Treat Enter key press as clicking the 'quicksearch-log' button
}
}
</script>
<?php } ?>
<form id="quicklog-form" class="form-inline">
<input class="form-control mr-sm-2" id="nav-bar-search-input" type="search" name="callsign" placeholder="<?php echo lang('menu_search_text_quicklog'); ?>" aria-label="Search" onkeypress="handleKeyPress(event)">
<form id="quicklog-form" class="form-inline" onsubmit="return false;">
<input class="form-control mr-sm-2" id="nav-bar-search-input" type="text" name="searchBar" placeholder="<?php echo lang('menu_search_text_quicklog'); ?>" aria-label="Quicklog" onkeypress="handleKeyPress(event)">

<button title="<?php echo lang('menu_search_button_qicksearch_log'); ?>" class="btn btn-outline-success my-2 my-sm-0" type="button" onclick="submitForm('qso')"><i class="fas fa-plus"></i>
<button title="<?php echo lang('menu_search_button_qicksearch_log'); ?>" class="btn btn-outline-success my-2 my-sm-0" type="button" onclick="logQuicklog()"><i class="fas fa-plus"></i>
<div class="d-inline d-lg-none" style="padding-left: 10px"><?php echo lang('menu_search_button_qicksearch_log'); ?></div>
</button>
<input type="hidden" id="quicklog-input">

<button title="<?php echo lang('menu_search_button'); ?>" class="btn btn-outline-success my-2 my-sm-0" type="button" onclick="submitForm('search')" style="margin-left: 5px"><i class="fas fa-search"></i>
<div class="d-inline d-lg-none" style="padding-left: 10px"><?php echo lang('menu_search_button'); ?></div>
</button>
</form>
<?php } else { ?>
<form method="post" action="<?php echo site_url('search'); ?>" class="form-inline">
<input class="form-control mr-sm-2" id="nav-bar-search-input" type="search" name="callsign" placeholder="<?php echo lang('menu_search_text'); ?>" aria-label="Search">
<input class="form-control mr-sm-2" id="nav-bar-search-input" type="search" name="searchBar" placeholder="<?php echo lang('menu_search_text'); ?>" aria-label="Search">
<button title="<?php echo lang('menu_search_button'); ?>" class="btn btn-outline-success my-2 my-sm-0" type="submit"><i class="fas fa-search"></i>
<div class="d-inline d-lg-none" style="padding-left: 10px"><?php echo lang('menu_search_button'); ?></div>
</button>
Expand Down
2 changes: 1 addition & 1 deletion application/views/qso/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<div class="form-row">
<div class="form-group col-md-9">
<label for="callsign"><?php echo lang('gen_hamradio_callsign'); ?></label><?php if ($this->optionslib->get_option('dxcache_url') != '') { ?>&nbsp;<i id="check_cluster" data-toggle="tooltip" data-original-title="Search DXCluster for latest Spot" class="fas fa-search"></i> <?php } ?>
<input type="text" class="form-control" id="callsign" name="callsign" value="<?php echo !empty($_GET['callsign']) ? $_GET['callsign'] : ''; ?>" required>
<input type="text" class="form-control" id="callsign" name="callsign" required>
<small id="callsign_info" class="badge badge-secondary"></small> <a id="lotw_link"><small id="lotw_info" class="badge badge-success"></small></a>
</div>
<div class="form-group col-md-3 align-self-center">
Expand Down
2 changes: 1 addition & 1 deletion application/views/search/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="form-group row">
<label for="callsign" class="col-sm-2 col-form-label">Callsign / Gridsquare</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="callsign" value="<?php if ($this->input->post('callsign') !== null) { echo htmlspecialchars($this->input->post('callsign')); }; ?>">
<input type="text" class="form-control" id="callsign" value="<?php if ($this->input->post('searchBar') !== null) { echo htmlspecialchars($this->input->post('searchBar')); }; ?>">
</div>
<div class="col-sm-2">
<button onclick="searchButtonPress()" class="btn btn-outline-success my-2 my-sm-0" type="submit"><i class="fas fa-search"></i> Search</button>
Expand Down
9 changes: 8 additions & 1 deletion assets/js/sections/qso.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
$( document ).ready(function() {

setTimeout(function() {
var callsignValue = localStorage.getItem("quicklogCallsign");
if (callsignValue !== "") {
$("#callsign").val(callsignValue);
$("#mode").focus();
localStorage.removeItem("quicklogCallsign");
}
}, 100);
var favs={};
get_fav();

Expand Down