Skip to content

Commit 9e502ea

Browse files
authored
Release 2.4.2
2 parents 8654e9e + b6edce8 commit 9e502ea

File tree

92 files changed

+3232
-993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+3232
-993
lines changed

application/config/migration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
| be upgraded / downgraded to.
2222
|
2323
*/
24-
$config['migration_version'] = 116;
24+
$config['migration_version'] = 121;
2525

2626
/*
2727
|--------------------------------------------------------------------------

application/controllers/Api.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -672,14 +672,14 @@ function radio() {
672672
*
673673
*/
674674

675-
function statistics() {
675+
function statistics($key = null) {
676676
header('Content-type: application/json');
677677
$this->load->model('logbook_model');
678678

679-
$data['todays_qsos'] = $this->logbook_model->todays_qsos();
680-
$data['total_qsos'] = $this->logbook_model->total_qsos();
681-
$data['month_qsos'] = $this->logbook_model->month_qsos();
682-
$data['year_qsos'] = $this->logbook_model->year_qsos();
679+
$data['todays_qsos'] = $this->logbook_model->todays_qsos(null, $key);
680+
$data['total_qsos'] = $this->logbook_model->total_qsos(null, $key);
681+
$data['month_qsos'] = $this->logbook_model->month_qsos(null, $key);
682+
$data['year_qsos'] = $this->logbook_model->year_qsos(null, $key);
683683

684684
http_response_code(201);
685685
echo json_encode(['Today' => $data['todays_qsos'], 'total_qsos' => $data['total_qsos'], 'month_qsos' => $data['month_qsos'], 'year_qsos' => $data['year_qsos']]);
@@ -841,4 +841,4 @@ function qralatlng($qra) {
841841
$latlng = $this->qra->qra2latlong($qra);
842842
return $latlng;
843843
}
844-
}
844+
}

application/controllers/Awards.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public function qso_details_ajax(){
268268
$qsltype[] = "QSL";
269269
}
270270
if (strpos($qsl, "L") !== false) {
271-
$qsltype[] = "LotW";
271+
$qsltype[] = "LoTW";
272272
}
273273
if (strpos($qsl, "E") !== false) {
274274
$qsltype[] = "eQSL";

application/controllers/Backup.php

+26-11
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,33 @@ public function index()
2020
}
2121

2222
/* Gets all QSOs and Dumps them to logbook.adi */
23-
public function adif(){
23+
public function adif($key = null){
24+
if ($key == null) {
25+
$this->load->model('user_model');
26+
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
27+
}
28+
2429
$this->load->helper('file');
2530
// Set memory limit to unlimited to allow heavy usage
2631
ini_set('memory_limit', '-1');
2732

2833
$this->load->model('adif_data');
2934

30-
$data['qsos'] = $this->adif_data->export_all();
35+
$data['qsos'] = $this->adif_data->export_all($key);
3136

32-
if ( ! write_file('backup/logbook.adi', $this->load->view('backup/exportall', $data, true)))
37+
$data['filename'] = 'backup/logbook'. date('_Y_m_d_H_i_s') .'.adi';
38+
39+
if ( ! write_file($data['filename'], $this->load->view('backup/exportall', $data, true)))
3340
{
34-
$data['status'] = false;
41+
$data['status'] = false;
3542
}
3643
else
3744
{
38-
$data['status'] = true;
45+
$data['status'] = true;
3946
}
4047

4148
$data['page_title'] = "ADIF - Backup";
49+
4250

4351
$this->load->view('interface_assets/header', $data);
4452
$this->load->view('backup/adif_view');
@@ -47,19 +55,26 @@ public function adif(){
4755
}
4856

4957
/* Export the notes to XML */
50-
public function notes() {
58+
public function notes($key = null) {
59+
if ($key == null) {
60+
$this->load->model('user_model');
61+
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
62+
}
63+
5164
$this->load->helper('file');
5265
$this->load->model('note');
5366

54-
$data['list_note'] = $this->note->list_all();
67+
$data['list_note'] = $this->note->list_all($key);
68+
69+
$data['filename'] = 'backup/notes'. date('_Y_m_d_H_i_s') .'.xml';
5570

56-
if ( ! write_file('backup/notes.xml', $this->load->view('backup/notes', $data, true)))
71+
if ( ! write_file($data['filename'], $this->load->view('backup/notes', $data, true)))
5772
{
58-
$data['status'] = false;
73+
$data['status'] = false;
5974
}
6075
else
6176
{
62-
$data['status'] = true;
77+
$data['status'] = true;
6378
}
6479

6580
$data['page_title'] = "Notes - Backup";
@@ -71,4 +86,4 @@ public function notes() {
7186
}
7287
}
7388

74-
/* End of file Backup.php */
89+
/* End of file Backup.php */

application/controllers/Cabrillo.php

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?php
2+
3+
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
4+
5+
6+
/*
7+
This controller contains features for Cabrillo
8+
*/
9+
10+
class Cabrillo extends CI_Controller {
11+
12+
function __construct() {
13+
parent::__construct();
14+
15+
$this->load->model('user_model');
16+
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
17+
}
18+
19+
public function index() {
20+
$data['page_title'] = "Export Cabrillo";
21+
22+
$this->load->model('Contesting_model');
23+
$this->load->model('stations');
24+
25+
$data['station_profile'] = $this->stations->all_of_user();
26+
$active_station_id = $this->stations->find_active();
27+
$station_profile = $this->stations->profile($active_station_id);
28+
29+
$data['active_station_info'] = $station_profile->row();
30+
31+
$footerData = [];
32+
$footerData['scripts'] = [
33+
'assets/js/sections/cabrillo.js'
34+
];
35+
36+
$this->load->view('interface_assets/header', $data);
37+
$this->load->view('cabrillo/index');
38+
$this->load->view('interface_assets/footer', $footerData);
39+
}
40+
41+
public function getContests() {
42+
$this->load->model('Contesting_model');
43+
44+
$station_id = $this->security->xss_clean($this->input->post('station_id'));
45+
$year = $this->security->xss_clean($this->input->post('year'));
46+
$result = $this->Contesting_model->get_logged_contests($station_id, $year);
47+
48+
header('Content-Type: application/json');
49+
echo json_encode($result);
50+
}
51+
52+
public function getYears() {
53+
$this->load->model('Contesting_model');
54+
$station_id = $this->security->xss_clean($this->input->post('station_id'));
55+
56+
$result = $this->Contesting_model->get_logged_years($station_id);
57+
58+
header('Content-Type: application/json');
59+
echo json_encode($result);
60+
}
61+
62+
public function getContestDates() {
63+
$this->load->model('Contesting_model');
64+
$station_id = $this->security->xss_clean($this->input->post('station_id'));
65+
$year = $this->security->xss_clean($this->input->post('year'));
66+
$contestid = $this->security->xss_clean($this->input->post('contestid'));
67+
68+
$result = $this->Contesting_model->get_contest_dates($station_id, $year, $contestid);
69+
70+
header('Content-Type: application/json');
71+
echo json_encode($result);
72+
}
73+
74+
public function export() {
75+
// Set memory limit to unlimited to allow heavy usage
76+
ini_set('memory_limit', '-1');
77+
$this->load->model('Contesting_model');
78+
79+
$this->load->model('stations');
80+
81+
$this->load->model('user_model');
82+
83+
$station_id = $this->security->xss_clean($this->input->post('station_id'));
84+
$contest_id = $this->security->xss_clean($this->input->post('contestid'));
85+
86+
$from = $this->security->xss_clean($this->input->post('contestdatesfrom'));
87+
$to = $this->security->xss_clean($this->input->post('contestdatesto'));
88+
89+
$station = $this->stations->profile($station_id);
90+
91+
$station = $station->row();
92+
93+
$userinfo = $this->user_model->get_by_id($this->session->userdata('user_id'));
94+
95+
$userinfo = $userinfo->row();
96+
97+
$data['qsos'] = $this->Contesting_model->export_custom($from, $to, $contest_id, $station_id);
98+
99+
$data['contest_id'] = $contest_id;
100+
$data['callsign'] = $station->station_callsign;
101+
$data['claimed_score'] = '';
102+
$data['categoryoperator'] = $this->security->xss_clean($this->input->post('categoryoperator'));
103+
$data['categoryassisted'] = $this->security->xss_clean($this->input->post('categoryassisted'));
104+
$data['categoryband'] = $this->security->xss_clean($this->input->post('categoryband'));
105+
$data['categorymode'] = $this->security->xss_clean($this->input->post('categorymode'));
106+
$data['categorypower'] = $this->security->xss_clean($this->input->post('categorypower'));
107+
$data['categorystation'] = $this->security->xss_clean($this->input->post('categorystation'));
108+
$data['categorytransmitter'] = $this->security->xss_clean($this->input->post('categorytransmitter'));
109+
$data['categoryoverlay'] = $this->security->xss_clean($this->input->post('categoryoverlay'));
110+
$data['operators'] = $this->security->xss_clean($this->input->post('operators'));
111+
$data['club'] = $this->security->xss_clean($this->input->post('club'));
112+
$data['name'] = $userinfo->user_firstname . ' ' . $userinfo->user_lastname;
113+
$data['email'] = $userinfo->user_email;
114+
$data['address'] = $this->security->xss_clean($this->input->post('address'));
115+
$data['addresscity'] = $this->security->xss_clean($this->input->post('addresscity'));
116+
$data['addressstateprovince'] = $this->security->xss_clean($this->input->post('addressstateprovince'));
117+
$data['addresspostalcode'] = $this->security->xss_clean($this->input->post('addresspostalcode'));
118+
$data['addresscountry'] = $this->security->xss_clean($this->input->post('addresscountry'));
119+
$data['soapbox'] = $this->security->xss_clean($this->input->post('soapbox'));
120+
$data['gridlocator'] = $station->station_gridsquare;
121+
122+
$this->load->view('cabrillo/export', $data);
123+
}
124+
}

application/controllers/Contesting.php

+27-5
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,39 @@ public function index() {
4242
}
4343

4444
public function getSessionQsos() {
45-
//load model
4645
$this->load->model('Contesting_model');
4746

4847
$qso = $this->input->post('qso');
4948

50-
// get QSOs to fill the table
51-
$data = $this->Contesting_model->getSessionQsos($qso);
49+
header('Content-Type: application/json');
50+
echo json_encode($this->Contesting_model->getSessionQsos($qso));
51+
}
52+
53+
public function getSession() {
54+
$this->load->model('Contesting_model');
55+
56+
header('Content-Type: application/json');
57+
echo json_encode($this->Contesting_model->getSession());
58+
}
59+
60+
public function deleteSession() {
61+
$this->load->model('Contesting_model');
62+
63+
$qso = $this->input->post('qso');
64+
65+
$data = $this->Contesting_model->deleteSession($qso);
5266

5367
return json_encode($data);
5468
}
5569

70+
public function setSession() {
71+
$this->load->model('Contesting_model');
72+
73+
$this->Contesting_model->setSession();
74+
75+
return json_encode("ok");
76+
}
77+
5678
public function create() {
5779
$this->load->model('Contesting_model');
5880
$this->load->library('form_validation');
@@ -161,10 +183,10 @@ public function checkIfWorkedBefore() {
161183
$band = $this->input->post('band');
162184
$mode = $this->input->post('mode');
163185
$contest = $this->input->post('contest');
164-
$qso = $this->input->post('qso');
165186

166187
$this->load->model('Contesting_model');
167-
$result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest, $qso);
188+
189+
$result = $this->Contesting_model->checkIfWorkedBefore($call, $band, $mode, $contest);
168190

169191
header('Content-Type: application/json');
170192
if ($result->num_rows()) {

application/controllers/Dashboard.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function index()
1616
$this->load->model('logbook_model');
1717
$this->load->model('user_model');
1818

19-
// LotW infos
19+
// LoTW infos
2020
$this->load->model('LotwCert');
2121

2222
if($this->optionslib->get_option('version2_trigger') == "false") {

0 commit comments

Comments
 (0)