mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Last QSO count to session to fix last of specific callsign (#3)
This commit is contained in:
@@ -74,7 +74,7 @@ class Logbook extends CI_Controller {
|
||||
echo json_encode($return, JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null, $date = "") {
|
||||
function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null, $date = "", $count = 5) {
|
||||
session_write_close();
|
||||
if (($date ?? '') != '') {
|
||||
$date=date("Y-m-d",strtotime($date));
|
||||
@@ -132,7 +132,7 @@ class Logbook extends CI_Controller {
|
||||
|
||||
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname'));
|
||||
|
||||
$return['partial'] = $this->partial($lookupcall, $callbook, $callsign, $return['dxcc'], $lotw_days, $band);
|
||||
$return['partial'] = $this->partial($lookupcall, $callbook, $callsign, $return['dxcc'], $lotw_days, $band, $count);
|
||||
|
||||
if ($this->session->userdata('user_measurement_base') == NULL) {
|
||||
$measurement_base = $this->config->item('measurement_base');
|
||||
@@ -615,7 +615,7 @@ class Logbook extends CI_Controller {
|
||||
$this->load->view('interface_assets/footer');
|
||||
}
|
||||
|
||||
function partial($lookupcall, $callbook, $callsign, $dxcc, $lotw_days, $band = null) {
|
||||
function partial($lookupcall, $callbook, $callsign, $dxcc, $lotw_days, $band = null, $count = 5) {
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
|
||||
|
||||
@@ -640,7 +640,7 @@ class Logbook extends CI_Controller {
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "desc");
|
||||
$this->db->limit(5);
|
||||
$this->db->limit($count);
|
||||
|
||||
$query = $this->db->get();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ class QSO extends CI_Controller {
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
||||
$this->session->set_userdata('last_qsos_count', self::LAST_QSOS_COUNT);
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -36,7 +37,7 @@ class QSO extends CI_Controller {
|
||||
$data['stations'] = $this->stations->all_of_user();
|
||||
$data['radios'] = $this->cat->radios(true);
|
||||
$data['radio_last_updated'] = $this->cat->last_updated()->row();
|
||||
$data['query'] = $this->logbook_model->last_custom(self::LAST_QSOS_COUNT);
|
||||
$data['query'] = $this->logbook_model->last_custom($this->session->userdata('last_qsos_count'));
|
||||
$data['dxcc'] = $this->logbook_model->fetchDxcc();
|
||||
$data['iota'] = $this->logbook_model->fetchIota();
|
||||
$data['modes'] = $this->modes->active();
|
||||
@@ -86,7 +87,7 @@ class QSO extends CI_Controller {
|
||||
$data['user_dok_to_qso_tab'] = 0;
|
||||
}
|
||||
|
||||
$data['qso_count'] = self::LAST_QSOS_COUNT;
|
||||
$data['qso_count'] = $this->session->userdata('last_qsos_count');
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -605,7 +606,7 @@ class QSO extends CI_Controller {
|
||||
$this->load->model('logbook_model');
|
||||
session_write_close();
|
||||
|
||||
$data['query'] = $this->logbook_model->last_custom(self::LAST_QSOS_COUNT);
|
||||
$data['query'] = $this->logbook_model->last_custom($this->session->userdata('last_qsos_count'));
|
||||
|
||||
// Load view
|
||||
$this->load->view('qso/components/previous_contacts', $data);
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
$profile_info = $this->stations->profile($actstation)->row();
|
||||
echo "var activeStationTXPower = '".xss_clean($profile_info->station_power ?? 0)."';\n";
|
||||
echo "var activeStationOP = '".xss_clean($this->session->userdata('operator_callsign'))."';\n";
|
||||
echo "var last_qsos_count = ".$this->session->userdata('last_qsos_count')."\n";
|
||||
}
|
||||
?>
|
||||
</script>
|
||||
|
||||
@@ -623,7 +623,7 @@ $("#callsign").on("focusout", function () {
|
||||
find_callsign = find_callsign.replaceAll('Ø', '0');
|
||||
|
||||
// Replace / in a callsign with - to stop urls breaking
|
||||
lookupCall = $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val() + '/' + $('#start_date').val(), async function (result) {
|
||||
lookupCall = $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val() + '/' + $('#start_date').val() + '/' + last_qsos_count, async function (result) {
|
||||
|
||||
// Make sure the typed callsign and json result match
|
||||
if ($('#callsign').val().toUpperCase().replaceAll('Ø', '0') == result.callsign) {
|
||||
|
||||
Reference in New Issue
Block a user