Merge pull request #2711 from magicbug/dev

2.5.2
pull/2694/head 2.5.2
Peter Goodhall 2023-11-20 14:31:01 +00:00 zatwierdzone przez GitHub
commit ff3738e2bf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
16 zmienionych plików z 158 dodań i 66 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 152;
$config['migration_version'] = 153;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -14,11 +14,13 @@ class Components extends CI_Controller {
}
public function index() {
$this->load->model('stations');
$url = 'https://oscarwatch.org/scripts/hamsat_json.php';
$json = file_get_contents($url);
$data['rovedata'] = json_decode($json, true);
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());
// load view
$this->load->view('components/hamsat/table', $data);
}
}
}

Wyświetl plik

@ -52,9 +52,11 @@ class Debug extends CI_Controller {
// Check if the subdirectories are writable (recursive check)
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
foreach ($iterator as $item) {
if (!is_writable($item->getPathname())) {
return false;
}
if ($item->isDir() && basename($item->getPathName()) != '..') {
if (!is_writable($item->getRealPath())) {
return false;
}
}
}
return true;

Wyświetl plik

@ -168,7 +168,7 @@ class Logbook extends CI_Controller {
$return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $type, $band, $mode);
if ($this->session->userdata('user_show_profile_image')) {
if (isset($callbook)) {
if (isset($callbook) && isset($callbook['image'])) {
if ($callbook['image'] == "") {
$return['image'] = "n/a";
} else {
@ -851,14 +851,40 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
}
$data= $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
if (empty($data['callsign']))
{
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$data = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
if (empty($callsign['callsign']['callsign'])) {
$qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password'));
$this->session->set_userdata('qrz_session_key', $qrz_session_key);
$callsign['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
}
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
// Load the HamQTH library
$this->load->library('hamqth');
if(!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
$callsign['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
// If HamQTH session has expired, start a new session and retry the search.
if($callsign['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$callsign['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
}
if (isset($data['callsign']['gridsquare'])) {
$CI = &get_instance();
$CI->load->model('logbook_model');
$callsign['grid_worked'] = $CI->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
}
if (isset($callsign['callsign']['error'])) {
$callsign['error'] = $callsign['callsign']['error'];
}
} else {
$callsign['error'] = 'Lookup not configured. Please review configuration.';
}
// There's no hamli integration? Disabled for now.
@ -866,12 +892,20 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
// Lookup using hamli
$this->load->library('hamli');
$data['callsign'] = $this->hamli->callsign($id);
$callsign['callsign'] = $this->hamli->callsign($id);
}*/
$data['id'] = strtoupper($id);
if (isset($callsign['callsign']['gridsquare'])) {
$CI = &get_instance();
$CI->load->model('logbook_model');
$callsign['grid_worked'] = $CI->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($callsign['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
}
if (isset($callsign['callsign']['error'])) {
$callsign['error'] = $callsign['callsign']['error'];
}
$callsign['id'] = strtoupper($id);
return $this->load->view('search/result', $data, true);
return $this->load->view('search/result', $callsign, true);
}
}
@ -927,8 +961,33 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
if (isset($data['callsign']['error'])) {
$data['error'] = $data['callsign']['error'];
}
} else if ($this->config->item('callbook') == "hamqth" && $this->config->item('hamqth_username') != null && $this->config->item('hamqth_password') != null) {
// Load the HamQTH library
$this->load->library('hamqth');
if(!$this->session->userdata('hamqth_session_key')) {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
}
$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
// If HamQTH session has expired, start a new session and retry the search.
if($data['callsign']['error'] == "Session does not exist or expired") {
$hamqth_session_key = $this->hamqth->session($this->config->item('hamqth_username'), $this->config->item('hamqth_password'));
$this->session->set_userdata('hamqth_session_key', $hamqth_session_key);
$data['callsign'] = $this->hamqth->search($callsign, $this->session->userdata('hamqth_session_key'));
}
if (isset($data['callsign']['gridsquare'])) {
$CI = &get_instance();
$CI->load->model('logbook_model');
$data['grid_worked'] = $CI->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
}
if (isset($data['callsign']['error'])) {
$data['error'] = $data['callsign']['error'];
}
} else {
$data['error'] = 'No result (qrz not configured)';
$data['error'] = 'Lookup not configured. Please review configuration.';
} /*else {
// Lookup using hamli
$this->load->library('hamli');

Wyświetl plik

@ -27,7 +27,6 @@ class Curl {
function __construct($url = '')
{
$this->_ci = & get_instance();
log_message('debug', 'cURL Class Initialized');
if ( ! $this->is_enabled())
{
@ -369,4 +368,4 @@ class Curl {
}
/* End of file Curl.php */
/* Location: ./application/libraries/Curl.php */
/* Location: ./application/libraries/Curl.php */

Wyświetl plik

@ -71,7 +71,7 @@ class Hamqth {
// Create XML object
$xml = simplexml_load_string($xml);
if (empty($xml)) return;
if (!empty($xml->session->error)) return $data['error'] = $xml->session->error;
// Return Required Fields
$data['callsign'] = (string)$xml->search->callsign;

Wyświetl plik

@ -0,0 +1,24 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
* Tag Cloudlog as 2.5.1
*/
class Migration_tag_2_5_2 extends CI_Migration {
public function up()
{
// Tag Cloudlog 2.5.1
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.5.2'));
}
public function down()
{
$this->db->where('option_name', 'version');
$this->db->update('options', array('option_value' => '2.5.1'));
}
}

Wyświetl plik

@ -433,8 +433,7 @@ class Logbook_model extends CI_Model {
$this->db->limit(500);
$result = $this->db->get($this->config->item('table_name'));
log_message('debug', 'SQL: '.$this->db->last_query());
return $result;
return $result;
//return $this->db->get($this->config->item('table_name'));
}
@ -501,6 +500,7 @@ class Logbook_model extends CI_Model {
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->join('dxcc_entities', 'dxcc_entities.adif = '.$this->config->item('table_name').'.COL_DXCC', 'left outer');
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
$this->db->where('COL_CALL', $call);
if ($band != 'All') {
if ($band == 'SAT') {
@ -4083,6 +4083,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
$this->db->where("((COL_DISTANCE is NULL) or (COL_DISTANCE = 0))");
$this->db->where("COL_GRIDSQUARE is NOT NULL");
$this->db->where("COL_GRIDSQUARE != ''");
$this->db->where("COL_GRIDSQUARE != station_gridsquare");
$this->db->trans_start();
$query = $this->db->get($this->config->item('table_name'));
@ -4117,7 +4118,6 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
$this->db->select('COL_PRIMARY_KEY, COL_TIME_ON, COL_CALL, COL_MODE, COL_BAND');
$this->db->where('station_id =', NULL);
$query = $this->db->get($this->config->item('table_name'));
log_message('debug','SQL: '.$this->db->last_query());
if($query->num_rows() >= 1) {
return $query->result();
} else {

Wyświetl plik

@ -17,6 +17,7 @@
<th>Satellite</th>
<th>Gridsquare(s)</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@ -92,6 +93,15 @@
</td>
<td><a href="<?php echo $rove['track_link']; ?>" target="_blank">Track</a></td>
<?php
$sat = $rove['satellite'];
switch (strtoupper($rove['satellite'])) {
case "GREENCUBE":
$sat = 'IO-117';
break;
}
?>
<td><a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['gridsquare']; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a></td>
</tr>
<?php endforeach; ?>
</tbody>

Wyświetl plik

@ -1,3 +1,3 @@
<div class="container">
<div id="hamsat_display" hx-get="<?php echo site_url('components'); ?>" hx-trigger="load, every 60s"></div>
</div>
</div>

Wyświetl plik

@ -1000,37 +1000,6 @@ $(document).on('keypress',function(e) {
}
);
});
$('#reset_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
$("[id='start_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
$('#reset_start_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='start_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='end_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
$('#reset_end_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='end_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
});
</script>

Wyświetl plik

@ -37,7 +37,7 @@ if ($qsos->result() != NULL) {
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo '</td>';
echo '<td style=\'text-align: center\'>'; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo '</td>';
echo '<td style=\'text-align: center\'>'; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo '</td>';
echo '<td style=\'text-align: center\'>'; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo '</td>';
echo '<td style=\'text-align: center\'>'; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND ?? ""); }; echo '</td>';
echo '<td style=\'text-align: center\'><span class="badge badge-light">' . $qsl->station_callsign . '</span></td>';
echo '<td style=\'text-align: center\'>' . $qsl->COL_QSL_VIA . '</td>';
echo '<td style=\'text-align: center\'>'; echo_qsl_sent_via($qsl->COL_QSL_SENT_VIA); echo '</td>';

Wyświetl plik

@ -55,12 +55,12 @@
<div class="form-row">
<div class="form-group col-sm-6">
<label for="start_date">Start Date/Time</label>
<input type="text" class="form-control form-control-sm input_date" name="time_on" id="time_on" value="<?php echo $qso->COL_TIME_ON; ?>">
<input type="text" class="form-control form-control-sm" name="time_on" id="time_on" value="<?php echo $qso->COL_TIME_ON; ?>">
</div>
<div class="form-group col-sm-6">
<label for="start_time">End Date/Time</label>
<input type="text" class="form-control form-control-sm input_time" name="time_off" id="time_off" value="<?php echo $qso->COL_TIME_OFF; ?>">
<input type="text" class="form-control form-control-sm" name="time_off" id="time_off" value="<?php echo $qso->COL_TIME_OFF; ?>">
</div>
</div>
<div class="form-row">
@ -187,7 +187,7 @@
<div class="form-group">
<label for="comment">Comment</label>
<input type="text" class="form-control" id="comment" name="comment" value="<?php echo $qso->COL_COMMENT; ?>">
<input type="text" class="form-control" id="comment" name="comment" value="<?php echo htmlspecialchars($qso->COL_COMMENT ? $qso->COL_COMMENT : '', ENT_QUOTES, 'UTF-8'); ?>">
</div>
<div class="form-row">

Wyświetl plik

@ -102,7 +102,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<td>
<a id="edit_qso" href="javascript:displayQso(<?php echo $row->COL_PRIMARY_KEY; ?>)"><?php echo str_replace("0","&Oslash;",strtoupper($row->COL_CALL)); ?></a>
<?php
if ($row->lastupload) {
if (isset($row->lastupload) && ($row->lastupload)) {
$lotw_hint = '';
$diff = (time() - strtotime($row->lastupload)) / 86400;
if ($diff > 365) {

Wyświetl plik

@ -552,10 +552,6 @@ div#station_logbooks_linked_table_paginate {
margin-right: 30px;
}
input:invalid {
border-color: red;
}
.sfletable{
height: 470px;
}

Wyświetl plik

@ -1,12 +1,43 @@
$( document ).ready(function() {
setTimeout(function() {
var callsignValue = localStorage.getItem("quicklogCallsign");
if (callsignValue !== "") {
if (callsignValue !== null && callsignValue !== undefined) {
$("#callsign").val(callsignValue);
$("#mode").focus();
localStorage.removeItem("quicklogCallsign");
}
}, 100);
}, 100);
$('#reset_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
$("[id='start_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
$('#reset_start_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#start_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='start_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='end_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
$('#reset_end_time').click(function() {
var now = new Date();
var localTime = now.getTime();
var utc = localTime + (now.getTimezoneOffset() * 60000);
$('#end_time').val(("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2));
$("[id='end_time']").each(function() {
$(this).attr("value", ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
});
});
var favs={};
get_fav();